/* --- Global Styles & Variables --- */
:root {
    --primary-color: #007bff;
    --secondary-color: #823d89; 
    --background-color: #ffffff;
    --text-color: #333;
    --heading-color: #222;
    --light-bg-color: #f8f9fa;
    --border-color: #e0e0e0;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --font-family: 'Poppins', sans-serif;

    /* Dark Mode Colors */
    --dark-bg: #121212;
    --dark-card-bg: #1e1e1e;
    --dark-text: #e0e0e0;
    --dark-heading: #ffffff;
    --dark-border: #333333;
    --dark-card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --dark-primary: #366cad; /* Lighter blue for dark mode */
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 2rem;
}

h1 { font-size: 3rem; line-height: 1.2; }
h2 { font-size: 2.2rem; margin-bottom: 2rem; text-align: center; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: darken(var(--primary-color), 10%);
    text-decoration: underline;
}

ul {
    list-style: none;
    padding-left: 0;
}

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

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

.content-section {
    padding: 6rem 0;
}

.bg-light {
    background-color: var(--light-bg-color);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    margin: 0.5rem 0.5rem 0.5rem 0;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover {
    background-color: darken(var(--primary-color), 10%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}
.btn-secondary:hover {
    background-color: darken(var(--secondary-color), 10%);
     color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
     transform: translateY(-2px);
    text-decoration: none;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}
.btn-sm i {
    margin-right: 0.3rem;
}

/* --- Header & Navigation --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}


#main-header.scrolled {
     background-color: rgba(255, 255, 255, 0.98);
}


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

#main-header .logo a {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--heading-color);
    text-decoration: none;
}

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

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

#main-header .nav-links a {
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    padding-bottom: 5px;
    position: relative;
    transition: color 0.3s ease;
}

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

#main-header .nav-links a:hover,
#main-header .nav-links a.active { 
    color: var(--primary-color);
}

#main-header .nav-links a:hover::after,
#main-header .nav-links a.active::after {
    width: 100%;
}


#main-header .cv-button {
    margin-left: 2rem;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none; 
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--heading-color);
}


/* --- Hero Section --- */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: auto; 
    padding: 6rem 1.5rem 6rem; /* Increased bottom padding */
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), url('images/hero-bg.jpg') center center/cover no-repeat; 
    color: #fff; /* Assuming dark background or overlay */
    position: relative;
}

.hero-section:not([style*="background-image"]) {
    background: linear-gradient(135deg, var(--primary-color), #4e9eff); 
}


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

.hero-content h2 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    text-align: center;
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 2rem auto;
    color: rgba(255, 255, 255, 0.9);
}

.hero-buttons {
    margin-bottom: 3rem; /* Add space below buttons */
}

.hero-buttons .btn {
    margin: 0 0.5rem;
}

/* Override button styles for Hero */
.hero-section .btn-outline {
    color: #fff;
    border-color: #fff;
}
.hero-section .btn-outline:hover {
    background-color: #fff;
    color: var(--primary-color);
}

.scroll-down-link {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    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 .container {
    max-width: 800px;
    text-align: center;
    opacity: 1; 
}
#about strong {
    color: var(--primary-color);
}

/* --- Experience Section (Timeline) --- */
.experience-timeline {
    position: relative;
    margin-top: 3rem;
}

/* The central line */
.experience-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    width: 50%;
    padding: 10px 40px;
    opacity: 0; 
}
.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 60px;
    text-align: right;
}
.timeline-item:nth-child(even) {
    left: 50%;
     padding-left: 60px;
     text-align: left;
}

/* Timeline Icon */
.timeline-icon {
    position: absolute;
    top: 15px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    z-index: 1;
    box-shadow: 0 0 0 4px #fff, inset 0 2px 0 rgba(0,0,0,0.08), 0 3px 0 4px rgba(0,0,0,0.05);
}
.timeline-item:nth-child(odd) .timeline-icon {
    right: -25px; /* Position icon on the line */
    transform: translateX(0%);
}
.timeline-item:nth-child(even) .timeline-icon {
    left: -25px; /* Position icon on the line */
     transform: translateX(0%);
}

