/* ===== DARK MODE OVERRIDES ===== */
/* Applied when html[data-theme="dark"] is set */

/* ─── Theme Toggle Button ──────────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #555;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: #f0f4ff;
    color: #2b2d42;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

html[data-theme="dark"] .theme-toggle {
    color: #a0a0b4;
}

html[data-theme="dark"] .theme-toggle:hover {
    background: #2a2a3c;
    color: #f4a261;
}


/* ─── Base & Body ──────────────────────────────────────────── */
html[data-theme="dark"] body {
    background-color: #121218;
    color: #d8d8e8;
}


/* ─── Navbar ───────────────────────────────────────────────── */
html[data-theme="dark"] .navbar {
    background: rgba(18, 18, 26, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .logo {
    color: #e8e8f0;
}

html[data-theme="dark"] .nav-link {
    color: #a0a0b4;
}

html[data-theme="dark"] .nav-link:hover {
    color: #e0e0ec;
}

html[data-theme="dark"] .btn-login {
    border-color: #a0a0b4;
    color: #d0d0e0;
}

html[data-theme="dark"] .btn-login:hover {
    background: #d0d0e0;
    color: #121218;
}

html[data-theme="dark"] .nav-user {
    color: #e0e0ec;
    background: #252535;
}

html[data-theme="dark"] .nav-user:hover {
    background: #2e2e42;
    color: #f0f0f8;
}

html[data-theme="dark"] .nav-bell {
    color: #a0a0b4;
}

html[data-theme="dark"] .nav-bell:hover {
    background: #252535;
    color: #e0e0ec;
}

html[data-theme="dark"] .bell-badge {
    border-color: #1a1a26;
}


/* ─── Dropdown Menu ────────────────────────────────────────── */
html[data-theme="dark"] .nav-dropdown-menu {
    background: #1e1e2a;
    border-color: #2e2e42;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .nav-dropdown-item {
    color: #d0d0e0;
}

html[data-theme="dark"] .nav-dropdown-item:hover {
    background: #252535;
}

html[data-theme="dark"] .nav-dropdown-item svg {
    color: #808098;
}

html[data-theme="dark"] .nav-dropdown-divider {
    background: #2e2e42;
}

html[data-theme="dark"] .nav-dropdown-logout {
    color: #ef6b6b;
}

html[data-theme="dark"] .nav-dropdown-logout:hover {
    background: #2d1a1a;
}

html[data-theme="dark"] .nav-dropdown-logout svg {
    color: #ef6b6b;
}


/* ─── Topics Section ───────────────────────────────────────── */
html[data-theme="dark"] .topics h2 {
    color: #e8e8f0;
}

html[data-theme="dark"] .topics > p {
    color: #808098;
}

html[data-theme="dark"] .topic-card {
    background: #1a1a2a;
    border-color: #2e2e42;
    color: #d0d0e0;
}

html[data-theme="dark"] .topic-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
    border-color: #3a3a50;
}

html[data-theme="dark"] .topic-card h3 {
    color: #e0e0ec;
}

html[data-theme="dark"] .topic-card p {
    color: #808098;
}


/* ─── Trending Section ─────────────────────────────────────── */
html[data-theme="dark"] .trending h2 {
    color: #e8e8f0;
}

html[data-theme="dark"] .trending-subtitle {
    color: #808098;
}

html[data-theme="dark"] .trending-cat {
    background: #1a1a2a;
    border-color: #2e2e42;
    color: #a0a0b4;
}

html[data-theme="dark"] .trending-cat:hover {
    border-color: #ef8354;
    color: #ef8354;
}

html[data-theme="dark"] .trending-cat-more {
    background: transparent;
}

html[data-theme="dark"] .trending-cat-more:hover {
    background: rgba(239, 131, 84, 0.08);
}


/* ─── Paper Cards ──────────────────────────────────────────── */
html[data-theme="dark"] .paper-card {
    background: #1a1a2a;
    border-color: #2e2e42;
}

html[data-theme="dark"] .paper-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: #3a3a50;
}

html[data-theme="dark"] .paper-title {
    color: #e8e8f0;
}

html[data-theme="dark"] .paper-authors {
    color: #808098;
}

html[data-theme="dark"] .paper-abstract {
    color: #a0a0b4;
}

html[data-theme="dark"] .paper-rank {
    color: #808098;
}

html[data-theme="dark"] .paper-card:first-child .paper-rank {
    color: #ef8354;
}

html[data-theme="dark"] .paper-stats {
    color: #808098;
}

html[data-theme="dark"] .paper-stats i {
    color: #606074;
}

html[data-theme="dark"] .tag {
    background: #252535;
    color: #c0c0d4;
}

