/* Custom Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&family=Montserrat:wght@700&display=swap');

:root {
    /* Color Palette for LIGHT MODE (High Contrast & Modern) */
    --primary-color: #1c2a47; /* Deep Navy Blue (Main Accent/Strong Contrast) */
    --secondary-color: #3c7cb1; /* Soft Muted Silver/Gray (Subtle Accent/Borders) */
    
    --text-color: #212121; /* Near-Black for body text */
    --link-color: var(--primary-color); /* Navy links */
    --bg-color-light: #ffffff; /* Pure White Background */
    --card-bg-light: #f7f7f7; /* Off-White card background */
    
    /* Variable Mapping for Light Theme Usage */
    --primary-gradient: linear-gradient(135deg, #1c2a47, #4c6a99); /* Navy to Medium Blue for gradients/buttons */
    --secondary-gradient: linear-gradient(135deg, var(--card-bg-light), var(--bg-color-light));
    --bg-color-dark: var(--bg-color-light); /* Main background */
    --card-bg-dark: var(--card-bg-light); /* Card background */

    --border-glow: rgba(28, 42, 71, 0.15); /* Light Navy tint for borders */
    --hover-glow: #4c6a99; /* Medium Blue/Gray for hover states */
    --shadow-color: rgba(0, 0, 0, 0.1); /* Soft shadow */
    
    /* Typography */
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Poppins', sans-serif;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    /* Changed to light background */
    background-color: var(--bg-color-light); 
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Global Styles */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s;
}

a:hover {
    color: var(--hover-glow);
    /* Adjusted text-shadow for light theme contrast */
    text-shadow: 0 0 5px rgba(76, 106, 153, 0.5); 
}

h1, h2, h3 {
    font-family: var(--heading-font);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 0.5rem;
    display: inline-block;
    width: auto;
    left: 50%;
    transform: translateX(-50%);
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    /* Uses the navy gradient for a strong underline */
    background: var(--primary-gradient); 
    border-radius: 5px;
}

section {
    padding: 6rem 10%;
    min-height: 100vh;
    position: relative;
    opacity: 0; 
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.btn {
    display: inline-block;
    background: var(--primary-gradient);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: white; /* White text on navy button */
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    /* Adjusted shadow to match light theme primary color */
    box-shadow: 0 8px 25px rgba(28, 42, 71, 0.3); 
    color: white; 
}

/* --- Navbar --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 10%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    /* Use a solid light background, no heavy blur */
    backdrop-filter: none; 
    background-color: var(--bg-color-light); 
    box-shadow: 0 2px 10px var(--shadow-color);
}

.logo {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    /* Use solid primary color for logo in light mode */
    background: none; 
    color: var(--primary-color);
    text-shadow: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2.5rem;
}

.nav-links a {
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.5rem 0;
    position: relative;
    color: var(--text-color); /* Ensure links are dark */
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--hover-glow); /* Medium blue underline */
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger, .dark-toggle {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s;
}

.hamburger {
    display: none; 
}

/* --- Floating Social Bar --- */
.social-bar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.social-bar a {
    display: block;
    font-size: 1.5rem;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color); /* Navy icon color */
    background-color: var(--card-bg-light); /* Off-white background */
    border-radius: 8px 0 0 8px;
    border-left: 3px solid var(--secondary-color); /* Subtle silver border */
    box-shadow: -3px 0 10px var(--shadow-color);
    transition: background-color 0.3s, transform 0.3s, border-color 0.3s;
}

.social-bar a:hover {
    transform: translateX(-10px);
    background-color: var(--primary-color); /* Navy background on hover */
    border-color: var(--hover-glow);
    color: white; /* White icon on hover */
}

/* --- Hero Section --- */
/* --- Hero Section - Two-Column Layout --- */

/* UPDATE: Change #hero to use flexbox to center the main content vertically */
#hero {
    display: flex;
    align-items: center; 
    justify-content: center;
    /* Remove text-align: center; from here */
    height: 100vh;
    padding: 6rem 10%; /* Re-apply section padding */
    overflow: hidden;
    background-color: var(--bg-color); /* Use general BG variable */
}

.hero-bg, #particle-canvas {
    /* Keep these positioned absolutely for the background */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/* NEW: Container for the 2-Column Content */