.timeline-content {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    position: relative;
}
/* Add arrow pointing to timeline */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
}
.timeline-item:nth-child(odd) .timeline-content::before {
     right: -10px;
     border-width: 10px 0 10px 10px;
     border-color: transparent transparent transparent #fff;
}
.timeline-item:nth-child(even) .timeline-content::before {
     left: -10px;
     border-width: 10px 10px 10px 0;
     border-color: transparent #fff transparent transparent;
}

.timeline-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.timeline-content .company {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}
.timeline-content ul {
    padding-left: 1.2rem;
    list-style: disc;
    margin-top: 0.8rem;
     margin-bottom: 1rem;
}
.timeline-content ul li {
    margin-bottom: 0.4rem;
}

/* Tech Tags */
.tech-tags span, .project-card .tech-tags span {
    display: inline-block;
    background-color: #e9ecef;
    color: var(--secondary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 0.2rem;
    font-weight: 500;
}
.tech-tags.small span {
     font-size: 0.7rem;
     padding: 0.15rem 0.5rem;
}

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

.project-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0; /* Start hidden for animation */
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
}
.project-card p {
    flex-grow: 1; /* Make description take available space */
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.project-card .tech-tags {
    margin-bottom: 1rem;
}
.project-links {
    margin-top: auto; /* Push links to the bottom */
}
.project-links .btn {
    margin-right: 0.5rem;
}

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

.skill-category {
    opacity: 0; /* Hidden for animation */
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}
.skill-category h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}
.skill-category h3 i {
    margin-right: 0.8rem;
    font-size: 1.3rem;
}

.skill-category ul {
    list-style: none;
}
.skill-category ul li {
    margin-bottom: 0.6rem;
    position: relative;
    padding-left: 1.2rem;
}
.skill-category ul li::before {
    content: '✓'; /* Checkmark or other icon */
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 600;
}

/* --- Contact Section --- */
.contact-section {
    background: linear-gradient(to right, #6a11cb 0%, #2575fc 100%); /* Example gradient */
    color: #fff;
}

.contact-section .container {
    text-align: center;
    max-width: 700px;
    opacity: 1; /* Ensure visible by default */
}

.contact-section h2 {
    color: #fff;
}
.contact-section p {
    color: rgba(255, 255, 255, 0.9);
}

.contact-info {
    margin: 2rem 0;
}
.contact-info p {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}
.contact-info i {
    margin-right: 0.8rem;
    width: 20px; /* Align icons */
    text-align: center;
}
.contact-info a {
    color: #fff;
    font-weight: 500;
}
.contact-info a:hover {
    text-decoration: underline;
}

.social-links a {
    color: #fff;
    font-size: 2rem;
    margin: 0 1rem;
    transition: transform 0.3s ease;
    display: inline-block; /* Allows transform */
}
.social-links a:hover {
    transform: scale(1.2) translateY(-3px);
    color: #fff; /* Keep color on hover */
    text-decoration: none;
}


/* --- Footer --- */
#main-footer {
    background-color: #333;
    color: #ccc;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 0; /* Remove space if contact is last */
    position: relative;
}
#main-footer p {
    margin: 0;
    font-size: 0.9rem;
}
.back-to-top {
    position: absolute;
    right: 20px;
    bottom: 15px;
    color: #fff;
    background-color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
}
.back-to-top:hover {
    background-color: darken(var(--primary-color), 10%);
    color: #fff;
    text-decoration: none;
}


/* --- Animations --- */
.animate-on-scroll {
    opacity: 1; /* Start visible */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in {
    opacity: 0;
}
.fade-in.is-visible {
    opacity: 1;
}

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

.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
}
.fade-in-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
}
.fade-in-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}


#about .container, #experience h2, #projects h2, #skills h2, #contact .container {
    opacity: 1;
    transition: opacity 0.8s ease-out;
}


