/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */

/* --- Global Smooth Scroll --- */
html {
    scroll-behavior: smooth;
}

:root {
    --primary: #2563eb;       
    --text-main: #334155;     
    --text-heading: #0f172a;  
    --bg-light: #f8fafc;      
    --border: #e2e8f0;        
    --white: #ffffff;
    --published-green: #22c55e;
    --preprint-yellow: #facc15;
    --thesis-gold: #d4af37;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-light);
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- Typography --- */
h1, h2, h3 { color: var(--text-heading); font-family: 'Georgia', serif; font-weight: 700; }
a { color: var(--primary); text-decoration: none; transition: opacity 0.2s; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   2. NAVIGATION & STICKY HEADERS
   ========================================================================== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.nav-links { display: flex; gap: 60px; align-items: center; }
.nav-links a { font-size: 1.1rem; font-weight: 500; color: var(--text-main); white-space: nowrap; }
nav a.active { color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--primary); }

.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--primary); cursor: pointer; }

@media (max-width: 600px) {
    nav { flex-direction: column; align-items: flex-start; }
    .menu-toggle { display: block; }
    .nav-links { display: none; flex-direction: column; width: 100%; gap: 20px; padding-top: 15px; }
    .nav-links.show { display: flex; }
    nav a.active { border-bottom: none; border-left: 3px solid var(--primary); padding-left: 10px; }
}

/* ==========================================================================
   3. PAGE CONTROLS (TOC & SEARCH)
   ========================================================================== */

.page-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 3rem;
    padding: 10px 0;
    position: sticky;
    top: 80px; 
    z-index: 1100;
    background-color: var(--bg-light);
}

/* Fixes Floating Icon */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 350px;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-bar .form-input {
    padding: 10px 15px 10px 40px !important;
    height: 42px;
    margin-bottom: 0;
}

/* Fixes Wonky Dropdown Overlap */
.toc-dropdown { position: relative; }

.toc-btn {
    height: 42px;
    padding: 0 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--white);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
}

.toc-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid var(--border);
    z-index: 1200;
    margin-top: 5px;
}

.toc-content.show { display: block; }

/* CRITICAL: Fixes the links stacking horizontally */
.toc-content a {
    display: block !important; 
    padding: 12px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.toc-content a:last-child { border-bottom: none; }

/* ==========================================================================
   4. CARDS (RESEARCH & PROJECTS)
   ========================================================================== */
/* --- Base Card Styles with Animation Support --- */
.pub-card, .project-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    position: relative;
    
    /* Search Animation Properties */
    transition: opacity 0.4s ease, transform 0.4s ease, margin 0.4s ease, padding 0.4s ease, visibility 0.4s;
    opacity: 1;
    transform: scale(1);
    visibility: visible;
    overflow: hidden; /* Necessary for height collapse during search */
}

/* Add this to Section 4: CARDS */
.pub-card, .project-card {
    scroll-margin-top: 150px; /* Adjust this number to match the height of your nav bar */
}

/* Hover effect inherits the smoother 0.4s transition */
.pub-card:hover, .project-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.05); 
}

/* The state applied by JavaScript when a card doesn't match the search query */
.card-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(-10px);
    pointer-events: none;
    
    /* Collapses the layout space so cards below slide up */
    height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: none;
}
.status-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; margin-bottom: 10px; }
.published { border-left: 4px solid var(--published-green); }
.preprint { border-left: 4px solid var(--preprint-yellow); }
.thesis-card { border-left: 5px solid var(--thesis-gold) !important; background-color: #fffdf5; }

/* Fix for the manual date on specific cards */
.card-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dotted var(--border);
    display: block; /* Ensures it stays on its own line below the buttons */
    width: 100%;
    text-align: right;
}

