/* ======== 1. GLOBAL & VARIABLES ======== */
:root {
    /* Keep --bg-color as a fallback color */
    --bg-color: #0a192f;
    --primary-color: #64ffda;
    --secondary-color: #112240;
    --text-light: #ccd6f6;
    --text-dark: #8892b0;
    --text-white: #ffffff;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Raleway', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 10rem;
}

body {
    font-family: var(--font-primary);
    
    /* FALLBACK: Used if the image fails to load */
    background-color: var(--bg-color); 
    
    /* --- WALLPAPER STYLES --- */
    background-image: url("https://i.imgur.com/Ez38nsW.jpeg");
    background-position: center;
    background-size: cover; 
    background-attachment: fixed; 
    
    color: var(--text-dark);
    line-height: 1.6;
}

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

a:hover {
    color: var(--text-white);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    color: var(--text-light);
    font-weight: 700;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}
/* ======== 2. HEADER & NAVIGATION (IMPROVED) ======== */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    /* Increased opacity slightly to stand out better */
    background-color: rgba(10, 25, 47, 0.98); 
    backdrop-filter: blur(10px);
    z-index: 1000;
    height: 80px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
}

.navbar {
    display: flex;
    /* Use gap for cleaner spacing between logo and menu */
    justify-content: space-between; 
    align-items: center;
    width: 100%;
    /* Set a max-width for internal content for better control */
    max-width: 1100px; 
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    font-size: 1.25rem; /* Slightly larger logo */
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    /* Reduced gap slightly for compact, clean look on desktop */
    gap: 1.3rem; 
    align-items: center;
    /* Added padding-right to balance the contact link */
    padding-right: 10px;
}

.nav-link {
    font-size: 0.9rem; /* Slightly larger text for desktop readability */
    font-weight: 500;
    padding: 5px 0;
    /* ... rest of the nav-link styles ... */
}

/* ======== 2. HEADER & NAVIGATION (FIXED ALIGNMENT) ======== */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    height: 80px; /* Reduced height slightly for better look */
    transition: all 0.3s ease-in-out; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center; /* Ensures content is centered vertically */
}

.header.scrolled {
    height: 70px;
    background-color: rgba(30, 30, 30, 0.95);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* Added slight padding */
}

/* Logo Sizing */
.nav-logo {
    font-family: var(--font-secondary);
    font-size: 1.2rem; /* Adjusted for cleaner look */
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-shrink: 0;
    line-height: 1.2; /* Ensures cleaner line break if it wraps */
}

/* Menu Spacing (Balanced but compact) */
.nav-menu {
    display: flex;
    gap: 18px; /* Balanced gap for all 7 items */
    align-items: center;
}

.nav-link {
    font-family: var(--font-primary);
    color: var(--text-light);
    font-size: 0.85rem; 
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    white-space: nowrap; /* Essential to prevent awkward wrapping */
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.nav-close-btn {
    display: none;
}

/* --- NEW FIX: Tighter Spacing for Medium Desktops (Prevents crowding on intermediate screens) --- */
@media (max-width: 1200px) {
    .nav-menu {
        gap: 12px; /* Reduce gap further for smaller screens */
    }
    
    .nav-link {
        font-size: 0.8rem; /* Slightly smaller font to fit */
    }
    
    .nav-logo {
        font-size: 1.1rem;
    }
}



/* ======== 3. HERO SECTION ======== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
}

.hero-content {
    max-width: 800px;
}

.hero-sub-title {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.hero-title {
    font-size: 4.5rem;
    margin: 0.5rem 0;
}

.hero-description {
    font-size: 1.5rem;
    color: var(--text-light);
    min-height: 2.2rem;
}

.typing-text {
    border-right: 3px solid var(--primary-color);
    animation: blinkCursor 0.75s step-end infinite;
}

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

/* ======== 4. BUTTONS ======== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: 2px solid var(--primary-color);
    margin-top: 2rem;
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

/* ======== 5. ABOUT SECTION ======== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.about-image img {
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.about-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-content p {
    margin-bottom: 1.5rem;
}

/* NEW SKILLS SECTION STYLES */
.skills-section {
    padding: 2rem 0;
}

.skills-container {
    display: flex;
    justify-content: center;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.skill-tag {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid var(--text-dark);
    transition: 0.3s;
}

.skill-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ======== 6. EXPERIENCE & EDUCATION TIMELINE ======== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--secondary-color);
    top: 0;
    bottom: 0;
    left: 30px;
}

