@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --primary-color: #44355B; /* Muted Brown from portfolio */
    --secondary-color: #F5F5F5; /* Off-white */
    --accent-color: #20152c; /* Darker purple/brown accent */
    --text-color: #333;
    --bg-color: #FFFFFF;
    --dark-bg-color: #212121; /* For dark sections or contrast */
    --nav-height: 70px;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
}

h1, h2, h3 {
    font-family: var(--font-primary);
    margin-bottom: 20px;
    color: var(--primary-color);
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; text-align: center; }
h3 { font-size: 1.6rem; }

p {
    margin-bottom: 15px;
}

a {
    text-decoration: none;
    color: var(--accent-color);
}
a:hover {
    text-decoration: underline;
}

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

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--nav-height);
}

nav .logo {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}
nav .logo:hover {
    text-decoration: none;
}

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

.nav-links li a {
    font-family: var(--font-primary);
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 15px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a.active { /* Assuming active class might be set by JS for current section */
    color: var(--accent-color);
    text-decoration: none;
}

.burger {
    display: none;
    cursor: pointer;
    position: relative; /* For z-index if needed */
    z-index: 1001; /* Above nav background, below potential full screen overlay */
}

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

/* Back to Top Button */
#backToTopBtn {
    display: none; 
    justify-content: center; 
    align-items: center; 
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999; 
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    cursor: pointer;
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    font-size: 22px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    padding: 0; 
    opacity: 0; 
    transform: scale(0.8);
}
#backToTopBtn.show {
    display: flex;
    opacity: 1;
    transform: scale(1);
}
#backToTopBtn:hover {
    background-color: var(--accent-color); 
    text-decoration: none;
    color: var(--secondary-color);
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--nav-height) 20px 20px; 
    background: url('hero.jpg') no-repeat center center/cover; 
    color: var(--bg-color); 
    position: relative;
}
#hero::before { 
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.692); /* Dark overlay */
}
.hero-content {
    position: relative; 
    z-index: 1; /* Above the overlay */
}
.profile-pic-hero {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--accent-color);
    margin-bottom: 20px;
    margin-top: 20px; 
}
#hero h1, #hero h2 {
    color: var(--bg-color); 
}
#hero h1 {
    font-size: 3.5rem;
}
#hero h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 20px;
}
#hero p {
    max-width: 600px;
    margin: 0 auto 30px;
    font-size: 1.1rem;
}
.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
}
.cta-button:hover {
    background-color: var(--primary-color); 
    text-decoration: none;
    color: var(--bg-color);
}
.hero-download-buttons {
    margin-top: 20px;
    display: flex;
    gap: 15px; 
    justify-content: center; 
    flex-wrap: wrap; 
}
.secondary-cta {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color); /* Text color should contrast with hero background if image is light */
    font-weight: 600;
}
/* Ensure secondary CTA text is visible on dark hero background */
#hero .secondary-cta {
    border: 2px solid var(--secondary-color); /* Light border on dark hero */
    color: var(--secondary-color); /* Light text on dark hero */
}
#hero .secondary-cta:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color); /* Dark text on light hover */
}

