/* --- Global Styles & Variables --- */
:root {
    --bg-color: #0d1117; /* GitHub Dark Dimmed Background */
    --primary-color: #2a9d8f; /* Tealish Green */
    --secondary-color: #e76f51; /* Coral */
    --accent-color: #58a6ff; /* GitHub Link Blue */
    --text-color: #c9d1d9; /* GitHub Dark Dimmed Text */
    --header-bg: rgba(13, 17, 23, 0.8); /* Slightly transparent header */
    --card-bg: #161b22; /* GitHub Dark Dimmed Card Background */
    --border-color: #30363d;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Roboto Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Optional: Matrix Background Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind everything */
    opacity: 0.1; /* Subtle effect */
}


h1, h2, h3 {
    font-family: var(--font-secondary);
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block; /* Allows ::after to position correctly */
    left: 50%;
    transform: translateX(-50%);
}

/* Underline effect for section titles */
h2::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 3px;
    background-color: var(--secondary-color);
    bottom: -10px;
    left: 20%;
    border-radius: 5px;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
}

section {
    padding: 6rem 2rem 4rem; /* Top padding compensates for fixed header */
    min-height: 80vh; /* Give sections some space */
}

.section-container {
    display: flex;
    flex-direction: column;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(10px); /* Glassmorphism effect */
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    height: 70px;
}

.logo {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    position: relative;
    padding-bottom: 5px;
}

/* Underline hover effect for nav links */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after { /* Add 'active' class via JS if desired */
    width: 100%;
}

.burger {
    display: none; /* Hidden on desktop */
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

/* --- Hero Section --- */
#hero {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Full viewport height */
    text-align: center;
    padding-top: 70px; /* Offset for fixed header */
    position: relative; /* For potential future background elements */
    background: linear-gradient(rgba(13, 17, 23, 0.8), rgba(13, 17, 23, 1)),
                url('https://source.unsplash.com/random/1600x900/?technology,code') no-repeat center center/cover; /* Example background */
    /* Add a subtle animation */
    animation: subtleGradientShift 15s ease infinite alternate;
}

@keyframes subtleGradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}


.hero-content {
    align-items: center;
}

.hero-content div {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: #fff; /* Brighter for hero */
}

.hero-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-family: var(--font-primary); /* Match body font for this */
    font-weight: 400;
}

#typing-effect {
    font-weight: 600;
    border-right: 3px solid var(--secondary-color); /* Cursor effect */
    padding-right: 5px;
    animation: blinkCursor 0.7s step-end infinite;
    display: inline-block; /* Needed for border */
    min-height: 1.2em; /* Prevent layout shift */
}

@keyframes blinkCursor {
    from, to { border-color: transparent }
    50% { border-color: var(--secondary-color); }
}


.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-color);
}

.wave {
    display: inline-block;
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave-animation {
    0% { transform: rotate(0.0deg) }
    10% { transform: rotate(14.0deg) }
    20% { transform: rotate(-8.0deg) }
    30% { transform: rotate(14.0deg) }
    40% { transform: rotate(-4.0deg) }
    50% { transform: rotate(10.0deg) }
    60% { transform: rotate(0.0deg) }
    100% { transform: rotate(0.0deg) }
}


.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: 2px solid var(--primary-color);
}

.cta-button:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* --- About Section --- */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    background-color: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
    transition: transform 0.3s ease;
}

.about-content:hover {
    transform: translateY(-5px);
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.about-content strong {
    color: var(--primary-color);
    font-weight: 600;
}


/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-category {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(42, 157, 143, 0.1);
}


.skill-category h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.skill-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center; /* Center icons */
}

.skill-icons img {
    height: 30px; /* Adjust badge size */
    transition: transform 0.2s ease;
}

.skill-icons img:hover {
    transform: scale(1.1);
}


/* --- Experience Section (Timeline) --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem 0;
}

/* The vertical line */
.timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
    opacity: 0.3;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

/* Icon */
.timeline-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    right: -25px;
    background-color: var(--secondary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid var(--bg-color);
}

.timeline-icon i {
    font-size: 1.5rem;
    color: #fff;
}

/* Place items on the left */
.timeline-item:nth-child(odd) {
    left: 0;
}

/* Place items on the right */
.timeline-item:nth-child(even) {
    left: 50%;
}

/* Adjust icon position for right items */
.timeline-item:nth-child(even) .timeline-icon {
    left: -25px;
}