.hero-main-content {
    display: flex;
    align-items: center; /* Vertically center the image and text */
    justify-content: center;
    max-width: 1200px; /* Limit overall width */
    width: 100%;
    gap: 4rem; /* Space between image and text */
    z-index: 10;
}

/* NEW: Profile Image Styling (Left Column) */
.hero-image {
    position: relative;
    min-width: 280px; /* Ensure it stays a decent size */
    max-width: 320px;
    height: 350px; 
    width: 320px;
    border-radius: 50%; /* Make it circular */
    overflow: hidden;
    border: 8px solid var(--primary-color); 
    box-shadow: 0 0 40px var(--border-glow); 
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hero-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px var(--hover-glow);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}


/* UPDATE: Adjust .hero-content for the right column */
.hero-content {
    max-width: 600px; /* Max width for the text block */
    text-align: left; /* Align text content to the left */
    z-index: 10;
}

/* Adjustments for Text within the right column */
.hero-content h1 {
    font-size: 4.5rem;
    margin-bottom: 0.5rem;
    /* Re-using existing primary color and shadow styles */
    color: var(--primary-color); 
    text-shadow: 0 0 10px var(--border-glow);
}

.hero-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color); 
    left: 0;
    transform: none;
    text-align: left; /* Ensure H2 is left-aligned */
}

.hero-content h2::after {
    display: none;
}

.typed-text {
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
    min-height: 25px; 
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.btn {
    /* Ensure the button aligns with the left-aligned text */
    display: inline-block; 
}


/* Media Query for Hero Responsiveness */
@media (max-width: 1024px) {
    nav{
        display: none;
    }

    .typed-text{
        font-size: 10px;
    }
    .hero-main-content {
        flex-direction: column; /* Stack image and text vertically */
        text-align: center;
        gap: 1rem;
    }
    
    .hero-image {
        top: 20px;
        margin-bottom: 1rem;
        width: 200px;
        height: 300px;
    }


    .hero-content {
        text-align: center; /* Center text when stacked */
        font-size: 10px;
    }
    
    .hero-content h1, .hero-content h2 {
        text-align: center; /* Re-center headings when stacked */
        font-size: 1.5rem; /* Adjust H1 size for smaller screens */
    }
}

.typed-text {
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
    min-height: 25px; 
    margin-bottom: 2rem;
    color: var(--primary-color); /* Highlight text in Navy */
}

/* --- About Section --- */
#about {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Alternate section background for visual break */
    background-color: var(--card-bg-light); 
}

.about-container {
    display: flex;
    gap: 4rem;
    max-width: 1200px;
    align-items: center;
    /* White card background */
    background: var(--bg-color-light); 
    padding: 3rem;
    border-radius: 15px;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 10px 30px var(--shadow-color);
    /* Remove blur */
    backdrop-filter: none;
}

.about-img {
    min-width: 250px;
    max-width: 300px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--hover-glow); /* Medium blue border */
    box-shadow: 0 0 20px var(--border-glow);
    transition: transform 0.5s ease;
}

.about-img:hover {
    transform: scale(1.05) rotate(2deg);
}

.about-img img {
    width: 100%;
    display: block;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.about-text ul {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.about-text ul li {
    font-weight: 500;
}

.about-text ul li::before {
    content: '*';
    margin-right: 10px;
    font-size: 1.1rem;
}

/* --- Education & Experience Section (Modified for Alternating Layout) --- */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    /* Uses the secondary color for a subtle line */
    background-color: var(--secondary-color); 
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    background: var(--card-bg-light); /* Off-white card */
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid var(--border-glow);
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 1. Item Positioning */
/* Odd items (1st, 3rd, etc.) go on the LEFT side of the line */
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right; /* Align text right for left-sided items */
}

/* Even items (2nd, 4th, etc.) go on the RIGHT side of the line */
.timeline-item:nth-child(even) {
    left: 50%;
    transform: translateX(0); /* Aligns to the 50% line */
    text-align: left; /* Align text left for right-sided items */
}


.timeline-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.timeline-item h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.timeline-date {
    display: block;
    margin-bottom: 0.75rem;
    font-style: italic;
    color: var(--text-color); /* Dark text for dates */
}

.timeline-item ul {
    list-style: none;
}

/* Adjust bullet points for left/right alignment */
.timeline-item:nth-child(odd) ul {
    padding-right: 20px;
}

.timeline-item:nth-child(even) ul {
    padding-left: 20px;
}

.timeline-item ul li {
    margin-bottom: 0.3rem;
    position: relative;
}

.timeline-item ul li::before {
    content: '•';
    color: var(--hover-glow);
    font-weight: bold;
    display: inline-block;
    width: 1em;
}

/* Bullet point adjustment for left-aligned text (odd items) */
.timeline-item:nth-child(odd) ul li {
    text-align: right;
}

.timeline-item:nth-child(odd) ul li::before {
    margin-left: 0;
    margin-right: 5px;
}

/* Bullet point adjustment for right-aligned text (even items) */
.timeline-item:nth-child(even) ul li {
    text-align: left;
}

.timeline-item:nth-child(even) ul li::before {
    margin-left: -1em;
}


/* 2. Dot Positioning */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--primary-color); /* Navy dot */
    border: 4px solid var(--bg-color-light); /* White border */
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}

