/**
 * Dark Mode Styles
 * Soft, modern dark mode with excellent readability
 */

/* ========================================
   DARK MODE CSS VARIABLES
   ======================================== */

body.dark-mode {
    /* Background Colors - SOFTER */
    --bg-primary: #1a1f2e;      /* Soft dark blue-gray */
    --bg-secondary: #242936;    /* Cards, sections - lighter */
    --bg-tertiary: #2d3548;     /* Hover, active - more visible */
    --bg-light: #3d4556;        /* Light accents */
    
    /* Text Colors - HIGHER CONTRAST */
    --text-primary: #ffffff;    /* Pure white - maximum readability */
    --text-secondary: #e2e8f0;  /* Light gray - excellent contrast */
    --text-tertiary: #a0aec0;   /* Muted - still readable */
    
    /* Border Colors - MORE VISIBLE */
    --border-primary: #3d4556;  /* Visible borders */
    --border-secondary: #4a5568; /* Stronger borders */
    
    /* Special Colors */
    --shadow: rgba(0, 0, 0, 0.25);
    --overlay: rgba(26, 31, 46, 0.95);
}

/* ========================================
   GLOBAL OVERRIDES
   ======================================== */

body.dark-mode {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

body.dark-mode #nivo-container {
    background-color: var(--bg-primary) !important;
}

body.dark-mode .nivo-page-wrapper,
body.dark-mode .nivo-content-wrapper {
    background-color: var(--bg-primary) !important;
}

body.dark-mode .nivo-main-wrapper {
    background-color: var(--bg-primary) !important;
}

body.dark-mode .nivo-content-area {
    background-color: transparent !important;
}

/* ===== HEADER ===== */
body.dark-mode .nivo-header {
    background: var(--bg-primary) !important;
    border-bottom-color: var(--border-primary) !important;
}

/* ===== ABOUT SECTION ===== */
body.dark-mode .nivo-about-section {
    background-color: var(--bg-primary) !important;
}

body.dark-mode .nivo-about-text {
    background: var(--bg-secondary) !important;
    color: #e2e8f0 !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-editor-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-editor-name {
    color: #ffffff !important;
}

