/* --- Global Styles & Variables --- */
:root {
    --primary-color: #00aaff; /* Bright blue - adjust as needed */
    --secondary-color: #0077cc;
    --bg-dark: #121212; /* Very dark grey */
    --bg-light-dark: #1e1e1e; /* Slightly lighter dark */
    --text-light: #e0e0e0;
    --text-dark: #cccccc;
    --highlight-color: var(--primary-color); /* Can be same as primary or different */
    --font-family: 'Poppins', sans-serif;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevent horizontal scroll caused by animations */
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.7;
    overflow-x: hidden; /* Ensure no horizontal scroll */
}

h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff; /* Brighter headers */
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block; /* For underline effect */
    left: 50%;
    transform: translateX(-50%);
}

/* Cool underline effect for H2 */
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.5s ease-in-out;
}

/* Animate underline when section is visible (AOS adds 'aos-animate' class) */
section[data-aos] h2.aos-animate::after {
     transform: scaleX(1);
}


p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.content-section {
    padding: 6rem 0;
    overflow: hidden; /* Contain AOS animations */
}

.alt-bg {
    background-color: var(--bg-light-dark);
}

.highlight {
    color: var(--highlight-color);
    font-weight: 700;
}

/* --- tsParticles Background --- */
#tsparticles {
    position: fixed; /* Changed from absolute to fixed for full page background */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind everything */
    background-color: var(--bg-dark); /* Fallback background */
}

/* --- Header & Navigation --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.8); /* Semi-transparent dark */
    backdrop-filter: blur(10px); /* Frosty glass effect */
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s ease;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.main-header.scrolled { /* Add this class via JS on scroll */
     background: rgba(18, 18, 18, 0.95);
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo a {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 400;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-links a:hover,
.nav-links a.active { /* Add 'active' class via JS */
    color: #fff;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}


/* --- Mobile Menu --- */
.menu-toggle {
    display: none; /* Hidden by default */
    flex-direction: column;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 3px 0;
    background-color: var(--text-light);
    transition: all 0.3s ease-in-out;
}


/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column; /* Stack content and scroll indicator */
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative; /* For scroll indicator positioning */
    padding: 0 1rem;
    padding-top: var(--header-height); /* Avoid overlap with fixed header */
    overflow: hidden; /* Important for visual neatness */
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.hero-content p {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
    min-height: 2.5em; /* Prevent layout shift from Typed.js */
}

/* Style the Typed.js cursor */
.typed-cursor {
    color: var(--primary-color);
    opacity: 1;
    animation: blink 0.7s infinite;
}
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.3);
}

.cta-button:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 170, 255, 0.4);
}

.cta-button.large {
     padding: 15px 40px;
     font-size: 1.1rem;
}


/* Scroll Down Indicator */
.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* --- About Section --- */
.about-content {
    display: flex;
    flex-direction: column; /* Default stack */
    align-items: center; /* Center items */
    text-align: center; /* Center text */
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 2rem;
    border: 5px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.3);
}

/* Layout for larger screens */
@media (min-width: 768px) {
    .about-content {
        flex-direction: row; /* Side-by-side */
        text-align: left; /* Align text left */
        align-items: flex-start; /* Align items top */
        gap: 3rem; /* Space between image and text */
    }
     .profile-pic {
         margin-bottom: 0; /* Remove bottom margin when side-by-side */
         flex-shrink: 0; /* Prevent image from shrinking */
     }
}


/* --- Portfolio Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1); /* Smooth zoom */
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.85);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(20px); /* Start slightly lower */
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.portfolio-item:hover img {
    transform: scale(1.1); /* Zoom image on hover */
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-overlay h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.portfolio-overlay p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.portfolio-overlay a {
    margin: 0.3rem;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: inline-flex; /* Align icon nicely */
    align-items: center;
    gap: 5px; /* Space between text and icon */
}

.portfolio-overlay .btn-view {
    background-color: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
}
.portfolio-overlay .btn-view:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.portfolio-overlay .btn-code {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid var(--text-light);
}
.portfolio-overlay .btn-code:hover {
    background-color: var(--text-light);
    color: var(--bg-dark);
}


/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.skill-item {
    background: var(--bg-light-dark);
    padding: 1.5rem 1rem;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.skill-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: #fff; /* Light up text on hover */
}

.skill-item i {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    display: block;
    color: var(--primary-color); /* Icon color */
    transition: transform 0.3s ease;
}

.skill-item:hover i {
    transform: scale(1.1); /* Scale icon on hover */
}

/* --- Contact Section --- */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-social-prompt {
    margin-top: 3rem;
    margin-bottom: 1rem; /* Reduced margin before icons */
    font-size: 0.9rem;
    color: var(--text-dark);
}

.contact-social .fab,
.contact-social .fas {
    font-size: 1.8rem; /* Larger icons for contact */
    margin: 0 0.8rem;
}


/* --- Footer --- */
.main-footer {
    background: var(--bg-light-dark);
    padding: 3rem 1rem;
    text-align: center;
    margin-top: 4rem; /* Space above footer */
    border-top: 1px solid #333; /* Subtle top border */
}

.footer-content p {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--text-dark);
    margin: 0 0.7rem;
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
    h2 {
        font-size: 2rem;
    }

    .navbar {
        padding: 0 1rem; /* Reduce padding on mobile */
    }

    .nav-links {
        position: fixed;
        top: var(--header-height); /* Start below header */
        left: -100%; /* Hidden off-screen */
        width: 100%;
        height: calc(100vh - var(--header-height)); /* Full height minus header */
        flex-direction: column;
        background: var(--bg-light-dark); /* Solid background for mobile menu */
        justify-content: center;
        align-items: center;
        transition: left 0.5s cubic-bezier(0.19, 1, 0.22, 1);
        padding-bottom: var(--header-height); /* Add padding at bottom */
    }

    .nav-links.active {
        left: 0; /* Slide in */
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .nav-links a {
        font-size: 1.2rem;
    }
    /* Don't show underline on mobile nav links */
    .nav-links a::after {
        display: none;
    }

    .menu-toggle {
        display: flex; /* Show hamburger */
        z-index: 1; /* Ensure it's clickable above overlay */
    }

    /* Hamburger animation */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }


    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.3rem;
    }

    .content-section {
        padding: 4rem 0;
    }

    .container {
        padding: 0 1rem;
    }

     .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 1rem;
    }
    .skill-item {
        padding: 1rem 0.5rem;
    }
    .skill-item i {
        font-size: 2rem;
    }
}

/* --- AOS Anchor Placement Fix --- */
/* Offset scroll position for anchors due to fixed header */
[data-aos-id], section[id] {
  scroll-margin-top: var(--header-height);
}