/* Add arrows to the left container (pointing right) */
.timeline-item:nth-child(odd)::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--border-color);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--card-bg);
}

/* Add arrows to the right container (pointing left) */
.timeline-item:nth-child(even)::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--border-color);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--card-bg) transparent transparent;
}


/* Fix the circle positioning on right side */
.timeline-item:nth-child(even) {
    padding-left: 40px;
    padding-right: 0; /* Reset padding */
}
.timeline-item:nth-child(odd) {
     padding-right: 40px;
     padding-left: 0; /* Reset padding */
     text-align: right;
}


.timeline-content {
    padding: 20px 30px;
    background-color: var(--card-bg);
    position: relative;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    font-size: 1.4rem;
}

.timeline-company {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.2rem;
}

.timeline-date {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 0.8rem;
}

.timeline-content p {
    font-size: 0.95rem;
}


/* --- GitHub Stats Section --- */
#github {
    background-color: var(--card-bg);
}

.github-stats, .github-trophies {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.github-stats img, .github-trophies img {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color); /* Ensure bg matches */
}


/* --- Contact Section --- */
#contact {
    text-align: center;
}

#contact p {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.contact-link-btn {
    display: inline-flex; /* Align icon and text */
    align-items: center;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent; /* For hover effect */
}

.contact-link-btn i {
    margin-right: 0.7rem;
    font-size: 1.3rem; /* Make icon slightly larger */
}

.contact-link-btn.linkedin {
    background-color: #0A66C2;
    color: white;
    border-color: #0A66C2;
}
.contact-link-btn.linkedin:hover {
    background-color: transparent;
    border-color: #0A66C2;
    color: #0A66C2;
}

.contact-link-btn.email {
    background-color: #0078D4;
    color: white;
    border-color: #0078D4;
}
.contact-link-btn.email:hover {
    background-color: transparent;
    border-color: #0078D4;
    color: #0078D4;
}

.contact-link-btn.github {
    background-color: #6e40c9; /* GitHub Purple */
    color: white;
    border-color: #6e40c9;
}
.contact-link-btn.github:hover {
    background-color: transparent;
    border-color: #6e40c9;
    color: #6e40c9;
}


/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
}

.heart {
    color: var(--secondary-color);
    display: inline-block;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}


/* --- Responsive Design --- */

@media (max-width: 992px) {
    h2 { font-size: 2rem; }
    .hero-content h1 { font-size: 2.8rem; }
    .hero-content h2 { font-size: 1.7rem; }

     /* Timeline adjustments */
    .timeline::after {
        left: 31px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        text-align: left !important; /* Override odd item alignment */
    }
     .timeline-item:nth-child(odd),
     .timeline-item:nth-child(even) {
        left: 0%;
        padding-left: 70px; /* Ensure consistent padding */
        padding-right: 25px;
    }
    .timeline-icon {
        left: 6px; /* Move icon to the left */
    }
     .timeline-item:nth-child(even) .timeline-icon {
        left: 6px; /* Consistent icon position */
    }
    /* Point arrows to the left */
    .timeline-item::before {
        left: 60px;
        border: medium solid var(--border-color);
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--card-bg) transparent transparent;
    }
     .timeline-item:nth-child(odd)::before,
     .timeline-item:nth-child(even)::before {
        left: 60px;
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--card-bg) transparent transparent;
    }
}


@media (max-width: 768px) {
    body {
        /* overflow-x: hidden; Prevent body scroll when nav is open */
    }
    .nav-links {
        position: fixed;
        right: 0;
        top: 70px; /* Height of the header */
        background: var(--bg-color);
        height: calc(100vh - 70px);
        width: 60%;
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        border-left: 1px solid var(--border-color);
    }
    .nav-links li {
        margin-left: 0;
        opacity: 0; /* For animation */
    }
    .burger {
        display: block; /* Show burger */
    }

    .nav-active {
        transform: translateX(0%);
    }

     /* Burger animation */
    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .toggle .line2 {
        opacity: 0;
    }
    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    /* Nav links fade in animation */
    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0px);
        }
    }

    .hero-content h1 { font-size: 2.5rem; }
    .hero-content h2 { font-size: 1.5rem; }
    .hero-content p { font-size: 1rem; }

    section { padding: 4rem 1rem 2rem; }
    h2 { font-size: 1.8rem; margin-bottom: 2rem; }

    .github-stats img { width: 90%; } /* Stack stats images */
}