.timeline-item {
    padding: 1rem 0 2rem 4rem;
    position: relative;
}

.timeline-dot {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 4px solid var(--bg-color);
    top: 15px;
    left: 20px;
    z-index: 1;
}

.timeline-content {
    background-color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    position: relative;
}

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

.timeline-company {
    font-weight: 600;
    color: var(--text-light);
    font-size: 1.1rem;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ======== 7. PROJECTS SECTION (FIXED SIDE-BY-SIDE) ======== */

.project-grid {
    display: grid;
    /* Ensures they stay side-by-side on desktop */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    gap: 2rem;
    width: 100%;
    margin-top: 40px; /* Added slight top margin for spacing */
}

.project-card {
    background-color: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    
    /* --- FIX: Use Flexbox for consistent internal alignment --- */
    display: flex;
    flex-direction: column;
    height: 100%; 
}

.project-card:hover {
    transform: translateY(-5px); /* Reduced lift on hover for subtle effect */
    box-shadow: 0 20px 30px -15px rgba(2, 12, 27, 0.7);
}

.project-card img {
    width: 100%;
    /* Kept height at 200px for consistency */
    height: 200px; 
    object-fit: cover;
}

.project-card h3 {
    font-size: 1.4rem;
    /* Added this to separate title from content */
    margin-bottom: 0.5rem; 
    padding: 1.5rem 1.5rem 0.5rem;
}

.project-card p {
    /* Use flex-grow to ensure descriptions fill the available space evenly */
    flex-grow: 1; 
    padding: 0 1.5rem 1.5rem;
    font-size: 0.9rem; 
}


/* ======== 8. CONTACT SECTION ======== */
.contact-description {
    text-align: center;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.contact-info-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.contact-item:hover {
    color: var(--primary-color);
}

.contact-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.contact-item:hover i {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--text-dark);
    background-color: var(--secondary-color);
    border-radius: 4px;
    color: var(--text-light);
    font-family: var(--font-primary);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ======== 9. FOOTER ======== */
.footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--secondary-color);
    margin-top: 4rem;
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    margin: 0 0.5rem;
    font-size: 0.9rem;
}

/* ======== 10. ANIMATIONS ======== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ======== 11. RESPONSIVE DESIGN (TABLET & MOBILE) ======== */
@media (max-width: 1024px) {
    /* Ensure items wrap nicely on tablet if needed, or adjust nav */
    .nav-menu {
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .nav-logo { order: 1; }
    .hamburger { order: 2; }
    .nav-menu { order: 3; }
}

@media (max-width: 850px) { 
    /* Navigation turns into Mobile Menu at 850px so items don't get squished */
    .nav-menu {
        position: fixed;
        right: -100%;
        top: 0;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: right 0.4s ease-in-out;
        gap: 0;
        padding-top: 5rem;
    }
    .nav-item { width: 100%; margin: 0 !important; /* Override inline style */ }
    .nav-link {
        display: block;
        padding: 1rem 0;
        font-size: 1.5rem;
    }
    .nav-menu.active { right: 0; }
    .hamburger { display: block; }
    
    .nav-close-btn {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1.5rem;
        font-size: 3rem;
        color: var(--text-light);
        cursor: pointer;
    }
    
    .hero-title { font-size: 3rem; }
    .about-grid { grid-template-columns: 1fr; text-align: center; }
    
    /* Projects stack on mobile automatically due to grid-template-columns: repeat(auto-fit...) */
}