.update-date {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

/* Dark Mode adjustment */
.dark-mode .update-date {
    color: #64748b;
}

/* --- Consolidated High-Precision Alignment for All Tags --- */
.badge-container {
    display: flex;
    align-items: center;      
    gap: 8px;
    margin-bottom: 12px;
}

/* Unified class for both tags (Preprint/Published) and badges (New/Updated) */
.status-tag, .status-badge, .new-badge {
    display: inline-flex;     
    align-items: center;
    justify-content: center;
    height: 24px;             /* Slightly increased for better optical centering */
    padding: 0 10px;          
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1;           
    margin-bottom: 0;         /* Reset margin so flexbox handles spacing */
}

/* --- Erratum Link Styling --- */
.erratum-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #fffbeb; /* Light amber background */
    color: #92400e;            /* Dark amber text */
    padding: 6px 12px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.erratum-link:hover {
    background-color: #fef3c7;
    border-color: #92400e;
    text-decoration: none;
}

/* Dark Mode adjustment for Erratum */
.dark-mode .erratum-link {
    background-color: #451a03;
    color: #fbbf24;
    border-color: #78350f;
}

/* Mobile Tweak: Ensure the warning stands out on small screens */
@media (max-width: 600px) {
    .erratum-link {
        width: 100%;
        justify-content: center;
    }
}

/* --- Video Action Button --- */
.video-link {
    background-color: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
    transition: all 0.2s ease;
}

.video-link:hover {
    background-color: #f0f7ff; /* Very light blue tint */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* Dark Mode Adjustment */
.dark-mode .video-link {
    background-color: #1e293b;
    color: #60a5fa;
    border-color: #3b82f6;
}

.dark-mode .video-link:hover {
    background-color: #334155;
    color: #93c5fd;
}


/* --- Status Specific Colors --- */

/* Preprint - Yellow/Orange */
.preprint { border-left: 4px solid var(--preprint-yellow); }
.preprint .status-tag { 
    background: #fef9c3 !important; 
    color: #854d0e !important; 
}

/* New Badge - Orange */
.new-badge {
    background-color: #f97316;
    color: white;
}

/* Styling for the dynamically added 'Updated' badge */
.updated-badge {
    background-color: var(--primary); /* Uses your brand blue */
    color: white;
}

/* Ensure the FontAwesome sparkle/pen-nib icons align with text */
.status-badge i, .new-badge i {
    margin-right: 5px;
}

/* Published - Green */
.published { border-left: 4px solid var(--published-green); }
.published .status-tag { 
    background: #dcfce7 !important; 
    color: #166534 !important; 
}

/* Thesis - Gold */
.thesis-card { 
    border-left: 5px solid var(--thesis-gold) !important; 
    background-color: #fffdf5; 
}
.thesis-card .status-tag { 
    background: #fef9c3 !important; 
    color: #854d0e !important; 
    border: 1px solid #fde047;
}


/* --- Teaching Page Specific Tags --- */

/* Ensures tags in teaching sections have a professional blue/slate theme */
#year-2025 .status-tag, 
#year-2024 .status-tag,
#archive .status-tag {
    background-color: #e2e8f0 !important; /* Soft Slate background */
    color: #475569 !important;            /* Dark Slate text */
    border: 1px solid var(--border);
}

/* Optional: Highlight the current/upcoming term in a primary color */
#year-2025 .status-tag {
    background-color: #dbeafe !important; /* Light blue */
    color: var(--primary) !important;     /* Brand blue */
    border-color: #bfdbfe;
}

/* --- Student Work Card Styling --- */
.student-work {
    border-left: 5px solid #6366f1 !important; /* Indigo border */
    background-color: #f5f3ff;                 /* Very light purple tint */
}

.student-tag {
    background-color: #ede9fe !important;      /* Light purple background */
    color: #4338ca !important;                 /* Dark indigo text */
    border: 1px solid #ddd6fe;
}


