/* ------------------------------------------------ */
/* 1. GLOBAL VARIABLES (THE NEW ENGINE)             */
/* ------------------------------------------------ */
:root {
    /* Brand Colors - Deep Indigo/Purple */
    --primary: #3b3086;      
    --primary-hover: #2a2266;
    --primary-soft: rgba(59, 48, 134, 0.1);
    
    /* Light Mode Palette */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --header-bg: #3b3086;    
    --header-text: #ffffff;
    
    /* Typography & Borders */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* UI Specifics */
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --input-bg: #ffffff;
}

/* ------------------------------------------------ */
/* 2. DARK MODE OVERRIDES (PREMIUM MIDNIGHT)        */
/* ------------------------------------------------ */
html.dark-mode {
    --bg-main: #020617;      /* Rich Deep Navy Black */
    --bg-card: #0f172a;      /* Dark Slate */
    --header-bg: #0f1025;    
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --input-bg: #020617;
}

html.dark-mode body {
    background-color: var(--bg-main);
    color: var(--text-main);
}

html.dark-mode .card,
html.dark-mode .admin-section,
html.dark-mode .dashboard-col {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

html.dark-mode input:not([type]),
html.dark-mode input[type="text"],
html.dark-mode input[type="email"],
html.dark-mode input[type="password"],
html.dark-mode input[type="url"],
html.dark-mode input[type="date"],
html.dark-mode input[type="number"],
html.dark-mode textarea,
html.dark-mode select {
    background-color: #0b1222 !important;
    border-color: #26334f !important;
    color: #e5e7eb !important;
}

html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: #718096 !important;
}

html.dark-mode .btn.secondary {
    background: #111a2e !important;
    border-color: #26334f !important;
    color: #e5e7eb !important;
}

html.dark-mode .user-dropdown,
html.dark-mode .notif-dropdown {
    background: #111a2e !important;
    border-color: #26334f !important;
    color: #e5e7eb !important;
}

html.dark-mode .dropdown-header,
html.dark-mode .notif-header,
html.dark-mode .notif-footer {
    background: #0b1222 !important;
    border-color: #26334f !important;
}

html.dark-mode .dropdown-item,
html.dark-mode .notif-item {
    color: #e5e7eb !important;
    border-color: #243049 !important;
}

html.dark-mode .dropdown-item:hover,
html.dark-mode .notif-item:hover {
    background: rgba(167, 155, 255, 0.12) !important;
}

/* ------------------------------------------------ */
/* 3. BASE & TYPOGRAPHY                             */
/* ------------------------------------------------ */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 { 
    color: var(--text-main); 
    font-weight: 700; 
    margin-top: 0; 
}

/* ------------------------------------------------ */
/* 4. HEADER & NAVIGATION                           */
/* ------------------------------------------------ */
header {
    background: var(--header-bg) !important;
    padding: 16px 20px;
    box-shadow: var(--shadow);
    color: var(--header-text);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    text-decoration: none; 
}

/* LOGO FIX: Ensures natural color rendering (No filters) */
.logo-img {
    height: 40px; 
    width: auto; 
    display: block; 
    object-fit: contain;
}