/* --- About Section --- */
.about-content {
    max-width: 800px;
    margin: 0 auto 30px;
    text-align: center;
}
.mission-vision {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}
.mission, .vision {
    flex: 1;
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.stats {
    text-align: center;
    margin-top: 40px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.stat-item {
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    font-size: 1.1rem;
}
.stat-item span {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-primary);
    margin-bottom: 5px;
}

/* --- Skills Section --- */
.skills-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    text-align: center;
}
.skill-category {
    background-color: var(--secondary-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.skill-category-icon { 
    font-size: 3rem; 
    color: var(--accent-color); 
    margin-bottom: 15px;
    display: block; 
}
.skill-category h3 {
    margin-top: 0;
    margin-bottom: 10px;
}
#skills h3 { /* Sub-headings in Skills section */
    text-align: center;
    margin-top: 40px;
    margin-bottom: 15px;
}
.software-skills-grid, .core-competencies-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.software-skills-grid span, .core-competencies-grid span {
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* --- Experience Section (Timeline) --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::after { /* The central line */
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}
.timeline-item::after { /* The dot on the timeline */
    /* content: '';  */
    position: absolute;
    width: 25px;
    height: 25px;
    background-color: var(--bg-color);
    border: 4px solid var(--accent-color);
    top: 15px; /* Align with text */
    border-radius: 50%;
    z-index: 1;
}
/* Positioning for items on the left */
.timeline-item:nth-child(odd) {
    left: 0;
}
.timeline-item:nth-child(odd)::after {
    right: -14px; 
}
/* Positioning for items on the right */
.timeline-item:nth-child(even) {
    left: 50%;
}
.timeline-item:nth-child(even)::after {
    left: -12px; 
}
/* Arrow pointers */
.timeline-item::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px; /* Align with dot */
    width: 0;
    z-index: 1;
    border: medium solid var(--secondary-color); /* Match content background */
}
.timeline-item:nth-child(odd)::before { /* Arrow for left items */
    right: 30px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--secondary-color);
}
.timeline-item:nth-child(even)::before { /* Arrow for right items */
    left: 30px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--secondary-color) transparent transparent;
}
.timeline-content {
    padding: 20px 30px;
    background-color: var(--secondary-color);
    position: relative;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.timeline-content h3 {
    margin-top: 0;
    color: var(--primary-color);
}
.timeline-content .date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 10px;
}
.timeline-content ul {
    list-style-type: disc; /* Ensure bullets are shown */
    padding-left: 20px; /* Standard padding for bulleted lists */
}
.timeline-content ul li {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

/* --- Portfolio Section --- */
.portfolio-section { 
    padding: 60px 20px;
}
.portfolio-section .section-tag { 
    display: block;
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}
.portfolio-section .section-title { 
    margin-bottom: 30px;
}

.filter-buttons {
    text-align: center;
    margin-bottom: 30px;
}
.filter-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    margin: 5px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    font-family: var(--font-primary);
    font-weight: 500;
}
.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-color);
    text-decoration: none;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, opacity 0.3s ease, height 0.3s ease, margin-bottom 0.3s ease; 
}
.portfolio-item.hide-item { 
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none; 
    height: 0; 
    overflow: hidden; 
    margin-bottom: -20px; 
}
.portfolio-item img {
    width: 100%;
    height: 250px; 
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.portfolio-item:hover img {
    transform: scale(1.05);
}
.portfolio-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--bg-color);
    padding: 10px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: var(--font-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}
.portfolio-item:hover .overlay {
    opacity: 1;
}
.portfolio-item .overlay span {
    font-size: 0.9rem;
}

/* Lightbox (Modal) Styles */
.lightbox {
    display: none; 
    position: fixed; 
    z-index: 1050; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.9); 
    padding-top: 50px; 
}
.lightbox-content {
    position: relative; 
    margin: auto;
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%; 
    max-width: 800px; 
}
.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 80vh; 
    object-fit: contain;
    border-radius: 4px; 
    animation-name: zoom;
    animation-duration: 0.6s;
}
.lightbox-caption {
    margin: 15px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    min-height: 40px;
    line-height: 1.4;
    animation-name: zoom; 
    animation-duration: 0.6s;
    animation-delay: 0.1s; 
}
@keyframes zoom {
    from {transform:scale(0.8); opacity: 0;} 
    to {transform:scale(1); opacity: 1;}
}
.lightbox-close {
    position: absolute;
    top: -30px; 
    right: 0px; 
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 1052;
    background: none;
    border: none;
    cursor: pointer;
}
.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
}
.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: fixed; 
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s ease;
    border-radius: 3px;
    user-select: none;
    z-index: 1051; 
    background-color: rgba(0,0,0,0.3);
    border: none;
}
.lightbox-prev {
    left: 15px;
}
.lightbox-next {
    right: 15px;
}
.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0,0,0,0.6);
    text-decoration: none;
}