/* Dot on the right of odd items (left side of timeline) */
.timeline-item:nth-child(odd)::after {
    right: -7.5px;
    left: auto;
}

/* Dot on the left of even items (right side of timeline) */
.timeline-item:nth-child(even)::after {
    left: -7.5px;
    right: auto;
}

/* Removed old ::before styles as they are not needed with this layout */
.timeline-item:nth-child(odd)::before, 
.timeline-item:nth-child(even)::before {
    content: none;
}

/* --- Skills & Projects Section (From previous request) --- */

/* Detailed Skills Layout */
.skills-detail-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto 5rem;
    padding: 2rem;
    background: var(--card-bg-light);
    border-radius: 10px;
    border: 1px solid var(--border-glow);
    box-shadow: 0 5px 20px var(--shadow-color);
}

.skills-column h3 {
    font-family: var(--heading-font);
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--hover-glow);
    display: inline-block;
}

.skills-column ul {
    list-style: none;
    padding: 0;
}

.skills-column ul li {
    background: var(--bg-color-light);
    padding: 1rem;
    margin-bottom: 15px;
    border-left: 5px solid var(--hover-glow);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-size: 1rem;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.skills-column ul li:hover {
    transform: translateX(5px);
    border-left-color: var(--primary-color);
}

.skills-column ul li strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

/* Hidden elements from the old skill bar design */
.skill-circle, .circle, .bar {
    display: none !important; 
}


/* Projects Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: var(--bg-color-light);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 5px 20px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.project-card h3 {
    color: var(--primary-color); 
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--text-color);
    font-style: italic;
}


/* --- Contact Section --- */
.contact-container {
    display: flex;
    justify-content: center;
    gap: 5rem;
    max-width: 1000px;
    margin: 0 auto;
    background: var(--card-bg-light);
    padding: 3rem;
    border-radius: 15px;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 10px 30px var(--shadow-color);
    backdrop-filter: none;
}

.contact-info {
    max-width: 350px;
}

.contact-details-list p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.contact-details-list p::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color); /* Navy icon color */
    margin-right: 15px;
    font-size: 1.2rem;
}

.contact-details-list p:nth-child(1)::before { content: '\f0e0'; } 
.contact-details-list p:nth-child(2)::before { content: '\f095'; } 
.contact-details-list p:nth-child(3)::before { content: '\f3c5'; } 


.social-icons a {
    font-size: 1.8rem;
    margin-right: 1.5rem;
    transition: color 0.3s, transform 0.3s;
    color: var(--primary-color); /* Default navy icon color */
}

.social-icons a:hover {
    transform: scale(1.2);
    color: var(--hover-glow);
}

#contactForm {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
}

#contactForm input, #contactForm textarea {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: none;
    background-color: rgba(0, 0, 0, 0.05); /* Light input background */
    color: var(--text-color);
    border-radius: 8px;
    border-bottom: 2px solid var(--secondary-color);
    transition: border-bottom-color 0.3s, background-color 0.3s;
    font-family: var(--body-font);
}

#contactForm input:focus, #contactForm textarea:focus {
    outline: none;
    background-color: rgba(0, 0, 0, 0.1);
    border-bottom-color: var(--primary-color); /* Navy border on focus */
}