.brand-text {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav a:hover, .nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.logout-btn {
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ------------------------------------------------ */
/* 5. MAIN LAYOUT & CARDS                           */
/* ------------------------------------------------ */
main {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.container { width: 100%; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* ------------------------------------------------ */
/* 6. FORMS & UI ELEMENTS                           */
/* ------------------------------------------------ */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* CRITICAL FIX: Added input:not([type]) to capture Title/Subtitle fields 
   that might not have type="text" explicitly set.
*/
input:not([type]), 
input[type="text"], 
input[type="email"], 
input[type="password"],
input[type="url"],
textarea, 
select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, background-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover { 
    background-color: var(--primary-hover); 
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: var(--bg-main);
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
}

.btn.secondary:hover { 
    background-color: var(--border-color); 
}

/* ------------------------------------------------ */
/* 7. STATUS BADGES & GUIDANCE                      */
/* ------------------------------------------------ */
.status-badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending { background-color: rgba(245, 158, 11, 0.15); color: #d97706; }
.status-success { background-color: rgba(16, 185, 129, 0.15); color: #059669; }
.status-info { background-color: rgba(59, 130, 246, 0.15); color: #2563eb; }

.guidance-box {
    background-color: var(--bg-main);
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
    color: var(--text-main);
}

.guidance-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    display: block;
}

/* ------------------------------------------------ */
/* 8. PROGRESS BUBBLES SYSTEM                       */
/* ------------------------------------------------ */
.progress-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 2.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0; height: 2px;
    background: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}

.bubble {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    z-index: 2;
    transition: all 0.3s;
    color: var(--text-muted);
}

.bubble.active { border-color: var(--primary); color: var(--primary); }
.bubble.current {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 0 0 5px var(--primary-soft);
}

/* ------------------------------------------------ */
/* 9. FILE DROPZONE & PROGRESS                      */
/* ------------------------------------------------ */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    background: var(--bg-main);
    transition: border-color 0.2s;
    cursor: pointer;
    position: relative;
    color: var(--text-main);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.drop-zone input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.progress-wrapper { display: none; margin-top: 1.5rem; }

.progress-bg {
    background: var(--border-color);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: var(--primary);
    height: 100%;
    width: 0%;
    transition: width 0.1s;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
    font-weight: 600;
}

/* ------------------------------------------------ */
/* 10. APPEARANCE TOGGLE (Profile)                  */
/* ------------------------------------------------ */
.theme-selector {
    display: flex;
    gap: 12px;
    background: var(--bg-main);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.theme-selector button {
    flex: 1;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    background: transparent;
    color: var(--text-muted);
    transition: 0.2s;
}

/* Active State Logic for Buttons */
html.dark-mode #dark-btn {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow);
}
html:not(.dark-mode) #light-btn {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow);
}

/* ------------------------------------------------ */
/* 11. CONTRIBUTORS & KEYWORDS GRID FIX             */
/* ------------------------------------------------ */

/* HEADER ROW: Match the columns of the content row exactly */
.author-header-row {
    display: grid;
    /* Changed 60px to 110px to fit "Corresponding" text */
    grid-template-columns: 1fr 1fr 1fr 110px 40px; 
    gap: 10px;
    margin-bottom: 8px;
    padding: 0 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.author-header-row > div:nth-child(4) {
    text-align: center;
}

/* CONTENT ROW */
.author-row {
    display: grid;
    /* Match header columns: Inputs get equal space (1fr), Actions get fixed space */
    grid-template-columns: 1fr 1fr 1fr 110px 40px;
    gap: 10px;
    align-items: center; /* Vertically center everything */
    background: var(--bg-card);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    transition: all 0.2s;
}

.author-row:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* INPUTS inside the row */
.author-row input {
    width: 100% !important;
    margin: 0 !important;
    font-size: 0.9rem;
    padding: 8px 10px;
}

.a11y-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
    .a11y-icon svg { width: 26px; height: 26px; }

/* CORRESPONDING RADIO SELECTOR */
.main-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.main-selector label {
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    margin: 0;
}

.main-selector input[type="radio"] {
    width: 18px !important; 
    height: 18px !important; 
    margin: 0 0 4px 0 !important; /* Space between radio and text */
    cursor: pointer;
    accent-color: var(--primary);
}

/* REMOVE BUTTON */
.remove-author-btn {
    width: 32px; 
    height: 32px;
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    transition: all 0.2s;
    padding-bottom: 4px; /* Visual center fix for the times symbol */
}

.remove-author-btn:hover { 
    background: #ef4444; 
    color: white; 
    border-color: #ef4444;
}

/* MOBILE OVERRIDES */
@media (max-width: 900px) {
    .author-header-row { display: none !important; }
    
    .author-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 40px 15px 15px 15px; /* Top padding for the absolute delete button */
        position: relative;
        background: var(--bg-main);
    }

    .author-row .main-selector {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        background: white;
        padding: 10px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
    }

    .main-selector label {
        flex-direction: row;
        gap: 10px;
        font-size: 0.9rem;
    }

    .main-selector input[type="radio"] {
        margin: 0 !important;
    }

    .remove-author-btn {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}

/* ------------------------------------------------ */
/* 12. FOOTER                                       */
/* ------------------------------------------------ */
footer {
    background: #24252a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
    color: #cbd5e1;
}

.site-footer .footer-panel {
    max-width: 1120px;
    margin: 0 auto;
    background: #25262b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    padding: 2.4rem 3rem;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.25fr;
    gap: 2.5rem;
    text-align: left;
}

.site-footer .footer-kicker {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 0.9rem;
}

.site-footer .footer-brand strong {
    color: #fff;
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.7rem;
}

.site-footer .footer-brand p,
.site-footer .footer-legal p,
.site-footer .footer-support span {
    color: #cbd5e1;
    display: block;
    font-size: 0.86rem;
    line-height: 1.55;
    margin: 0 0 0.45rem;
}

.site-footer .footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
}

.site-footer .footer-links a,
.site-footer .footer-support a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 650;
}

.site-footer .footer-links a:hover,
.site-footer .footer-support a:hover {
    color: #d8d2ff;
    text-decoration: underline;
}

.site-footer .footer-support {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
}

.site-footer .footer-legal {
    justify-self: end;
    max-width: 220px;
}

@media (max-width: 900px) {
    .site-footer .footer-panel {
        grid-template-columns: 1fr 1fr;
        padding: 2rem;
    }

    .site-footer .footer-legal {
        justify-self: start;
        max-width: none;
    }
}

@media (max-width: 620px) {
    .site-footer .footer-panel {
        grid-template-columns: 1fr;
        gap: 1.8rem;
        padding: 1.6rem;
    }
}

/* ------------------------------------------------ */
/* 13. MOBILE RESPONSIVENESS                        */
/* ------------------------------------------------ */
@media (max-width: 768px) {
    .logo-img { max-height: 35px; width: auto; }
    .author-header-row { display: none !important; }
    
    .author-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        background: var(--bg-main);
        padding: 15px;
    }

    .author-row input { width: 100%; margin: 0; }
    
    .author-row .main-selector {
        text-align: left;
        display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 5px 0;
    }
    .author-row .main-selector::after {
        content: "Corresponding Author";
        font-size: 0.9rem; color: var(--text-muted); font-weight: 500;
    }
    
    .remove-author-btn {
        position: absolute; top: 10px; right: 10px;
    }
    .container { padding: 15px; width: 95%; }
    .card { padding: 1.5rem 1rem; }
}

/* --- MOBILE MENU STYLES --- */

/* 1. The Hamburger Button (Hidden on Desktop) */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100;
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 2. Mobile Responsive Overrides */
@media (max-width: 768px) {
    /* Keep header items aligned */
    .header-inner {
        position: relative;
        flex-wrap: wrap; 
    }
    
    /* Show the toggle button */
    .mobile-toggle {
        display: flex;
    }

    /* Hide the Nav by default */
    .nav {
        display: none; 
        width: 100%;
        flex-direction: column;
        background-color: var(--header-bg); /* Match header color */
        position: absolute;
        top: 100%; /* Push exactly below header */
        left: 0;
        right: 0;
        padding: 1rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
        border-radius: 0 0 12px 12px;
        z-index: 99;
        margin-top: 10px; /* Small gap for visual separation */
    }

    /* The 'Active' class makes it appear */
    .nav.active {
        display: flex;
        animation: slideDown 0.2s ease-out;
    }

    /* Style the links for mobile tapping */
    .nav a {
        width: 100%;
        text-align: center;
        padding: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 1rem;
    }

    .nav a:last-child {
        border-bottom: none;
    }
    
    /* Adjust Logo size slightly for mobile */
    .logo-img { max-height: 32px; }
    .brand-text { font-size: 1.1rem; }
    
    /* Adjust Author/Contributor Rows for Mobile (From previous request) */
    .author-header-row { display: none !important; }
    .author-row {
        display: flex; flex-direction: column; gap: 10px; padding: 15px;
    }
    .author-row input { width: 100%; margin: 0; }
    .author-row .main-selector {
        flex-direction: row; gap: 10px; width: 100%; justify-content: flex-start;
    }
    .author-row .main-selector::after {
        content: "Corresponding Author"; color: var(--text-muted); font-size: 0.9rem;
    }
    .remove-author-btn { position: absolute; top: 10px; right: 10px; }
}

/* Animation for the menu */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- MODERN HEADER & PROFILE DROPDOWN --- */

/* 1. Desktop Nav Container */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}
.nav-link:hover { color: white; }

/* 2. User Avatar Button */
.user-menu-container {
    position: relative; /* Anchor for the dropdown */
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 12px 5px 5px;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.user-btn:hover, .user-btn.active {
    background: rgba(255, 255, 255, 0.2);
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.username {
    font-size: 0.9rem;
    font-weight: 500;
}

.chevron {
    opacity: 0.7;
    transition: transform 0.2s;
}

.user-btn.active .chevron { transform: rotate(180deg); }

/* 3. The Dropdown Menu */
.user-dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    top: 120%; /* Just below the button */
    right: 0;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 1000;
    animation: fadeInDrop 0.2s ease-out;
}

.user-dropdown.show { display: block; }

.dropdown-header {
    padding: 15px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
}
.dropdown-header strong { display: block; color: var(--text-main); }
.dropdown-header small { color: var(--text-muted); font-size: 0.8rem; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.1s;
}

.dropdown-item:hover { background-color: var(--bg-main); color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 0; }
.logout-item { color: #ef4444; }
.logout-item:hover { background: #fef2f2; color: #dc2626; }

@keyframes fadeInDrop {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- MOBILE ADJUSTMENTS --- */
/* Hamburger styles (Keep previous ones, ensure right alignment) */
.mobile-toggle {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    /* Hide the fancy desktop user menu on mobile */
    .desktop-nav {
        display: none;
    }

    /* Show hamburger */
    .mobile-toggle {
        display: block;
        margin-left: auto; /* Force push to right */
    }

    /* Mobile Nav Drawer Styles (From previous step) */
    .mobile-nav {
        display: none;
        /* ... previous mobile styles ... */
    }
    .mobile-nav.active { display: flex; }
}

/* --- CRITICAL FIX: Hide Mobile Menu on Desktop --- */

/* 1. By default (Desktop), hide the .mobile-nav container entirely */
.mobile-nav {
    /* REMOVED: display: none !important; - This was breaking the mobile menu */
}

/* 2. On Mobile Screens, show .mobile-nav (but hidden visually until toggled) */
@media (max-width: 768px) {
    .mobile-nav {
        /* Mobile nav styles are now in header.php */
    }
    
    /* Hide the Desktop Profile/Dashboard section on mobile */
    .desktop-nav {
        display: none !important;
    }
}

/* Desktop: Ensure mobile nav is hidden */
@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
}

/* --- WIKI TIMELINE STYLES --- */
.timeline {
    position: relative;
    padding-left: 30px;
}

/* The vertical line */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15px; /* Center of the marker width */
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

/* The Number Circle */
.timeline-marker {
    position: absolute;
    top: 0;
    left: -30px;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 1;
    border: 4px solid var(--bg-main); /* Creates a "gap" effect */
}

/* Connect the card to the timeline visually */
.timeline-content {
    margin-left: 15px;
    position: relative;
}

/* Arrow pointing to the number */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: var(--bg-card);
    transform: rotate(45deg);
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Dark Mode Adjustments */
html.dark-mode .timeline-marker {
    border-color: var(--bg-main); /* Ensure gap color matches dark bg */
}

/* --- NOTIFICATION SYSTEM STYLES (FORCED) --- */

/* Container */
.notification-container {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    margin-right: 15px !important;
}

/* The Bell Button - Resetting default browser styles */
.notif-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 50% !important;
    color: rgba(255, 255, 255, 0.85) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s ease !important;
    width: 40px !important;
    height: 40px !important;
}

.notif-btn:hover, .notif-btn.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* Ensure SVG is sized correctly */
.notif-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* The Red Badge */
.notif-badge {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    background-color: #ef4444 !important;
    color: white !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    min-width: 16px !important;
    height: 16px !important;
    border-radius: 99px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid var(--header-bg, #3b3086) !important;
    pointer-events: none !important;
}

/* The Dropdown Menu */
.notif-dropdown {
    display: none !important; /* Forces the text to hide */
    position: absolute !important;
    top: 100% !important;
    right: -10px !important;
    margin-top: 12px !important;
    width: 300px !important;
    background: var(--bg-card, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2) !important;
    z-index: 2000 !important;
    text-align: left !important;
    overflow: visible !important;
}

/* The Active State (toggled by JS) */
.notif-dropdown.show {
    display: block !important;
    animation: fadeIn 0.2s ease-out;
}

/* Dropdown Arrow */
.notif-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: var(--bg-card, #ffffff);
    border-left: 1px solid var(--border-color, #e2e8f0);
    border-top: 1px solid var(--border-color, #e2e8f0);
    transform: rotate(45deg);
}

/* Header & List Items */
.notif-header {
    padding: 12px 16px !important;
    background: var(--bg-main, #f8fafc) !important;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
    font-weight: 700 !important;
    color: var(--text-main, #1e293b) !important;
    border-radius: 12px 12px 0 0 !important;
    font-size: 0.9rem !important;
}

.notif-item {
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: background 0.1s !important;
}

.notif-item:hover {
    background: var(--bg-main, #f8fafc) !important;
}

.notif-empty {
    padding: 20px;
    text-align: center;
    color: #64748b;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