/* --- Dark Mode Support for Tags --- */
.dark-mode .published .status-tag { background: #064e3b !important; color: #4ade80 !important; }
.dark-mode .preprint .status-tag { background: #78350f !important; color: #fef3c7 !important; }
.dark-mode .thesis-card .status-tag { background: #78350f !important; color: #fef3c7 !important; }
.dark-mode #year-2025 .status-tag {
    background-color: #1e3a8a !important; 
    color: #bfdbfe !important;
}

.dark-mode #year-2024 .status-tag,
.dark-mode #archive .status-tag {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
}

.dark-mode .student-work {
    background-color: #1e1b4b !important;      /* Deep indigo/navy card */
    border-left-color: #818cf8 !important;     /* Brighter indigo border */
}

.dark-mode .student-tag {
    background-color: #312e81 !important;      /* Dark indigo tag */
    color: #e0e7ff !important;                 /* Light lavender text */
    border-color: #4338ca;
}

/* --- Deep links --- */

/* --- Direct Link (Target) Styling --- */
.pub-card:target, .project-card:target {
    border: 2px solid var(--primary); /* Highlight with brand blue */
    background-color: #f8fafc;        /* Subtle background shift */
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
    transform: scale(1.01);           /* Slight pop effect */
}

/* Dark Mode Adjustment */
.dark-mode .pub-card:target, 
.dark-mode .project-card:target {
    background-color: #1e293b;
    border-color: #60a5fa;
}

/* --- Card Anchor Link Styling --- */
.card-anchor {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-left: 12px;
    text-decoration: none;
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    transition: all 0.2s ease;
    vertical-align: middle;
}

.pub-card:hover .card-anchor,
.project-card:hover .card-anchor {
    opacity: 1; /* Revealed on hover */
}

.card-anchor:hover {
    color: var(--primary);
}

/* Tooltip for visual feedback */
.card-anchor::after {
    content: "Copy Link";
    position: absolute;
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    display: none;
    white-space: nowrap;
}

.card-anchor:hover::after {
    display: block;
}


/* Course header */

.course-header {
    margin-bottom: 3.5rem; /* Creates breathing room before the first card */
    padding-bottom: 1rem;
}

/* Optional: Add a subtle divider if the gap feels too empty */
.course-header .card-actions {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}


/* ==========================================================================
   5. UNIFIED ACTION BAR & BUTTONS
   ========================================================================== */
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-main);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none !important;
    height: 38px;
}

.action-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); background: var(--white); }
.action-btn.pdf i { color: #ef4444; }
.action-btn.journal i , .action-btn.abstract i { color: var(--primary); }

/* Abstract Toggle specifically as a button */
.abstract-details { display: inline-block; }
.abstract-details summary { list-style: none; }
.abstract-details summary::-webkit-details-marker { display: none; }
.abstract-details[open] summary { background: var(--primary); color: white; border-color: var(--primary); }
.abstract-details[open] summary i { color: white; transform: rotate(90deg); }
.abstract-content { font-size: 0.9rem; font-style: italic; background: #fcfcfd; padding: 15px; margin-top: 10px; border-left: 3px solid var(--primary); }

/* ==========================================================================
   6. TABLES & TEACHING
   ========================================================================== */
.schedule-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.schedule-table th, .schedule-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
.lecture-archive { margin-top: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-light); overflow: hidden; }
.lecture-archive summary { padding: 12px 15px; font-size: 0.9rem; font-weight: 600; color: var(--primary); cursor: pointer; display: flex; align-items: center; gap: 10px; }

/* Container acts as the 'window' */
.lecture-list-container {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scroll if needed */
    -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling for iOS */
    margin-top: 10px;
}

/* Adds a subtle fade on the right when scrolling is available */
.lecture-list-container {
    background: linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
                linear-gradient(to right, rgba(255, 255, 255, 0), white 70%) 100% 0,
                radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)),
                radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}

/* Dark Mode adjustment for the scroll hint */
.dark-mode .lecture-list-container {
    background: none; /* Simplest to disable the complex gradient in dark mode */
    border: 1px solid var(--border);
}