body.dark-mode .nivo-editor-role {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-editor-affiliation {
    color: #cbd5e1 !important;
}

body.dark-mode .nivo-journal-name {
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-journal-description {
    color: var(--text-secondary) !important;
}

/* ===== NAVIGATION ===== */
body.dark-mode .nivo-navbar {
    /* background removed - set by PHP inline CSS */
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

body.dark-mode .nivo-nav-link {
    color: #e2e8f0 !important;
    font-weight: 500;
}

body.dark-mode .nivo-nav-link:hover {
    color: #ffffff !important;
    background: var(--bg-tertiary) !important;
}

body.dark-mode .nivo-nav-link.active {
    color: #ffffff !important;
    background: var(--bg-tertiary) !important;
    border-bottom-color: var(--primary-color) !important;
}

body.dark-mode .nivo-submit-btn {
    color: #ffffff !important; /* White text on primary background */
    font-weight: 600;
}

/* ===== SEARCH ===== */
body.dark-mode .nivo-search-input {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-search-input::placeholder {
    color: var(--text-tertiary) !important;
}

/* ===== HERO SECTION ===== */
body.dark-mode .nivo-hero-gradient {
    /* Keep gradient vibrant - don't make it too dark! */
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a1f2e 100%) !important;
}

body.dark-mode .nivo-hero-title {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nivo-hero-subtitle {
    color: #e2e8f0 !important;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* Hero badges - both homepage and inner */
body.dark-mode .nivo-hero-badge {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .nivo-hero-badge-inner {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ===== SECTIONS & CARDS ===== */
body.dark-mode .nivo-section {
    background: transparent !important;
}

body.dark-mode .nivo-last-articles,
body.dark-mode .nivo-most-viewed {
    background: var(--bg-secondary) !important;
    padding: 40px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-section-title,
body.dark-mode .nivo-section-title-red {
    color: #ffffff !important;
}

body.dark-mode .nivo-card,
body.dark-mode .nivo-most-viewed-card,
body.dark-mode .nivo-current-issue-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-card:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-secondary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* ===== ARTICLE CARDS ===== */
body.dark-mode .nivo-article-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-article-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .nivo-article-meta-row {
    border-bottom-color: var(--border-primary) !important;
}

body.dark-mode .nivo-meta-item {
    color: #a0aec0 !important;
}

body.dark-mode .nivo-meta-icon {
    color: #a0aec0 !important;
    stroke: #a0aec0 !important;
}

body.dark-mode .nivo-article-title a {
    color: #ffffff !important;
    font-weight: 600;
}

body.dark-mode .nivo-article-title a:hover {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-article-authors,
body.dark-mode .nivo-article-meta {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-article-abstract {
    color: #cbd5e1 !important;
    line-height: 1.6;
}

/* ===== BUTTONS ===== */
body.dark-mode .nivo-btn {
    background: var(--bg-tertiary) !important;
    color: #ffffff !important;
    border: 1px solid var(--border-primary) !important;
    font-weight: 500;
}

body.dark-mode .nivo-btn:hover {
    background: var(--bg-light) !important;
    border-color: var(--border-secondary) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .nivo-btn-primary {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
    font-weight: 600;
}

body.dark-mode .nivo-btn-primary:hover {
    background: var(--primary-color-dark) !important;
    border-color: var(--primary-color-dark) !important;
}

body.dark-mode .nivo-btn-login {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
}

body.dark-mode .nivo-btn-login:hover {
    background: var(--primary-color-dark) !important;
}

/* ===== ARTICLE DETAIL ===== */
body.dark-mode .nivo-article-details {
    background: var(--bg-primary) !important;
}

body.dark-mode .nivo-article-page {
    background: var(--bg-primary) !important;
}

body.dark-mode .nivo-article-detail-wrapper {
    background: var(--bg-primary) !important;
}

body.dark-mode .nivo-article-detail-layout {
    background: var(--bg-primary) !important;
}

body.dark-mode .nivo-article-main {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-article-title {
    color: #ffffff !important;
    font-weight: 700;
}

body.dark-mode .nivo-article-section-title,
body.dark-mode .nivo-sidebar-section-title {
    color: #ffffff !important;
    font-weight: 600;
}

body.dark-mode .nivo-article-text p,
body.dark-mode .nivo-article-text li {
    color: #e2e8f0 !important;
    line-height: 1.8;
}

body.dark-mode .nivo-article-abstract-text {
    color: #e2e8f0 !important;
    line-height: 1.7;
}

/* ===== GALLEYS (PDF Buttons) ===== */
body.dark-mode .nivo-galley-btn {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-galley-btn:hover {
    background: var(--bg-light) !important;
}

body.dark-mode .nivo-galley-btn-pdf {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-galley-btn-pdf:hover {
    background: var(--primary-color-dark) !important;
}

/* ===== DOI & LINKS ===== */
body.dark-mode .nivo-doi-link,
body.dark-mode .nivo-article-doi a {
    color: var(--primary-color) !important;
}

/* ===== ARTICLE ACTIONS ROW ===== */
body.dark-mode .nivo-article-actions-row {
    border-top-color: var(--border-primary) !important;
}

body.dark-mode .nivo-article-doi-box {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-article-doi-box a {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-article-doi-box a:hover {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-galley-link {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-galley-link:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

body.dark-mode .nivo-view-article-btn {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-view-article-btn:hover {
    background: var(--primary-color-dark) !important;
}

/* ===== CITATIONS ===== */
body.dark-mode .nivo-citation-tab {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-citation-tab:hover {
    background: var(--bg-light) !important;
}

body.dark-mode .nivo-citation-tab.active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-citation-output {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-sidebar-citation .nivo-citation-output {
    background: var(--bg-tertiary) !important;
    border-left-color: var(--primary-color) !important;
}

/* ===== REFERENCES ===== */
body.dark-mode .nivo-references-list {
    background: var(--bg-tertiary) !important;
}

body.dark-mode .nivo-reference-item {
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-primary) !important;
}

body.dark-mode .nivo-references-toggle {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-references-toggle:hover {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

/* ===== SIMILAR ARTICLES ===== */
body.dark-mode #articlesBySimilarityList,
body.dark-mode #articlesBySameAuthorList {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode #articlesBySimilarityList h3,
body.dark-mode #articlesBySameAuthorList h3 {
    color: #ffffff !important;
    font-weight: 600;
}

body.dark-mode #articlesBySimilarityList li,
body.dark-mode #articlesBySameAuthorList li {
    border-bottom-color: var(--border-primary) !important;
}

body.dark-mode #articlesBySimilarityList ul > *:before,
body.dark-mode #articlesBySameAuthorList ul > *:before {
    color: var(--primary-color) !important;
    z-index: 20 !important;
}

body.dark-mode #articlesBySimilarityList a,
body.dark-mode #articlesBySameAuthorList a {
    color: #e2e8f0 !important;
}

body.dark-mode #articlesBySimilarityList a:hover,
body.dark-mode #articlesBySameAuthorList a:hover {
    color: var(--primary-color) !important;
}

body.dark-mode #articlesBySimilarityList p,
body.dark-mode #articlesBySameAuthorList p {
    color: #cbd5e1 !important;
}

body.dark-mode #articlesBySimilarityList p a,
body.dark-mode #articlesBySameAuthorList p a {
    color: var(--primary-color) !important;
}

/* ===== SIDEBAR ===== */
body.dark-mode .nivo-sidebar {
    background: transparent !important;
}

body.dark-mode .nivo-sidebar-block {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-sidebar-title {
    color: #ffffff !important;
    font-weight: 600;
}

body.dark-mode .nivo-login-block {
    background: var(--bg-secondary) !important;
}

body.dark-mode .nivo-user-info {
    background: transparent !important;
}

body.dark-mode .nivo-welcome {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-welcome strong {
    color: #ffffff !important;
}

body.dark-mode .nivo-login-links a,
body.dark-mode .nivo-profile-link,
body.dark-mode .nivo-logout-link {
    background: var(--bg-tertiary) !important;
    color: #ffffff !important;
    border: 1px solid var(--border-primary) !important;
}

body.dark-mode .nivo-login-links a:hover,
body.dark-mode .nivo-profile-link:hover,
body.dark-mode .nivo-logout-link:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

body.dark-mode .nivo-author-name {
    color: var(--primary-color) !important;
    font-weight: 600;
}

body.dark-mode .nivo-author-affiliation,
body.dark-mode .nivo-author-bio {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-sidebar-mini-card {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-primary) !important;
}

body.dark-mode .mini-label {
    color: #a0aec0 !important;
}

body.dark-mode .mini-value {
    color: #ffffff !important;
}

body.dark-mode .nivo-article-sidebar-section {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-primary) !important;
}

body.dark-mode .sidebar-label {
    color: #a0aec0 !important;
}

body.dark-mode .sidebar-value {
    color: #e2e8f0 !important;
}

body.dark-mode .sidebar-value a {
    color: var(--primary-color) !important;
}

/* ===== METRICS ===== */
body.dark-mode .nivo-journal-metrics-full {
    background-color: var(--bg-primary) !important;
}

body.dark-mode .nivo-metric-box {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-metric-box:hover {
    background: var(--bg-tertiary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .nivo-metric-value {
    color: var(--primary-color) !important;  /* Primary color for consistency */
    font-weight: 700;
}

body.dark-mode .nivo-metric-name {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* ===== ISSUE PAGE ===== */
body.dark-mode .nivo-issue-hero {
    background: var(--bg-secondary) !important;
    border-bottom-color: var(--border-primary) !important;
}

body.dark-mode .nivo-issue-hero-title {
    color: #ffffff !important;
}

body.dark-mode .nivo-issue-hero-meta-item {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-issue-description {
    color: #cbd5e1 !important;
}

/* Issue Galleys Dark Mode */
body.dark-mode .nivo-issue-galleys {
    border-top-color: var(--border-color) !important;
}

body.dark-mode .nivo-issue-galleys-label {
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-issue-galley-button {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important; /* Add visible border */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important; /* Stronger shadow */
}

body.dark-mode .nivo-issue-galley-button:hover {
    border-color: rgba(255, 255, 255, 0.4) !important; /* Brighter border on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    transform: translateY(-2px);
}

body.dark-mode .nivo-issue-cover-placeholder-large {
    background: var(--bg-tertiary) !important;
}

body.dark-mode .nivo-issue-cover-placeholder {
    background: var(--bg-tertiary) !important;
    color: #94a3b8 !important; /* Light gray text for "Cover image not available" */
}

body.dark-mode .nivo-issue-cover {
    background: var(--bg-tertiary) !important;
}

body.dark-mode .nivo-issue-toc {
    background: var(--bg-primary) !important;
}

body.dark-mode .nivo-issue-section {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
}

body.dark-mode .nivo-issue-section-title {
    color: #ffffff !important;
}

/* ===== ISSUE ARCHIVE ===== */
body.dark-mode .nivo-archive-year-title,
body.dark-mode .nivo-issue-section-title {
    color: #ffffff !important;
}

body.dark-mode .nivo-archive-year {
    background: var(--bg-secondary) !important;
    color: #e2e8f0 !important;
    border: 1px solid var(--border-primary) !important;
    font-weight: 500;
}

body.dark-mode .nivo-archive-year:hover {
    background: var(--bg-tertiary) !important;
    color: #ffffff !important;
    border-color: var(--border-secondary) !important;
}

body.dark-mode .nivo-archive-year.active {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
    font-weight: 600;
}

body.dark-mode .nivo-issue-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-issue-card:hover {
    background: var(--bg-tertiary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .nivo-article-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .nivo-article-card:hover {
    background: var(--bg-tertiary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .nivo-article-card-inner {
    background: transparent !important;
}

body.dark-mode .nivo-issue-title a {
    color: #ffffff !important;
    font-weight: 600;
}

body.dark-mode .nivo-issue-title a:hover {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-issue-title {
    color: #ffffff !important;
}

body.dark-mode .nivo-issue-meta {
    color: #e2e8f0 !important;
}

/* ===== FOOTER ===== */
body.dark-mode .nivo-footer {
    background: #161b28 !important;
    border-top: 1px solid var(--border-primary) !important;
}

/* FOOTER CARD DESIGN - Dark Mode */
body.dark-mode .nivo-footer-col {
    background: rgba(45, 53, 72, 0.6) !important; /* Subtle card background */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nivo-footer-col:hover {
    background: rgba(45, 53, 72, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .nivo-footer-title {
    color: #ffffff !important;
    font-weight: 600;
}

body.dark-mode .nivo-footer-title::after {
    background: var(--primary-color, #59025e) !important;
}

body.dark-mode .nivo-footer-text {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-footer-text a {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-footer-text a:hover {
    color: var(--primary-color, #59025e) !important;
}

body.dark-mode .nivo-footer-link {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-footer-link:hover {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-footer-social-link {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-footer-social-link:hover {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-copyright {
    color: #a0aec0 !important;
}

/* ===== TABLES ===== */
body.dark-mode table {
    border-color: var(--border-primary) !important;
}

body.dark-mode th {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode td {
    border-color: var(--border-primary) !important;
    color: var(--text-secondary) !important;
}

/* ===== FORMS ===== */
body.dark-mode .nivo-label {
    color: #e2e8f0 !important;
    font-weight: 500;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-primary) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-input {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-primary) !important;
    color: #ffffff !important;
}

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

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus,
body.dark-mode .nivo-input:focus {
    border-color: var(--primary-color) !important;
    background: var(--bg-light) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* ===== BADGES ===== */
body.dark-mode .nivo-badge,
body.dark-mode .nivo-current-issue-badge {
    background: var(--bg-light) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-current-issue-large-badge {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

/* ===== KEYWORDS ===== */
body.dark-mode .nivo-keyword {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-primary) !important;
}

/* ===== BREADCRUMBS ===== */
body.dark-mode .nivo-breadcrumb {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-breadcrumb a {
    color: var(--text-tertiary) !important;
}

body.dark-mode .nivo-breadcrumb a:hover {
    color: var(--primary-color) !important;
}

/* ===== ALERTS ===== */
body.dark-mode .alert {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

/* ===== CODE BLOCKS ===== */
body.dark-mode code,
body.dark-mode pre {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-primary) !important;
}

/* ===== PAGINATION ===== */
body.dark-mode .nivo-pagination {
    background: var(--bg-secondary) !important;
}

body.dark-mode .nivo-page-link {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-page-link:hover {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-page-link.active {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

/* ===== SCROLLBAR ===== */
body.dark-mode ::-webkit-scrollbar {
    width: 12px;
    background: var(--bg-primary);
}

body.dark-mode ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--bg-light);
}

/* ===== SELECTION ===== */
body.dark-mode ::selection {
    background: var(--primary-color) !important;
    color: #0f172a !important; /* Dark text on bright selection */
    text-shadow: none !important;
}

body.dark-mode ::-moz-selection {
    background: var(--primary-color) !important;
    color: #0f172a !important; /* Dark text on bright selection */
    text-shadow: none !important;
}

/* ===== MOBILE NAVIGATION (DARK MODE) ===== */
/* Simple solid colors - no variables */

@media (max-width: 768px) {
    body.dark-mode .nivo-nav-menu {
        background-color: #2d3748 !important;
        border-top: 1px solid #4a5568 !important;
    }
    
    body.dark-mode #navigationPrimary,
    body.dark-mode .nivo-menu-list {
        background-color: #2d3748 !important;
    }
    
    body.dark-mode #navigationPrimary li a,
    body.dark-mode .nivo-menu-list li a {
        background-color: #2d3748 !important;
        color: #e2e8f0 !important;
        border-bottom: 1px solid #4a5568 !important;
        padding: 15px 20px !important;
        display: block !important;
    }
    
    body.dark-mode #navigationPrimary li a:hover,
    body.dark-mode .nivo-menu-list li a:hover {
        background-color: #374151 !important;
    }
    
    body.dark-mode #navigationPrimary li ul,
    body.dark-mode .nivo-menu-list li ul {
        background-color: #374151 !important;
    }
    
    body.dark-mode #navigationPrimary li ul li a,
    body.dark-mode .nivo-menu-list li ul li a {
        background-color: #374151 !important;
        color: #cbd5e0 !important;
        padding: 12px 20px 12px 40px !important;
    }
    
    body.dark-mode #navigationPrimary li ul li a:hover,
    body.dark-mode .nivo-menu-list li ul li a:hover {
        background-color: #4a5568 !important;
    }
}

/* ===== NAVIGATION DROPDOWN MENU ===== */
body.dark-mode #navigationPrimary > li > ul,
body.dark-mode .nivo-menu-list > li > ul {
    background-color: #2C3E50 !important;
    border-color: var(--border-primary) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}

body.dark-mode #navigationPrimary > li > ul li a,
body.dark-mode .nivo-menu-list > li > ul li a {
    color: #ffffff !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode #navigationPrimary > li > ul li a:hover,
body.dark-mode .nivo-menu-list > li > ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* ===== ARCHIVE COMPACT LIST (DARK MODE) ===== */
body.dark-mode .nivo-archive-year-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
}

body.dark-mode .nivo-archive-year-card:hover {
    background: var(--bg-tertiary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .nivo-archive-year-card-title {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

body.dark-mode .nivo-issue-list-item {
    border-bottom: 1px solid var(--border-primary) !important;
}

body.dark-mode .nivo-issue-list-link {
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-issue-list-link:hover {
    background: var(--bg-tertiary) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-issue-date,
body.dark-mode .nivo-issue-articles-count {
    color: #94a3b8 !important;
}


/* ===== ISSUE ARTICLE BADGES (DARK MODE) ===== */
body.dark-mode .nivo-article-issue-badge-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%) !important;
    color: #93c5fd !important;
}

body.dark-mode .nivo-article-issue-badge-pages {
    background: linear-gradient(135deg, #1e4620 0%, #2d5a2f 100%) !important;
    color: #86efac !important;
}




/* ===== USER DROPDOWN MENU (DARK MODE) ===== */
body.dark-mode .nivo-user-menu-trigger {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .nivo-user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .nivo-user-menu-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

body.dark-mode .nivo-user-dropdown {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .nivo-dropdown-item {
    color: #e2e8f0 !important;
    border-bottom-color: var(--border-primary) !important;
}

body.dark-mode .nivo-dropdown-item svg {
    color: #94a3b8 !important;
}

body.dark-mode .nivo-dropdown-item:hover {
    background: var(--bg-tertiary) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-dropdown-item:hover svg {
    color: var(--primary-color) !important;
}


/* ===== TOP HEADER BAR (DARK MODE) ===== */
body.dark-mode .nivo-top-bar {
    background-color: #2e3448 !important;
}


/* ===== CUSTOM BLOCK MANAGER (DARK MODE) ===== */
body.dark-mode .pkp_block {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .pkp_block h2,
body.dark-mode .pkp_block h3,
body.dark-mode .pkp_block h4 {
    color: #e2e8f0 !important;
    border-bottom-color: var(--border-primary) !important;
}

body.dark-mode .pkp_block p,
body.dark-mode .pkp_block li {
    color: #cbd5e1 !important;
}

body.dark-mode .pkp_block a {
    color: var(--primary-color) !important;
}

body.dark-mode .pkp_block a:hover {
    color: #60a5fa !important;
}


/* ===== VIEW ALL ARTICLES BUTTON (DARK MODE) ===== */
body.dark-mode .nivo-view-all-link a {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-view-all-link a:hover {
    opacity: 0.9 !important;
}


/* ===== SUBMISSION CHECKLIST (DARK MODE) ===== */
body.dark-mode .nivo-checklist li {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .nivo-checklist li:before {
    background-color: var(--primary-color) !important;
}


/* ========================================
   STATIC PAGES - DARK MODE
   About, Contact, Submissions, Privacy, etc.
   ======================================== */

/* PAGE CONTENT CARD */
body.dark-mode .page,
body.dark-mode .page_about,
body.dark-mode .page_contact,
body.dark-mode .page_privacy,
body.dark-mode .page_submissions,
body.dark-mode .pkp_page_about,
body.dark-mode .pkp_page_information {
    background-color: var(--bg-primary) !important;
}

/* Main content area - White card on dark background */
body.dark-mode .page .main-content,
body.dark-mode article.page,
body.dark-mode .page-content,
body.dark-mode .static-page-content,
body.dark-mode .pkp_structure_content {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

/* CRITICAL: Generic content wrappers for OJS */
body.dark-mode .nivo-about-text,
body.dark-mode .page-wrapper .content,
body.dark-mode .main-content-wrapper,
body.dark-mode .content-wrapper article,
body.dark-mode .pkp_structure_main article,
body.dark-mode .pkp_structure_main .page,
body.dark-mode [class*="page_"] article,
body.dark-mode [class*="page_"] .content {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

/* CRITICAL: NIVO Page Card - About, Contact, etc. */
body.dark-mode .nivo-page-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-page-title {
    color: #ffffff !important;
}

body.dark-mode .nivo-page-content {
    color: var(--text-secondary) !important;
}

/* Contact page elements */
body.dark-mode .nivo-contact-section {
    border-top: 1px solid var(--border-primary) !important;
    padding-top: 20px;
    margin-top: 20px;
}

body.dark-mode .nivo-contact-section:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

body.dark-mode .nivo-contact-section h2 {
    color: #ffffff !important;
}

body.dark-mode .nivo-contact-item {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-contact-item strong {
    color: #ffffff !important;
}

body.dark-mode .nivo-contact-item a {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-contact-item a:hover {
    color: #ffffff !important;
}

/* All elements inside nivo-page-content */
body.dark-mode .nivo-page-content h1,
body.dark-mode .nivo-page-content h2,
body.dark-mode .nivo-page-content h3,
body.dark-mode .nivo-page-content h4,
body.dark-mode .nivo-page-content h5,
body.dark-mode .nivo-page-content h6 {
    color: #ffffff !important;
}

body.dark-mode .nivo-page-content p {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-page-content a {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-page-content a:hover {
    color: #ffffff !important;
}

body.dark-mode .nivo-page-content ul li,
body.dark-mode .nivo-page-content ol li {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-page-content strong,
body.dark-mode .nivo-page-content b {
    color: #ffffff !important;
}

body.dark-mode .nivo-page-content table {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-page-content table th {
    background: var(--bg-light) !important;
    color: #ffffff !important;
    border-color: var(--border-secondary) !important;
}

body.dark-mode .nivo-page-content table td {
    color: var(--text-secondary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-page-content blockquote {
    background: var(--bg-tertiary) !important;
    border-left-color: var(--primary-color) !important;
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-page-content pre,
body.dark-mode .nivo-page-content code {
    background: var(--bg-tertiary) !important;
    color: #f8f8f2 !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nivo-page-content hr {
    border-color: var(--border-primary) !important;
}

/* Headings */
body.dark-mode .page h1,
body.dark-mode .page h2,
body.dark-mode .page h3,
body.dark-mode .page h4,
body.dark-mode .page h5,
body.dark-mode .page h6,
body.dark-mode article.page h1,
body.dark-mode article.page h2,
body.dark-mode article.page h3,
body.dark-mode .static-page-content h1,
body.dark-mode .static-page-content h2,
body.dark-mode .static-page-content h3 {
    color: #ffffff !important;
}

/* Paragraphs */
body.dark-mode .page p,
body.dark-mode article.page p,
body.dark-mode .static-page-content p,
body.dark-mode .page-content p {
    color: var(--text-secondary) !important;
}

/* Links */
body.dark-mode .page a,
body.dark-mode article.page a,
body.dark-mode .static-page-content a,
body.dark-mode .page-content a {
    color: var(--primary-color) !important;
}

body.dark-mode .page a:hover,
body.dark-mode article.page a:hover,
body.dark-mode .static-page-content a:hover {
    color: #ffffff !important;
}

/* Lists */
body.dark-mode .page ul li,
body.dark-mode .page ol li,
body.dark-mode article.page ul li,
body.dark-mode article.page ol li {
    color: var(--text-secondary) !important;
}

/* Strong/Bold text */
body.dark-mode .page strong,
body.dark-mode article.page strong,
body.dark-mode .page b,
body.dark-mode article.page b {
    color: #ffffff !important;
}

/* Tables in static pages */
body.dark-mode .page table,
body.dark-mode article.page table {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .page table th,
body.dark-mode article.page table th {
    background: var(--bg-light) !important;
    color: #ffffff !important;
    border-color: var(--border-secondary) !important;
}

body.dark-mode .page table td,
body.dark-mode article.page table td {
    color: var(--text-secondary) !important;
    border-color: var(--border-primary) !important;
}

/* Blockquotes */
body.dark-mode .page blockquote,
body.dark-mode article.page blockquote {
    background: var(--bg-tertiary) !important;
    border-left-color: var(--primary-color) !important;
    color: var(--text-secondary) !important;
}

/* Code blocks */
body.dark-mode .page pre,
body.dark-mode article.page pre,
body.dark-mode .page code,
body.dark-mode article.page code {
    background: var(--bg-tertiary) !important;
    color: #f8f8f2 !important;
    border-color: var(--border-primary) !important;
}

/* HR lines */
body.dark-mode .page hr,
body.dark-mode article.page hr {
    border-color: var(--border-primary) !important;
}

/* Forms in static pages (contact, submissions) */
body.dark-mode .page form,
body.dark-mode article.page form {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .page input[type="text"],
body.dark-mode .page input[type="email"],
body.dark-mode .page input[type="tel"],
body.dark-mode .page input[type="url"],
body.dark-mode .page textarea,
body.dark-mode .page select {
    background: var(--bg-light) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-secondary) !important;
}

body.dark-mode .page input:focus,
body.dark-mode .page textarea:focus,
body.dark-mode .page select:focus {
    border-color: var(--primary-color) !important;
    background: var(--bg-tertiary) !important;
}

body.dark-mode .page label {
    color: var(--text-primary) !important;
}

/* Buttons in forms */
body.dark-mode .page button,
body.dark-mode .page input[type="submit"],
body.dark-mode .page .btn,
body.dark-mode .page .button {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
}

body.dark-mode .page button:hover,
body.dark-mode .page input[type="submit"]:hover {
    opacity: 0.9 !important;
}

/* Sidebar on static pages */
body.dark-mode .page .sidebar,
body.dark-mode article.page .sidebar {
    background: transparent !important;
}

/* Breadcrumbs */
body.dark-mode .breadcrumb,
body.dark-mode .pkp_page_breadcrumb {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .breadcrumb a,
body.dark-mode .pkp_page_breadcrumb a {
    color: var(--text-secondary) !important;
}

body.dark-mode .breadcrumb a:hover,
body.dark-mode .pkp_page_breadcrumb a:hover {
    color: var(--primary-color) !important;
}

/* Contact page specific */
body.dark-mode .contact-info,
body.dark-mode .contact-section {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

/* Editorial board page */
body.dark-mode .editorial-board,
body.dark-mode .editor-list {
    background: transparent !important;
}

body.dark-mode .editor-card,
body.dark-mode .editorial-member {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .editor-name {
    color: #ffffff !important;
}

body.dark-mode .editor-title,
body.dark-mode .editor-role {
    color: var(--primary-color) !important;
}

body.dark-mode .editor-affiliation,
body.dark-mode .editor-bio {
    color: var(--text-secondary) !important;
}

/* Privacy/Policy pages */
body.dark-mode .policy-section,
body.dark-mode .privacy-section {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

/* Submission guidelines */
body.dark-mode .submission-guidelines,
body.dark-mode .submission-steps {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .submission-step {
    border-color: var(--border-primary) !important;
}

body.dark-mode .submission-step-number {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

/* Navigation tabs on static pages */
body.dark-mode .nav-tabs {
    border-color: var(--border-primary) !important;
}

body.dark-mode .nav-tabs .nav-link {
    color: var(--text-secondary) !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode .nav-tabs .nav-link:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .nav-tabs .nav-link.active {
    background: var(--bg-secondary) !important;
    color: #ffffff !important;
    border-color: var(--border-primary) !important;
}

/* Alerts/Messages on static pages */
body.dark-mode .alert,
body.dark-mode .message,
body.dark-mode .notice {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-secondary) !important;
}

body.dark-mode .alert-success {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

body.dark-mode .alert-warning {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}

body.dark-mode .alert-danger,
body.dark-mode .alert-error {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

body.dark-mode .alert-info {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* ========================================
   SUBMISSION PAGE - DARK MODE
   ======================================== */

/* Submission Actions */
body.dark-mode .nivo-submission-actions,
body.dark-mode .nivo-submission-prompt {
    background: var(--bg-tertiary) !important;
    border-color: var(--primary-color) !important;
}

body.dark-mode .nivo-submission-button {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

body.dark-mode .nivo-submission-button:hover {
    opacity: 0.9 !important;
}

body.dark-mode .nivo-submission-button-secondary {
    background-color: var(--bg-light) !important;
}

body.dark-mode .nivo-submission-button-secondary:hover {
    background-color: var(--border-secondary) !important;
}

body.dark-mode .nivo-submission-note {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-submission-note a {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-submission-note a:hover {
    color: #ffffff !important;
}

/* Sections Information */
body.dark-mode .nivo-section-item {
    background: var(--bg-tertiary) !important;
    border-left-color: var(--primary-color) !important;
}

body.dark-mode .nivo-section-item:hover {
    background: var(--bg-light) !important;
}

body.dark-mode .nivo-section-title {
    color: #ffffff !important;
}

body.dark-mode .nivo-section-policy {
    color: var(--text-secondary) !important;
}

/* Content Section Headers */
body.dark-mode .nivo-author-guidelines h2,
body.dark-mode .nivo-submission-checklist h2,
body.dark-mode .nivo-copyright-notice h2,
body.dark-mode .nivo-privacy-statement h2 {
    color: #ffffff !important;
    border-bottom-color: var(--primary-color) !important;
}

/* ========================================
   LOGIN & REGISTER PAGES - DARK MODE
   ======================================== */

/* CRITICAL: Auth box container */
body.dark-mode .nivo-auth-box {
    background: var(--bg-secondary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .nivo-auth-box-wide {
    background: var(--bg-secondary) !important;
}

body.dark-mode .nivo-auth-title {
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-auth-description {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-auth-links a {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-auth-links a:hover {
    color: var(--primary-color) !important;
    opacity: 0.8 !important;
}

body.dark-mode .nivo-error-message {
    background-color: rgba(255, 107, 107, 0.1) !important;
    border-color: #ff6b6b !important;
    color: #ff6b6b !important;
}

body.dark-mode .nivo-success-message {
    background-color: rgba(81, 207, 102, 0.1) !important;
    border-color: #51cf66 !important;
    color: #51cf66 !important;
}

/* Form containers */
body.dark-mode .pkp_form,
body.dark-mode form.pkp_form,
body.dark-mode .login,
body.dark-mode .register {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

/* Form sections/fieldsets */
body.dark-mode fieldset,
body.dark-mode .fields {
    background: transparent !important;
    border-color: var(--border-primary) !important;
}

body.dark-mode legend {
    color: var(--text-primary) !important;
}

/* All input types */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="url"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="search"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode textarea,
body.dark-mode select {
    background: var(--bg-light) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-secondary) !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--text-tertiary) !important;
    opacity: 1 !important;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    background: var(--bg-tertiary) !important;
    border-color: var(--primary-color) !important;
    outline: none !important;
}

/* Checkboxes and radio buttons */
body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
    background: var(--bg-light) !important;
    border: 1px solid var(--border-secondary) !important;
}

body.dark-mode input[type="checkbox"]:checked,
body.dark-mode input[type="radio"]:checked {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Labels */
body.dark-mode label,
body.dark-mode .label {
    color: var(--text-primary) !important;
}

/* Required field marker */
body.dark-mode .required,
body.dark-mode .req {
    color: #ff6b6b !important;
}

/* Form description text */
body.dark-mode .description,
body.dark-mode .help,
body.dark-mode small {
    color: var(--text-tertiary) !important;
}

/* Submit buttons - CRITICAL for readability */
body.dark-mode button,
body.dark-mode input[type="submit"],
body.dark-mode input[type="button"],
body.dark-mode .btn,
body.dark-mode .button,
body.dark-mode .pkp_button {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: 1px solid var(--primary-color) !important;
}

body.dark-mode button:hover,
body.dark-mode input[type="submit"]:hover,
body.dark-mode input[type="button"]:hover,
body.dark-mode .btn:hover,
body.dark-mode .button:hover,
body.dark-mode .pkp_button:hover {
    background: var(--primary-color) !important;
    opacity: 0.9 !important;
    color: #ffffff !important;
}

/* Cancel/secondary buttons */
body.dark-mode .cancel,
body.dark-mode .btn-secondary,
body.dark-mode button[type="button"] {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-secondary) !important;
}

body.dark-mode .cancel:hover,
body.dark-mode .btn-secondary:hover {
    background: var(--bg-light) !important;
}

/* Form errors */
body.dark-mode .error,
body.dark-mode .pkp_form_error,
body.dark-mode .errorMessage {
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1) !important;
    border-color: #ff6b6b !important;
}

/* Form success messages */
body.dark-mode .success,
body.dark-mode .pkp_form_success {
    color: #51cf66 !important;
    background: rgba(81, 207, 102, 0.1) !important;
    border-color: #51cf66 !important;
}

/* Links in forms */
body.dark-mode form a,
body.dark-mode .pkp_form a {
    color: var(--primary-color) !important;
}

body.dark-mode form a:hover,
body.dark-mode .pkp_form a:hover {
    color: var(--primary-color) !important;
    opacity: 0.8 !important;
}

/* Specific OJS login/register elements */
body.dark-mode .pkp_controllers_grid,
body.dark-mode .pkp_linkActions {
    background: transparent !important;
}

body.dark-mode .pkp_helpers_align_left,
body.dark-mode .pkp_helpers_align_right {
    color: var(--text-primary) !important;
}

/* Remember me checkbox label */
body.dark-mode .remember label {
    color: var(--text-primary) !important;
}

/* Dividers in forms */
body.dark-mode hr {
    border-color: var(--border-primary) !important;
}

/* ========================================
   REGISTRATION COMPLETE - DARK MODE
   ======================================== */

body.dark-mode .nivo-register-complete-links li a {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-register-complete-links li a:hover {
    background: var(--bg-light) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* Message box - for registration complete, etc */
body.dark-mode .nivo-message-box {
    background: var(--bg-secondary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .nivo-message-title {
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-message-content {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-success-box {
    background: var(--bg-secondary) !important;
}

/* ===== ANNOUNCEMENTS PAGES (Dark Mode) ===== */

/* Announcements List Page */
body.dark-mode .nivo-announcement-item-page {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .nivo-announcement-title-page a {
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-announcement-title-page a:hover {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-announcement-meta {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-announcement-description {
    color: var(--text-secondary) !important;
}

/* Announcement Detail Page */
body.dark-mode .nivo-announcement-detail {
    background: var(--bg-secondary) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}

body.dark-mode .nivo-announcement-content {
    color: var(--text-secondary) !important;
}

body.dark-mode .nivo-back-link {
    border-top-color: var(--border-color) !important;
}

body.dark-mode .nivo-back-link a {
    color: var(--text-primary) !important;
}

body.dark-mode .nivo-back-link a:hover {
    color: var(--primary-color) !important;
}

/* ===== TABLE STYLES (Dark Mode) ===== */

body.dark-mode table {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode thead {
    background: var(--bg-tertiary) !important;
    border-bottom-color: var(--border-color) !important;
}

body.dark-mode thead tr {
    background: var(--bg-tertiary) !important;
}

body.dark-mode thead th {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode tbody tr {
    border-bottom-color: var(--border-color) !important;
}

body.dark-mode tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02) !important;
}

body.dark-mode tbody tr:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode tbody td {
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

body.dark-mode tbody td strong {
    color: var(--text-primary) !important;
}



/* ===== SECTION SUBMIT BUTTON (Dark Mode) ===== */

body.dark-mode .nivo-btn-primary {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

body.dark-mode .nivo-btn-primary:hover {
    background-color: var(--primary-color-dark) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}


/* ===== SUBMISSION PAGE LINKS AS BUTTONS (Dark Mode) ===== */

body.dark-mode .nivo-link {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

body.dark-mode .nivo-link:hover {
    background-color: var(--primary-color-dark) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

body.dark-mode .nivo-btn-primary {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

body.dark-mode .nivo-btn-primary:hover {
    background-color: var(--primary-color-dark) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

body.dark-mode .nivo-checklist-icon {
    color: var(--primary-color) !important;
}

body.dark-mode .nivo-checklist li {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* ===== HEADER SUBMISSION BUTTON (Dark Mode) ===== */

body.dark-mode .nivo-submit-btn {
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

body.dark-mode .nivo-submit-btn:hover {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

body.dark-mode .pkp_navigation_primary_row a[href*="submission"] {
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

body.dark-mode .pkp_navigation_primary_row a[href*="submission"]:hover {
    border-color: rgba(255, 255, 255, 0.5) !important;
}


/* ===== SEARCH RESULTS PAGE (Dark Mode) ===== */

/* Search Result Cards - Stronger specificity */
html body.dark-mode .nivo-search-result {
    background-color: #2d2d2d !important;
    background: #2d2d2d !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html body.dark-mode .nivo-search-result:hover {
    background-color: #353535 !important;
    background: #353535 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Search Result Title Links - Must be white! */
html body.dark-mode .nivo-result-title a {
    color: #ffffff !important;
}

html body.dark-mode .nivo-result-title a:hover {
    color: var(--primary-color) !important;
}

/* Search Result Authors */
html body.dark-mode .nivo-result-authors {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Search Result Abstract */
html body.dark-mode .nivo-result-abstract {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* No Results Message */
html body.dark-mode .nivo-no-results {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Search Form Input */
html body.dark-mode .nivo-search-form input {
    background-color: #2d2d2d !important;
    background: #2d2d2d !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

html body.dark-mode .nivo-search-form input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Search Submit Button */
html body.dark-mode .nivo-search-submit {
    background-color: var(--primary-color) !important;
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

html body.dark-mode .nivo-search-submit:hover {
    border-color: rgba(255, 255, 255, 0.5) !important;
}


/* ===== REGISTRATION PAGE SECTIONS (Dark Mode) ===== */

body.dark-mode .nivo-form-section {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

body.dark-mode .nivo-section-title {
    color: #ffffff !important;
}

body.dark-mode .nivo-auth-footer {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .nivo-auth-footer p {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.dark-mode .nivo-auth-footer a {
    color: var(--primary-color) !important;
}

body.dark-mode legend.nivo-section-title {
    padding: 0 !important;
    margin-left: 0 !important;
}

/* Dark mode: Nested checklist icons */
html.dark-mode .nivo-checklist-text ul li::before,
html.dark-mode .nivo-checklist-text ol li::before,
html.dark-mode .nivo-checklist-text .axis-checklist li::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 12L11 14L15 10' stroke='%2322c55e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='10' stroke='%2322c55e' stroke-width='2'/%3E%3C/svg%3E");
}