html[data-theme="dark"] .paper-source-badge {
    background: color-mix(in srgb, var(--badge-color, #888) 18%, #1a1a2a);
}

html[data-theme="dark"] .citation-count,
html[data-theme="dark"] .view-count,
html[data-theme="dark"] .trending-stat {
    color: #808098;
}

html[data-theme="dark"] .btn-save-card {
    background: #1a1a2a;
    border-color: #2e2e42;
    color: #808098;
}

html[data-theme="dark"] .btn-save-card:hover {
    border-color: #a78bfa;
    color: #a78bfa;
    background: #221e35;
}

html[data-theme="dark"] .btn-save-card.saved {
    border-color: #a78bfa;
    color: #a78bfa;
    background: #2a2240;
}


/* ─── Features Section ─────────────────────────────────────── */
html[data-theme="dark"] .features {
    background: linear-gradient(180deg, #16161e 0%, #1a1a24 100%);
    border-top-color: #2e2e42;
    border-bottom-color: #2e2e42;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 -4px 12px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .features h2 {
    color: #e8e8f0;
}

html[data-theme="dark"] .features-subtitle {
    color: #808098;
}

html[data-theme="dark"] .feature-card {
    background: #1a1a2a;
    border-color: #2e2e42;
}

html[data-theme="dark"] .feature-card:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
    border-color: #3a3a50;
}

html[data-theme="dark"] .feature-icon {
    background: linear-gradient(135deg, #2e2218 0%, #332418 100%);
}

html[data-theme="dark"] .feature-card h3 {
    color: #e0e0ec;
}

html[data-theme="dark"] .feature-card p {
    color: #a0a0b4;
}


/* ─── Upload CTA ───────────────────────────────────────────── */
html[data-theme="dark"] .upload-cta {
    background:
        linear-gradient(135deg, rgba(18,18,24,0.92) 0%, rgba(22,22,30,0.90) 50%, rgba(26,26,36,0.88) 100%),
        url('photos/whiteboard.jpg') center/cover no-repeat;
}

html[data-theme="dark"] .upload-cta-text h2 {
    color: #e8e8f0;
}

html[data-theme="dark"] .upload-cta-text p {
    color: #a0a0b4;
}

html[data-theme="dark"] .upload-note {
    color: #606074 !important;
}

html[data-theme="dark"] .upload-dropzone {
    background: #1a1a2a;
    border-color: #3a3a50;
}

html[data-theme="dark"] .upload-dropzone:hover {
    border-color: #ef8354;
    background: #221e1a;
}

html[data-theme="dark"] .dropzone-icon {
    color: #3a3a50;
}

html[data-theme="dark"] .upload-dropzone:hover .dropzone-icon {
    color: #ef8354;
}

html[data-theme="dark"] .upload-dropzone p {
    color: #c0c0d4;
}

html[data-theme="dark"] .upload-dropzone span {
    color: #606074;
}

html[data-theme="dark"] .upload-cta .rights-checkbox {
    color: #c0c0d4;
    background: rgba(239, 131, 84, 0.06);
    border-color: rgba(239, 131, 84, 0.2);
}


/* ─── Footer ───────────────────────────────────────────────── */
html[data-theme="dark"] .footer {
    background: #0c0c12;
}

html[data-theme="dark"] .footer-col p,
html[data-theme="dark"] .footer-col a {
    color: #808098;
}

html[data-theme="dark"] .footer-col a:hover {
    color: #e0e0ec;
}

html[data-theme="dark"] .footer-bottom {
    border-top-color: #2a2a3e;
}


/* ─── Legal Pages ──────────────────────────────────────────── */
html[data-theme="dark"] .legal-container h1 {
    color: #e8e8f0;
}

html[data-theme="dark"] .legal-updated {
    color: #606074;
}

html[data-theme="dark"] .legal-section h2 {
    color: #e0e0ec;
    border-bottom-color: #2e2e42;
}

html[data-theme="dark"] .legal-section p,
html[data-theme="dark"] .legal-section li {
    color: #a0a0b4;
}

html[data-theme="dark"] .dmca-step {
    background: #1a1a2a;
    border-color: #2e2e42;
}

html[data-theme="dark"] .dmca-step-number {
    background: #e0e0ec;
    color: #121218;
}

html[data-theme="dark"] .dmca-step-content h3 {
    color: #e0e0ec;
}

html[data-theme="dark"] .dmca-step-content p {
    color: #a0a0b4;
}

html[data-theme="dark"] .dmca-contact-box {
    background: #152218;
    border-color: #1e3a24;
}


/* ─── Scrollbar ────────────────────────────────────────────── */
html[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #121218;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #2e2e42;
    border-radius: 5px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3a3a50;
}


/* ─── Selection ────────────────────────────────────────────── */
html[data-theme="dark"] ::selection {
    background: rgba(239, 131, 84, 0.3);
    color: #fff;
}


/* ─── Form Inputs (global) ─────────────────────────────────── */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: #1a1a2a;
    color: #d8d8e8;
    border-color: #2e2e42;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #606074;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
    border-color: rgba(239, 131, 84, 0.5);
    outline-color: rgba(239, 131, 84, 0.3);
}


/* ─── Rights Checkbox ──────────────────────────────────────── */
html[data-theme="dark"] .rights-checkbox {
    color: #808098;
}

html[data-theme="dark"] .rights-checkbox a {
    color: #ef8354;
}

html[data-theme="dark"] .upload-cta .rights-checkbox a {
    color: #ef8354;
}


/* ─── Upload Confirmation Dialog ───────────────────────────── */
html[data-theme="dark"] .confirm-overlay .confirm-box {
    background: #1e1e2a;
    border-color: #2e2e42;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}