/* --- Education Section --- */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.education-item {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.education-item h3 { margin-top: 0;}
.education-item p { margin-bottom: 5px; }

/* --- Contact Section --- */
#contact p { 
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.contact-info {
    text-align: center;
    margin-bottom: 30px;
}
.contact-info p { margin-bottom: 10px; }
.contact-info strong { color: var(--primary-color); }
.contact-form {
    max-width: 600px;
    margin: 30px auto 0;
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.contact-form div {
    margin-bottom: 15px;
}
.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--primary-color);
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-secondary);
}
.contact-form textarea {
    resize: vertical;
}
.contact-form button { /* Uses .cta-button styles */
    display: block;
    width: 100%;
}

/* --- Footer --- */
footer {
    background: url('footer.jpg') no-repeat center center/cover;
    box-shadow: inset 0 0 0 1000px rgba(0,0,0,.6); /* Dark overlay */
    color: var(--bg-color);
    text-align: center;
    padding: 30px 20px;
    position: relative; 
}
footer p {
    margin-bottom: 0; 
    font-size: 0.9rem;
    position: relative; 
    z-index: 1;
}
.social-icons {
    margin-bottom: 15px; 
}
.social-icons a {
    color: var(--bg-color);
    font-size: 1.5rem; 
    margin: 0 10px; 
    transition: color 0.3s ease;
    text-decoration: none;
    position: relative;
    z-index: 1;
}
.social-icons a:hover {
    color: var(--accent-color); 
    text-decoration: none;
}