#contactForm button {
    cursor: pointer;
    border: none;
}


/* --- Footer --- */
footer {
    text-align: center;
    padding: 1.5rem 10%;
    border-top: 1px solid var(--secondary-color);
    background-color: var(--card-bg-light);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    font-size: 0.9rem;
    color: var(--text-color);
}

.scroll-top {
    position: absolute;
    right: 30px;
    background: var(--primary-color); /* Solid Navy button */
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(28, 42, 71, 0.4);
    color: white;
    background: var(--hover-glow); /* Medium blue on hover */
}

/* --- Media Queries (Responsiveness) --- */
@media (max-width: 1024px) {
    section {
        padding: 4rem 5%;
    }
    
    .nav-links {
        margin-left: 1rem;
    }

    .timeline::after {
        left: 31px;
        background-color: var(--secondary-color);
    }

    .timeline-item {
        width: 100%;
        padding-left: 80px;
        padding-right: 25px;
        left: 0 !important; /* Force all items to the left for mobile */
        text-align: left !important; /* Align text left for mobile */
    }

    .timeline-item:nth-child(even) {
        transform: translateX(0); /* Ensure no horizontal shift on mobile */
    }

    .timeline-item::after {
        left: 23px !important;
        right: auto !important;
        border-color: var(--bg-color-light); /* White border around dot */
    }

    /* Resetting dot position for mobile */
    .timeline-item:nth-child(odd)::after, 
    .timeline-item:nth-child(even)::after {
        left: 23px !important;
        right: auto !important;
    }
    
    .timeline-item:nth-child(odd), .timeline-item:nth-child(even) {
        text-align: left;
    }

    .timeline-item:nth-child(odd) ul {
        padding-right: 0;
        padding-left: 20px;
    }

    .timeline-item:nth-child(odd) ul li {
        text-align: left;
    }

    .timeline-item:nth-child(odd) ul li::before {
        margin-left: -1em;
        margin-right: 10px;
    }
    
    .timeline-item:nth-child(odd)::before, .timeline-item:nth-child(even)::before {
        content: none; 
    }

    .skills-detail-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
        margin-bottom: 3rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }
    h2 {
        font-size: 2rem;
    }

    .nav-links {
        background-color: var(--bg-color-light); /* Light background for mobile menu */
    }
    
    .hamburger {
        display: block;
        z-index: 1001;
        margin-left: 1rem;
    }
    
    .about-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding: 2rem;
    }

    .about-img {
        max-width: 200px;
    }

    .social-bar {
        background-color: var(--card-bg-light); /* Light background for floating bar */
    }

    .social-bar a {
        border-bottom: 3px solid var(--secondary-color);
        box-shadow: 0 -3px 10px var(--shadow-color);
    }

    .social-bar a:hover {
        transform: translateY(-5px);
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }

    /* --- FIX: Contact Section Mobile Layout --- */
    .contact-container {
        /* Change to vertical stack */
        flex-direction: column; 
        gap: 3rem; /* Reduced gap for stacking */
        padding: 2rem 1.5rem; /* Tighter padding for mobile */
        text-align: center; /* Center content like text and lists */
        max-width: 90%; /* Allow it to take more screen width */
    }

    .contact-info {
        max-width: 100%; /* Allows it to use full width */
        margin: 0 auto; /* Center the block itself */
    }

    /* Ensure text aligns correctly for the introductory paragraph */
    #contact section p {
        text-align: center;
    }

    .contact-details-list {
        /* Center the list of contact items */
        text-align: left;
        display: flex; /* Make the list items stack nicely */
        flex-direction: column;
        align-items: flex-start; /* Aligns content of the list to the left */
        margin: 0 auto; /* Center the list itself */
        max-width: 300px; /* Constrain the list for better centering */
    }

    .contact-details-list p {
        /* Reset any conflicting alignment */
        justify-content: flex-start; 
        margin: 0.75rem 0; /* Add vertical spacing */
        font-size: 1rem;
    }

    .social-icons {
        margin-top: 1.5rem; /* Add space above social icons */
        text-align: center; /* Center the social icons container */
    }
    
    .social-icons a {
        margin: 0 0.75rem; /* Adjust spacing between icons */
    }

    /* Keep contact form full width and centered */
    #contactForm {
        max-width: 100%;
    }
}