/* 1. CONFIGURATION & VARIABLES */
:root {
    --navy-blue: #1a2b4b;
    --light-grey: #f4f4f4;
    --text-dark: #333;
    --text-grey: #777;
    --light-blue: #dde8f0;
    --color-accent: #FBE134; /* Added yellow accent variable */
}

/* 2. BASE LAYOUT (Single Screen Desktop) */
body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: white;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* No page scroll on desktop */
}

a {
    text-decoration: none;
}

/* 3. HEADER & NAVIGATION */
.top-nav {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    padding: 15px 10%;
    align-items: center;
    background: var(--light-grey);
}

.nav-logo {
    font-size: 1.5rem;
    color: var(--navy-blue) !important;
    font-weight: 300;
    text-decoration: none !important; /* Fix: No underline */
}

.nav-links a {
    margin-left: 20px;
    font-size: 0.8rem;
    color: var(--text-dark);
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--navy-blue);
}

.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    font-size: 1.5rem;
    color: var(--navy-blue);
    cursor: pointer;
}

/* 4. HERO SECTION */
.hero-section {
    flex-grow: 1;
    background-color: var(--navy-blue);
    background-image: linear-gradient(rgba(26, 43, 75, 0.8), rgba(26, 43, 75, 0.8)), url('/static/assets/building-bg.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

/* 5. THE CV CARD */
.cv-card {
    background: white;
    display: flex;
    width: 95%;
    max-width: 950px;
    height: auto;
    max-height: 90vh; /* Keeps card within viewport */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.4s ease;
}

/* Image Side */
.card-image {
    flex: 1;
    min-height: 450px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.cv-card:hover .card-image img {
    transform: scale(1.05);
}

/* Text Content Side */
.card-content {
    padding: 40px 50px;
    flex: 1.2;
    display: flex;
    flex-direction: column;
    background-color: white;
    overflow-y: auto; /* Fix: Bio stays inside, card content scrolls if too long */
}

.name-title { font-size: 1.8rem; margin: 0; font-weight: 400; color: var(--text-dark); }
.job-headline { font-size: 0.9rem; color: var(--navy-blue); font-weight: bold; margin-bottom: 20px; }

.card-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-grey);
    margin-bottom: 20px;
}
.card-bio strong { color: var(--navy-blue); }

/* Skills */
.skills-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.skill-tag {
    background: var(--light-grey);
    color: var(--navy-blue);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    border: 1px solid rgba(26, 43, 75, 0.1);
}

.card-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin-bottom: 20px;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-group label { 
    display: block; 
    font-weight: bold; 
    font-size: 0.8rem; 
    color: var(--navy-blue);
}

.info-group label i { margin-right: 5px; }
.info-group p { margin: 2px 0; font-size: 0.85rem; color: var(--text-grey); }

/* 6. FOOTER */
.main-footer {
    flex-shrink: 0;
    background: var(--light-grey);
    color: var(--navy-blue);
    padding: 15px 0;
    width: 100%;
}

.footer-container {
    max-width: 950px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-section { flex: 1; font-size: 0.8rem; opacity: 0.8; }
.footer-meta { text-align: right; }

.social-links { display: flex; justify-content: center; gap: 20px; }
.social-links a {
    color: var(--navy-blue);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}
.social-links a:hover {
    color: var(--color-accent);
    transform: translateY(-3px);
}

/* 7. WIDGETS & MODALS */
.chat-widget {
    position: fixed;
    bottom: 0;
    right: 20px;
    background: #4a5a77;
    color: white;
    padding: 10px 20px;
    border-radius: 5px 5px 0 0;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 999;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 43, 75, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.modal-content form { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.modal-content input, .modal-content textarea { padding: 12px; border: 1px solid #ddd; border-radius: 6px; }
.send-btn { background: var(--navy-blue); color: white; padding: 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }

/* 8. CONSOLIDATED MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
        display: block;
    }

    /* Mobile Nav */
    .mobile-menu-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px; left: 0; width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        z-index: 1001;
    }
    .nav-links.active { display: flex; }
    .nav-links a { margin: 10px 0; text-align: center; width: 100%; margin-left: 0; }

    /* Mobile Hero & Card */
    .hero-section { height: auto; padding: 30px 10px; }
    .cv-card {
        flex-direction: column;
        max-height: none;
        width: 100%;
    }
    .card-image { min-height: 300px; width: 100%; }
    .card-content { padding: 30px 20px; overflow-y: visible; }
    .contact-grid { grid-template-columns: 1fr; }

    /* Mobile Footer */
    .footer-container { flex-direction: column; gap: 15px; text-align: center; }
    .footer-meta { text-align: center; }
}

/* --- SUB-PAGE SCROLLING FIX --- */
/* This ensures sub-pages can scroll even if the home page is fixed */
.content-page {
    flex-grow: 1;
    overflow-y: auto; /* Allows scrolling inside the main area */
    background: white;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.2rem;
    color: var(--navy-blue);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-subtitle {
    color: var(--text-grey);
    margin-top: 10px;
}

/* --- TIMELINE DESIGN --- */
.timeline-container {
    max-width: 800px;
    width: 100%;
    position: relative;
    border-left: 2px solid #eee; /* The vertical line */
    margin-left: 20px;
    padding-left: 40px;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

/* The blue dot on the line */
.timeline-dot {
    position: absolute;
    left: -49px; /* Aligns exactly with the border-left */
    top: 5px;
    width: 16px;
    height: 16px;
    background: var(--navy-blue);
    border-radius: 50%;
    border: 4px solid white;
}

.date-tag {
    display: inline-block;
    background: var(--light-blue);
    color: var(--navy-blue);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.timeline-content h3 {
    margin: 5px 0;
    font-size: 1.3rem;
    color: var(--text-dark);
}

.institution {
    font-weight: bold;
    color: var(--navy-blue);
    margin-bottom: 10px;
}

.detail-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-grey);
    font-size: 0.9rem;
    line-height: 1.6;
}

.detail-list li {
    margin-bottom: 5px;
}

/* --- MOBILE TIMELINE --- */
@media (max-width: 768px) {
    .timeline-container {
        margin-left: 10px;
        padding-left: 25px;
    }
    .timeline-dot {
        left: -34px;
    }
    .section-title {
        font-size: 1.8rem;
    }
}

/* Styling for nested projects in Education/Experience */
.project-sub-list {
    margin-top: 10px;
    padding-left: 20px;
    list-style-type: none; /* We use custom styling instead of standard bullets */
}

.project-sub-list li {
    position: relative;
    margin-bottom: 15px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-grey);
    padding-left: 15px;
    border-left: 2px solid var(--light-blue); /* Subtle accent line for each project */
}

.project-sub-list li strong {
    color: var(--navy-blue);
    display: inline-block;
    margin-bottom: 2px;
}

.project-sub-list li em {
    color: var(--text-dark);
    font-style: normal;
    font-weight: 500;
}