/* --- Responsive Design --- */
@media screen and (max-width: 768px) {
    :root {
        --nav-height: 60px; 
    }

    h1 { font-size: 2.0rem; } 
    #hero h1 { font-size: 2.2rem; } 
    #hero h2 { font-size: 1.5rem; margin-bottom: 15px;}
    #hero p { font-size: 1.0rem; margin-bottom: 25px; }

    h2 { font-size: 1.7rem; }
    h3 { font-size: 1.4rem; }

    .container {
        padding: 40px 15px; 
    }

    /* Navigation */
    nav {
        height: var(--nav-height); 
    }
    .nav-links {
        position: fixed;
        right: 0;
        height: 100vh;
        top: 0;
        background-color: var(--secondary-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 75%; 
        max-width: 280px; 
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out; 
        box-shadow: -2px 0 5px rgba(0,0,0,0.2);
        padding-top: var(--nav-height); 
        z-index: 999; 
    }
    .nav-links li {
        opacity: 0; 
        margin: 12px 0; 
    }
    .nav-links li a {
        font-size: 1.0rem; 
    }
    .nav-active { 
        transform: translateX(0%);
    }
    .burger { 
        display: block; 
    }
    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .toggle .line2 {
        opacity: 0;
    }
    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    /* Hero Section Download Buttons */
    .hero-download-buttons {
        flex-direction: column; 
        align-items: center;
    }
    .hero-download-buttons .cta-button {
        width: 90%; 
        max-width: 280px; 
        text-align: center;
        margin-bottom: 10px;
        font-size: 0.9rem; 
        padding: 10px 20px; 
    }
    .hero-download-buttons .cta-button:last-child {
        margin-bottom: 0;
    }

    /* About Section */
    .mission-vision {
        flex-direction: column;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    }
    .stat-item {
        padding: 15px;
        font-size: 1.0rem;
    }
    .stat-item span {
        font-size: 2.0rem;
    }


    /* Skills Section */
    .skill-category-icon {
        font-size: 2.2rem; 
    }
    .software-skills-grid span, .core-competencies-grid span {
        padding: 6px 12px; 
        font-size: 0.85rem;
    }

    /* Experience Timeline */
    .timeline::after { 
        left: 20px; 
        width: 4px; 
        margin-left: -2px; 
    }
    .timeline-item { 
        width: 100%;
        padding-left: 50px; 
        padding-right: 15px; 
        margin-bottom: 20px; 
    }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0; 
    }
    .timeline-item::after { /* The dot */
        width: 20px; 
        height: 20px; 
        top: 18px; 
        left: 8px; /* (20px_line_pos - (20px_dot_width/2)) - 4px_dot_border_width = 10px - 4px = 6px + 2px(half_line_width) = 8px */
    }
    .timeline-item::before { /* The arrow */
        /* Position arrow to point left from content towards the line */
        left: calc(50px - 2px - 8px); /* content padding-left (50px) - gap (2px) - arrow_width (8px) */
        top: 18px; 
        border-width: 8px 0 8px 8px; /* Make arrow point left */
        border-color: transparent transparent transparent var(--secondary-color); /* Color for left-pointing arrow */
    }
    .timeline-content {
        padding: 15px 20px; 
    }
    .timeline-content ul {
        padding-left: 15px; 
    }
    .timeline-content ul li {
        font-size: 0.9rem;
    }


    /* Portfolio Section */
    .filter-buttons {
        margin-bottom: 20px;
    }
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
        margin: 3px;
    }
    .portfolio-grid {
        grid-template-columns: 1fr; /* Single column for very small screens */
        gap: 15px;
    }
    @media screen and (min-width: 480px) and (max-width: 768px) {
        .portfolio-grid { /* Two columns for slightly larger mobile screens */
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        }
    }
    .portfolio-item img {
        height: 220px; 
    }
    .portfolio-item.hide-item { 
        /* AOS is disabled on mobile by default in JS, so display: none is a simpler fallback */
        display: none; 
    }


    /* Lightbox (Modal) */
    .lightbox {
        padding-top: 20px; 
    }
    .lightbox-content img {
        max-height: 70vh; 
    }
    .lightbox-close {
        position: fixed; 
        top: 15px;
        right: 20px;
        font-size: 30px;
        color: #fff; 
        background-color: rgba(0,0,0,0.3); 
        border-radius: 50%;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1; 
        padding: 0;
    }
    .lightbox-prev, .lightbox-next {
        font-size: 20px;
        padding: 10px;
        top: 50%;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-caption {
        font-size: 0.85rem;
        width: 90%;
        padding: 8px 0;
        min-height: 30px;
    }
    
    /* Education Section */
    .education-grid {
        grid-template-columns: 1fr; /* Stack education items */
    }
    .education-item {
        padding: 15px;
    }

    /* Contact Form */
    .contact-form {
        padding: 20px;
    }
    .contact-form label {
        font-size: 0.9rem;
    }
    .contact-form input,
    .contact-form textarea {
        padding: 8px;
        font-size: 0.9rem;
    }
    .contact-form .cta-button {
        padding: 10px;
        font-size: 0.9rem;
    }

    /* Back to Top Button */
    #backToTopBtn {
        width: 40px;
        height: 40px;
        font-size: 20px; 
        bottom: 15px; 
        right: 15px; 
    }

    /* Footer */
    footer {
        padding: 20px 15px;
    }
    .social-icons a {
        font-size: 1.3rem;
        margin: 0 8px;
    }
    footer p {
        font-size: 0.85rem;
    }
}

/* Optional: For very small screens, if needed */
@media screen and (max-width: 360px) {
    #hero h1 { font-size: 1.9rem; }
    #hero h2 { font-size: 1.3rem; }
    #hero p { font-size: 0.9rem; }

    .portfolio-grid { /* Ensure single column for very small screens */
        grid-template-columns: 1fr;
    }
     .stat-item {
        font-size: 0.9rem;
    }
    .stat-item span {
        font-size: 1.8rem;
    }
}


@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0px);
    }
}