/* Ensure the table stays readable while scrolling */
.schedule-table {
    width: 100%;
    min-width: 450px; /* Forces scrolling on small screens instead of squishing text */
    border-collapse: collapse;
}

/* Prevent headers from wrapping into multiple awkward lines */
.schedule-table th {
    white-space: nowrap;
    background-color: var(--bg-light);
}

/* ==========================================================================
   7. DARK MODE OVERRIDES
   ========================================================================== */

/* 1. Root Variable Overrides */
.dark-mode {
    --bg-light: #0f172a;      
    --text-main: #cbd5e1;     
    --text-heading: #f8fafc;  
    --white: #1e293b;         
    --border: #334155;
    /* Specific nav background for higher contrast */
    --nav-bg: rgba(15, 23, 42, 0.95); 
}

/* 2. Navigation Specifics */
.dark-mode nav {
    background-color: var(--nav-bg) !important;
    border-bottom-color: var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dark-mode .nav-links a {
    color: var(--text-main) !important;
}

/* Active link contrast boost */
.dark-mode .nav-links a.active {
    color: #60a5fa !important; /* Brighter blue for Dark Mode */
    border-bottom-color: #60a5fa;
}

/* Hamburger toggle visibility */
.dark-mode .menu-toggle {
    color: var(--text-heading) !important;
}

/* 3. Component Overrides */
.dark-mode body {
    background-color: var(--bg-light);
    color: var(--text-main);
}

.dark-mode .action-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
.dark-mode .toc-container, .dark-mode .toc-content { background-color: var(--bg-light); }
.dark-mode .lecture-archive { background: #1e293b; }

/* --- Dark Mode Hamburger Visibility --- */
.dark-mode .menu-toggle {
    color: var(--text-heading); /* Sets it to near-white/light grey in dark mode */
}

.dark-mode .menu-toggle:hover {
    color: var(--primary); /* Optional: changes to blue when tapped/hovered */
}

/* --- Dark Mode Sticky Nav Fix --- */
.dark-mode nav {
    background-color: rgba(15, 23, 42, 0.85) !important; /* Semi-transparent Dark Navy */
    border-bottom-color: var(--border); /* Uses the dark border color */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Ensure the links inside change to light text */
.dark-mode .nav-links a {
    color: var(--text-main); /* Now maps to #cbd5e1 in dark mode */
}

/* --- Dark Mode Thesis Card Fix --- */
.dark-mode .thesis-card {
    background-color: #1e293b !important; /* Matches other card backgrounds */
    border-left-color: var(--thesis-gold) !important;
    border-right: 1px solid var(--border);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.dark-mode .thesis-card .status-tag {
    background-color: #78350f !important; /* Deep amber/gold for dark mode */
    color: #fef3c7 !important;            /* Light cream text */
    border: 1px solid #d4af37;
}

/* --- Dark Mode for New & Updated Badges --- */
.dark-mode .new-badge {
    background-color: #f97316; /* Keep the orange, but ensure text is white */
    color: #ffffff !important;
    border: 1px solid #fb923c;
}

.dark-mode .updated-badge {
    background-color: #3b82f6; /* A slightly brighter blue for dark mode */
    color: #ffffff !important;
    border: 1px solid #60a5fa;
}

/* Ensure icons inside these badges are also bright */
.dark-mode .status-badge i, 
.dark-mode .new-badge i {
    color: #ffffff;
}

/* --- Dark Mode for Abstract Content --- */
.dark-mode .abstract-content {
    background: #1e293b;         /* Matches card background */
    color: #cbd5e1;              /* Light slate text */
    border-left-color: #60a5fa;  /* Brighter blue for the accent border */
}

/* --- Dark Mode Page Controls --- */
.dark-mode .page-controls { background-color: var(--bg-light); }

.dark-mode .toc-btn {
    background-color: var(--white);
    color: #60a5fa; /* Brighter blue for visibility */
    border-color: #3b82f6;
}

.dark-mode .toc-content {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.dark-mode .toc-content a {
    color: #cbd5e1 !important; /* Ensure text isn't black */
    border-bottom-color: #334155;
}

.dark-mode .toc-content a:hover {
    background-color: #334155;
    color: white !important;
}

.dark-mode .search-bar i { color: #94a3b8; }

/* ==========================================================================
   8. MISC (FOOTER, TOGGLES, UTILS)
   ========================================================================== */
.site-footer { text-align: center; margin-top: 4rem; padding: 2rem 0; border-top: 1px solid var(--border); color: #94a3b8; font-size: 0.85rem; }
.theme-toggle { position: fixed; bottom: 30px; right: 30px; width: 45px; height: 45px; border-radius: 50%; background: var(--primary); color: white; border: none; cursor: pointer; z-index: 2000; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: transform 0.2s ease; }
.theme-toggle:hover { transform: scale(1.1); }

/* --- BibTeX Hidden Data Block --- */
.bibtex-text { 
    display: none; /* Keeps the raw text hidden from the page */
    background: #f1f5f9; 
    padding: 15px; 
    font-size: 0.8rem; 
    font-family: 'Courier New', monospace; 
    border-radius: 6px; 
    margin-top: 10px; 
    white-space: pre-wrap; 
    border: 1px solid var(--border);
    color: var(--text-main);
}

/* --- BibTeX Button "Copied" State --- */
.action-btn.copied {
    border-color: var(--published-green) !important;
    color: var(--published-green) !important;
    background-color: #f0fdf4 !important; /* Soft green success background */
}

/* --- Dark Mode for BibTeX --- */
.dark-mode .bibtex-text {
    background-color: #0f172a;
    color: #cbd5e1;
    border-color: var(--border);
}

.dark-mode .action-btn.copied {
    background-color: #064e3b !important;
    color: #4ade80 !important;
    border-color: #4ade80 !important;
}

/* --- Site Notice Alert Card --- */
.site-notice {
    background-color: #fefce8; /* Soft yellow warning background */
    border: 1px solid #fef08a;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #854d0e;            /* Darker gold/brown for contrast */
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-notice i {
    color: #eab308;            /* Bright yellow icon */
    font-size: 1.1rem;
}

/* --- Dark Mode Support for Site Notice --- */
.dark-mode .site-notice {
    background-color: #1e1b4b; /* Deep indigo for Dark Mode alert */
    border-color: #312e81;
    color: #e0e7ff;            /* Bright white/blue text */
}

.dark-mode .site-notice i {
    color: #818cf8;            /* Lighter icon for dark background */
}

/* ==========================================================================
   9. PROFILE HEADER & PHOTO (HOME PAGE)
   ========================================================================== */

.profile-header {
    display: flex;
    flex-direction: row-reverse; /* Keeps photo on the right, text on left */
    align-items: center; 
    gap: 40px; 
    margin-bottom: 3rem;
}

.profile-photo {
    width: 180px;  /* Size of your professional portrait */
    height: 180px; 
    object-fit: cover; 
    border-radius: 50%; /* Circular crop */
    border: 4px solid var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    flex-shrink: 0; 
}

.header-text {
    flex: 1;
}

/* --- Mobile Responsive Tweak --- */
@media (max-width: 600px) {
    .profile-header {
        flex-direction: column; /* Stack photo above text on phones */
        text-align: center;
        gap: 20px;
    }
    .profile-photo {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
}

/* --- Dark Mode adjustment for Photo Border --- */
.dark-mode .profile-photo {
    border-color: var(--border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* ==========================================================================
   10. CONTACT SECTION & PROFILE LINKS
   ========================================================================== */

.contact-section {
    margin-top: 5rem;
    padding: 3rem 0;
    border-top: 2px solid var(--border);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Split view: Info on left, Links on right */
    gap: 40px;
}

.contact-info p {
    margin-bottom: 1.5rem;
}

/* --- Profile Links (Right Column) --- */
.profile-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Uses the same base logic as our action buttons for consistency */
.profile-btn {
    display: inline-block;
    padding: 12px 15px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none !important;
}

.profile-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* --- Mobile Responsive Tweak --- */
@media (max-width: 600px) {
    .contact-container {
        grid-template-columns: 1fr; /* Stacks info and links on phones */
        text-align: center;
    }
}

/* --- Dark Mode Support --- */
.dark-mode .profile-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

.dark-mode .profile-btn:hover {
    background: var(--primary);
    color: white;
}


/* ==========================================================================
   11. EVENT CARDS (CONFERENCES & SEMINARS)
   ========================================================================== */

.event-card {
    display: flex;
    gap: 25px;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.event-card:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

/* --- The Calendar Date Block --- */
.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 80px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.event-date .month {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.1rem;
    text-transform: uppercase;
}

.event-date .year {
    font-size: 0.85rem;
    color: var(--text-main);
}

/* --- Event Content & Role Tags --- */
.event-info {
    flex: 1;
}

.event-info h3 { margin: 5px 0; font-size: 1.25rem; }

.event-meta {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 10px;
}

.role-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
}

/* --- Recurring/Live Seminar Styling --- */
.event-card.recurring {
    border-left: 4px solid var(--primary);
    background-color: #f0f9ff; /* Subtle blue tint for active seminars */
}

.live-tag {
    background: #dcfce7 !important;
    color: #166534 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- Dark Mode Support --- */
/* --- Consolidated Dark Mode Support for Events --- */

/* Base Event Card */
.dark-mode .event-card { 
    background: var(--white); 
    border-color: var(--border);
}

/* Date Block */
.dark-mode .event-date { 
    background: #0f172a; 
    border-color: var(--border);
}

.dark-mode .event-date .year {
    color: var(--text-main);
}

/* Recurring/Seminar Styling */
.dark-mode .event-card.recurring { 
    background-color: #1e293b; 
    border-left-color: var(--primary);
}

/* Role Tags */
.dark-mode .role-tag { 
    background: #334155; 
    color: #cbd5e1; 
}

/* THE FIX: Live Tag */
.dark-mode .live-tag { 
    background-color: #064e3b !important; 
    color: #4ade80 !important; 
    border: 1px solid #059669;
}
/* --- Mobile Responsive Tweak --- */
@media (max-width: 600px) {
    .event-card { flex-direction: column; gap: 15px; }
    .event-date { flex-direction: row; width: 100%; height: auto; padding: 10px; gap: 10px; }
}


/* ==========================================================================
   12. LINKS PAGE GRID & CARDS
   ========================================================================== */

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive columns */
    gap: 20px;
    margin-top: 1.5rem;
}

.link-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
    text-decoration: none !important; /* Prevents underline on the whole card */
}

.link-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.link-content {
    display: flex;
    flex-direction: column;
}

.link-content strong {
    color: var(--text-heading);
    font-size: 1.05rem;
}

.link-content span {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

.link-card i {
    font-size: 0.8rem;
    color: var(--border);
    transition: color 0.2s;
}

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

/* --- Dark Mode Support --- */
.dark-mode .link-content span {
    color: #94a3b8;
}

.dark-mode .link-card:hover {
    background-color: #1e293b;
}

/* ==========================================================================
   13. NEWS TICKER
   ========================================================================== */

.news-ticker {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 2rem;
    overflow: hidden; /* Hide overflow for the animation */
    white-space: nowrap;
}

.ticker-label {
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary);
    margin-right: 20px;
    padding-right: 20px;
    border-right: 2px solid var(--border);
}

.ticker-content {
    display: flex;
    gap: 40px;
    animation: ticker-scroll 25s linear infinite;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-main);
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Scrolls half-way if content is duplicated */
}

/* Pause on hover so colleagues can read the titles */
.news-ticker:hover .ticker-content {
    animation-play-state: paused;
}

/* Dark Mode Support */
.dark-mode .news-ticker {
    background: #1e293b;
}

/* ==========================================================================
   14. FORM TEMPLATE
   ========================================================================== */

/* --- Refined Form Geometry --- */
.contact-form-container {
    max-width: 650px;
    margin: 2rem auto;
    padding: 2.5rem; /* Increased padding for a more spacious, premium feel */
}

.form-group {
    margin-bottom: 1.75rem; /* Consistent vertical rhythm */
    display: flex;
    flex-direction: column;
    gap: 8px; /* Precise gap between label and input */
}

/* Matching your .status-tag and .action-btn feel */
.form-input {
    width: 100%;
    padding: 14px 16px;
    font-family: 'Inter', sans-serif; /* Consistency with body text */
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--white); /* Brighter than the background for contrast */
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02); /* Subtle depth */
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); /* Soft brand-colored glow */
}

/* Matching your h2/h3 'Georgia' headers */
.form-header h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-family: 'Georgia', serif;
    color: var(--text-heading);
}

.form-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Dark Mode Alignment */
.dark-mode .form-input {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

/* --- Legibility Fix for Long Questions --- */
.form-question {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-heading);
    margin-bottom: 12px;
}

.radio-group {
    display: flex;
    gap: 30px;
    margin-top: 5px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-main);
    cursor: pointer;
}

/* Prevents radio buttons from inheriting the 100% width of .form-input */
input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary); /* Uses your brand blue for the 'dot' */
}

/* Dark Mode Alignment */
.dark-mode .form-question { color: var(--text-heading); }
.dark-mode .radio-label { color: var(--text-main); }

/* --- Tooltip Styling --- */
.tooltip-icon {
    color: #94a3b8;
    cursor: help;
    margin-left: 6px;
    font-size: 0.85rem;
    position: relative;
    display: inline-block;
}

.tooltip-icon:hover {
    color: var(--primary);
}

/* Tooltip text (using the 'title' attribute) */
.tooltip-icon[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 125%; /* Position above the icon */
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: normal;
    width: 200px; /* Limits width so it doesn't stretch off screen */
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Small arrow for the tooltip */
.tooltip-icon[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* Dark Mode adjustment */
.dark-mode .tooltip-icon[title]:hover::after {
    background: #334155;
    border: 1px solid #475569;
}

/* --- Conference Link Styling --- */
.conference-link {
    background: var(--white);
    color: var(--text-main);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s ease;
}

.conference-link:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Dark Mode Alignment */
.dark-mode .conference-link {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

/* --- Dark Mode Date Picker Fix --- */
.dark-mode input[type="date"] {
    color-scheme: dark; /* Standard way to tell the browser to use dark UI elements */
    color: #cbd5e1;     /* Ensures the text is light grey */
}

/* Specifically targeting the calendar icon for Chrome/Safari/Edge */
.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8) brightness(1.2); /* Flips the black icon to a light grey */
    cursor: pointer;
}

/* Ensuring the input background matches your form theme */
.dark-mode .form-input[type="date"] {
    background-color: #0f172a;
    border-color: #334155;
}

/* --- Tighten Top Spacing --- */
.contact-form-container .pub-card {
    padding-top: 1rem; /* Reduced from 1.5rem to pull content up */
}

.form-header {
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    text-align: center; /* Centers the title for a formal look */
}

.form-header h2 {
    margin-top: 0;
    font-size: 2rem;
}

/* Ensure the badge container doesn't create phantom height */
.contact-form-container .badge-container {
    margin-bottom: 0.5rem;
}

/* Align labels to the left for better legibility */
.form-group label.status-tag {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #94a3b8; /* Slate grey for a high-end feel */
}