/* --- Responsive Design --- */
@media (max-width: 992px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2rem; }
    .hero-content h1 { font-size: 3rem; }
    .hero-content h2 { font-size: 1.5rem; }

     .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    html { font-size: 15px; }

    /* Mobile Navigation */
    #main-header .nav-links {
        display: none; /* Hide desktop links */
        flex-direction: column;
        position: absolute;
        top: 70px; /* Below header */
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 1rem 0;
        text-align: center;
    }
    #main-header .nav-links.active {
        display: flex; /* Show when active */
    }
    #main-header .nav-links li {
        margin: 1rem 0;
    }
    #main-header .cv-button {
        display: none; 
    }
     .mobile-nav-toggle {
        display: block; /* Show hamburger */
    }

    .hero-section { padding-top: 100px;  }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-content h2 { font-size: 1.3rem; }
    .hero-buttons { display: flex; flex-direction: column; align-items: center; }
    .hero-buttons .btn { width: 80%; max-width: 250px; margin-bottom: 1rem; }

    .content-section { padding: 4rem 0; }

    /* Timeline adjustments for mobile */
     .experience-timeline::before {
        left: 25px; /* Move line to the left */
        transform: translateX(0);
    }
     .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 15px;
        left: 0 !important; 
        text-align: left !important; 
    }
     .timeline-icon {
        left: 0px !important; /* Position icon to the far left */
         transform: translateX(0%);
    }
     .timeline-content::before { /* Adjust arrow */
         left: -10px !important;
         right: auto !important;
         border-width: 10px 10px 10px 0 !important;
         border-color: transparent #fff transparent transparent !important;
    }
    .timeline-item:nth-child(odd), .timeline-item:nth-child(even) {
        padding-left: 70px;
        padding-right: 15px;
        left: 0;
        text-align: left;
    }
     .timeline-item:nth-child(odd) .timeline-icon, .timeline-item:nth-child(even) .timeline-icon {
        left: 0;
        transform: translateX(0);
    }
     .timeline-item:nth-child(odd) .timeline-content::before, .timeline-item:nth-child(even) .timeline-content::before {
         left: -10px;
         right: auto;
         border-width: 10px 10px 10px 0;
         border-color: transparent #fff transparent transparent;
    }


    .project-grid { grid-template-columns: 1fr; } /* Stack projects */
    .skills-grid { grid-template-columns: 1fr; } /* Stack skills */

    .social-links a { font-size: 1.8rem; margin: 0 0.8rem; }
    .back-to-top { display: none; /* Optional: Hide on mobile */ }

    .education-grid,
    .leadership-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    .hero-content h1 { font-size: 2.2rem; }
    .hero-content h2 { font-size: 1.1rem; }
    .btn { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
}

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

.education-item {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    text-align: left;
}

.education-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.education-item .degree {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.education-item .year,
.education-item .location {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

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

.leadership-item {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    text-align: left;
}

.leadership-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.leadership-item .date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Dark Mode Styles */
[data-theme="dark"] {
    --background-color: var(--dark-bg);
    --text-color: var(--dark-text);
    --heading-color: var(--dark-heading);
    --light-bg-color: #1a1a1a;
    --border-color: var(--dark-border);
    --card-shadow: var(--dark-card-shadow);
    --primary-color: var(--dark-primary); /* Use lighter blue in dark mode */
}

[data-theme="dark"] #main-header {
    background-color: rgba(18, 18, 18, 0.9);
}

[data-theme="dark"] #main-header.scrolled {
    background-color: rgba(18, 18, 18, 0.98);
}

[data-theme="dark"] .project-card,
[data-theme="dark"] .skill-category,
[data-theme="dark"] .timeline-content,
[data-theme="dark"] .education-item,
[data-theme="dark"] .leadership-item {
    background-color: var(--dark-card-bg);
}

[data-theme="dark"] .tech-tags span {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--primary-color);
}