/* ============================================================
   Geez Online v5 - Material Design + Water Blue + Dark Mode
   ============================================================ */

/* ===== CSS Variables - Light Mode (Water Blue) ===== */
:root {
    /* Primary - Water Blue */
    --color-primary: #0284c7;
    --color-primary-hover: #0369a1;
    --color-primary-light: #e0f2fe;
    --color-primary-dark: #075985;
    --color-accent: #06b6d4;
    --color-accent-light: #cffafe;

    /* Backgrounds */
    --color-bg: #f0f9ff;
    --color-bg-alt: #ffffff;
    --color-surface: #ffffff;
    --color-surface-hover: #f8fafc;
    --color-surface-2: #f1f5f9;

    /* Text */
    --color-text: #0f172a;
    --color-text-muted: #475569;
    --color-text-light: #64748b;

    /* Borders */
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;

    /* Status */
    --color-success: #10b981;
    --color-success-bg: #d1fae5;
    --color-warning: #f59e0b;
    --color-warning-bg: #fef3c7;
    --color-danger: #ef4444;
    --color-danger-bg: #fee2e2;
    --color-info: #3b82f6;
    --color-info-bg: #dbeafe;

    /* Navbar/Footer */
    --color-navbar: #0c4a6e;
    --color-navbar-2: #0284c7;
    --color-footer: #0c4a6e;

    /* Shadows - Material Design elevations */
    --shadow-1: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-2: 0 3px 6px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-3: 0 10px 20px rgba(15, 23, 42, 0.08), 0 3px 6px rgba(15, 23, 42, 0.04);
    --shadow-4: 0 14px 28px rgba(15, 23, 42, 0.12), 0 10px 10px rgba(15, 23, 42, 0.04);
    --shadow-5: 0 20px 40px rgba(15, 23, 42, 0.15);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
    --color-primary: #38bdf8;
    --color-primary-hover: #7dd3fc;
    --color-primary-light: #0c4a6e;
    --color-primary-dark: #075985;
    --color-accent: #22d3ee;
    --color-accent-light: #164e63;

    --color-bg: #0f172a;
    --color-bg-alt: #1e293b;
    --color-surface: #1e293b;
    --color-surface-hover: #334155;
    --color-surface-2: #334155;

    --color-text: #f1f5f9;
    --color-text-muted: #cbd5e1;
    --color-text-light: #94a3b8;

    --color-border: #334155;
    --color-border-strong: #475569;

    --color-success: #34d399;
    --color-success-bg: #064e3b;
    --color-warning: #fbbf24;
    --color-warning-bg: #78350f;
    --color-danger: #f87171;
    --color-danger-bg: #7f1d1d;
    --color-info: #60a5fa;
    --color-info-bg: #1e3a8a;

    --color-navbar: #0c4a6e;
    --color-navbar-2: #075985;
    --color-footer: #020617;

    --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 3px 6px rgba(0, 0, 0, 0.35);
    --shadow-3: 0 10px 20px rgba(0, 0, 0, 0.4);
    --shadow-4: 0 14px 28px rgba(0, 0, 0, 0.5);
    --shadow-5: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ===== Material App Bar (Navbar) ===== */
.app-bar {
    background: linear-gradient(135deg, var(--color-navbar) 0%, var(--color-navbar-2) 100%);
    color: #fff;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-3);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.app-bar .brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-bar .brand:hover { opacity: 0.95; color: #fff; }

.app-bar nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.app-bar nav a {
    color: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.app-bar nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.app-bar nav a.active {
    background-color: rgba(255, 255, 255, 0.25);
}

.app-bar nav a.cta {
    background-color: var(--color-accent);
    color: #fff;
    font-weight: 700;
}

.app-bar nav a.cta:hover {
    background-color: var(--color-primary);
}

/* Theme toggle in navbar */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    transition: background-color 0.2s;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

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

/* ===== Material Cards ===== */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-3);
    transform: translateY(-2px);
}

.card-elevated {
    box-shadow: var(--shadow-3);
}

.card-body { padding: 1.5rem; }
.card-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--color-text); }
.card-subtitle { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.card-text { color: var(--color-text-muted); line-height: 1.6; }

/* ===== Material Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    box-shadow: var(--shadow-2);
    color: #fff;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--color-accent);
    color: #fff;
}
.btn-secondary:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-outline:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-text);
}
.btn-ghost:hover {
    background-color: var(--color-surface-hover);
}

.btn-danger {
    background-color: var(--color-danger);
    color: #fff;
}
.btn-danger:hover {
    background-color: #dc2626;
    color: #fff;
}

.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* FAB - Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-3);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 100;
    transition: all 0.2s;
}
.fab:hover {
    background-color: var(--color-primary-hover);
    box-shadow: var(--shadow-5);
    transform: scale(1.05);
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--color-navbar) 0%, var(--color-navbar-2) 100%);
    color: #fff;
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: 'ግዕዝ';
    position: absolute;
    top: 50%;
    right: -3rem;
    transform: translateY(-50%);
    font-size: 22rem;
    color: rgba(255, 255, 255, 0.04);
    font-family: 'Noto Sans Ethiopic', serif;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1.15rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Sections ===== */
.section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-tight { padding: 2rem; }

.section-title {
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-align: center;
}

.section-subtitle {
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

/* ===== Grid Layouts ===== */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ===== Feature Cards ===== */
.feature-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    height: 100%;
}

.feature-card:hover {
    box-shadow: var(--shadow-3);
    transform: translateY(-4px);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}

.feature-card h3 {
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    text-align: center;
    border-top: 3px solid var(--color-primary);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="date"],
input[type="file"], textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

textarea { resize: vertical; min-height: 120px; }

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== Tables ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}

.table th {
    background-color: var(--color-primary);
    color: #fff;
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.table tr:hover td {
    background-color: var(--color-surface-hover);
}

/* ===== Badges & Chips ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background-color: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background-color: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background-color: var(--color-danger-bg); color: var(--color-danger); }
.badge-info { background-color: var(--color-info-bg); color: var(--color-info); }
.badge-neutral { background-color: var(--color-surface-2); color: var(--color-text-muted); }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0.2rem;
}

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success { background-color: var(--color-success-bg); color: var(--color-success); }
.alert-warning { background-color: var(--color-warning-bg); color: var(--color-warning); }
.alert-danger { background-color: var(--color-danger-bg); color: var(--color-danger); }
.alert-info { background-color: var(--color-info-bg); color: var(--color-info); }

/* ===== Tools Layout ===== */
.tool-container {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    padding: 2rem;
    margin: 2rem 0;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ===== Transliterator Specifics ===== */
.translit-mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background-color: var(--color-surface-2);
    padding: 0.4rem;
    border-radius: var(--radius-full);
    width: fit-content;
}

.translit-mode-tab {
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: all 0.2s;
    font-family: inherit;
}

.translit-mode-tab.active {
    background-color: var(--color-primary);
    color: #fff;
}

.translit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.translit-input-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    font-weight: 600;
}

.copy-btn {
    background-color: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    font-family: inherit;
}

.copy-btn:hover {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.translit-output {
    background-color: var(--color-surface-2);
    padding: 1rem;
    border-radius: var(--radius-md);
    min-height: 120px;
    font-family: 'Noto Sans Ethiopic', 'Nyala', serif;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--color-text);
    word-break: break-word;
}

/* ===== Calculator ===== */
.calc-display {
    background-color: var(--color-navbar);
    color: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-size: 2rem;
    text-align: right;
    margin-bottom: 1rem;
    font-family: 'Consolas', monospace;
    min-height: 80px;
    overflow: hidden;
    word-break: break-all;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.calc-btn {
    padding: 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    background-color: var(--color-surface-2);
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    font-weight: 500;
}

.calc-btn:hover { background-color: var(--color-border-strong); }
.calc-btn:active { transform: scale(0.96); }

.calc-btn.operator {
    background-color: var(--color-primary);
    color: #fff;
}
.calc-btn.operator:hover { background-color: var(--color-primary-hover); }

.calc-btn.equals {
    background-color: var(--color-accent);
    color: #fff;
    grid-column: span 2;
}
.calc-btn.equals:hover { background-color: var(--color-primary); }

.calc-btn.clear {
    background-color: var(--color-danger);
    color: #fff;
}

.calc-btn.wide {
    grid-column: span 2;
}

/* ===== Article / Manuscript / Gallery Cards ===== */
.content-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content-card:hover {
    box-shadow: var(--shadow-4);
    transform: translateY(-4px);
}

.content-card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--color-primary);
    overflow: hidden;
}

.content-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.content-card-meta {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.content-card-excerpt {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.content-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

/* ===== Article Reading View ===== */
.article-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.article-view h1 {
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
    line-height: 1.3;
}

.article-meta {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.article-content {
    line-height: 1.8;
    color: var(--color-text);
}

.article-content h2 {
    color: var(--color-primary);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.article-content h3 {
    color: var(--color-primary-hover);
    margin: 1.5rem 0 0.75rem;
    font-size: 1.2rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content img {
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
}

.article-content blockquote {
    border-left: 4px solid var(--color-primary);
    background-color: var(--color-primary-light);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--color-text);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background-color: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    border: 1px solid var(--color-border);
    font-weight: 500;
}

.pagination a:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
}

.pagination .current {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, var(--color-footer) 0%, var(--color-navbar-2) 100%);
    color: #fff;
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* ===== Loading ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border-strong);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .app-bar {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .app-bar nav {
        justify-content: center;
        flex-wrap: wrap;
        font-size: 0.85rem;
    }

    .app-bar nav a {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .section {
        padding: 2rem 1rem;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .translit-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .calc-grid {
        gap: 0.3rem;
    }

    .calc-btn {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ===== Article Dark Mode Fixes ===== */
/* These overrides ensure article blockquotes, tables, and inline-styled elements
   render with proper dark mode colors, even when the article content uses
   hardcoded light-mode colors via inline styles. */

/* Blockquotes with inline light-mode backgrounds */
[data-theme="dark"] .article-content blockquote,
[data-theme="dark"] .article-view blockquote,
[data-theme="dark"] article blockquote {
    background-color: rgba(56, 189, 248, 0.12) !important;
    border-left-color: #38bdf8 !important;
    color: #e8eaed !important;
}
[data-theme="dark"] .article-content blockquote p,
[data-theme="dark"] .article-view blockquote p,
[data-theme="dark"] article blockquote p {
    color: #e8eaed !important;
}
[data-theme="dark"] .article-content blockquote p[style*="color"],
[data-theme="dark"] .article-view blockquote p[style*="color"],
[data-theme="dark"] article blockquote p[style*="color"] {
    color: #b0b8c4 !important;
}

/* Tables with inline light-mode backgrounds */
[data-theme="dark"] .article-content table thead,
[data-theme="dark"] .article-view table thead,
[data-theme="dark"] article table thead,
[data-theme="dark"] .article-content table tr[style*="background"],
[data-theme="dark"] .article-view table tr[style*="background"],
[data-theme="dark"] article table tr[style*="background"] {
    background-color: rgba(56, 189, 248, 0.15) !important;
}
[data-theme="dark"] .article-content table th,
[data-theme="dark"] .article-view table th,
[data-theme="dark"] article table th {
    background-color: rgba(56, 189, 248, 0.15) !important;
    color: #e8eaed !important;
    border-color: #2a3340 !important;
}
[data-theme="dark"] .article-content table td,
[data-theme="dark"] .article-view table td,
[data-theme="dark"] article table td {
    border-color: #2a3340 !important;
    color: #e8eaed !important;
}
[data-theme="dark"] .article-content table tbody tr:nth-child(even),
[data-theme="dark"] .article-view table tbody tr:nth-child(even),
[data-theme="dark"] article table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Horizontal rules */
[data-theme="dark"] .article-content hr,
[data-theme="dark"] .article-view hr,
[data-theme="dark"] article hr {
    border-top-color: #2a3340 !important;
}

/* Strong text and links in articles */
[data-theme="dark"] .article-content strong,
[data-theme="dark"] .article-view strong,
[data-theme="dark"] article strong {
    color: #e8eaed !important;
}
[data-theme="dark"] .article-content a,
[data-theme="dark"] .article-view a,
[data-theme="dark"] article a {
    color: #5eb8e8 !important;
}
[data-theme="dark"] .article-content a:hover,
[data-theme="dark"] .article-view a:hover,
[data-theme="dark"] article a:hover {
    color: #7dd3fc !important;
}

/* Article body text — ensure readable in dark mode */
[data-theme="dark"] .article-content,
[data-theme="dark"] .article-view,
[data-theme="dark"] .article-content p,
[data-theme="dark"] .article-view p,
[data-theme="dark"] .article-content li,
[data-theme="dark"] .article-view li {
    color: #e8eaed !important;
}

/* Footnotes section */
[data-theme="dark"] .article-content p[id^="fn"],
[data-theme="dark"] .article-view p[id^="fn"] {
    color: #b0b8c4 !important;
}

/* ===== FAQ Dark Mode Fixes ===== */
/* The FAQ uses inline styles in index.html and faq.php with hardcoded light-mode
   colors. These overrides ensure proper dark mode rendering for FAQ items. */

[data-theme="dark"] .faq-item {
    background: #1e2530 !important;
    border-color: #2a3340 !important;
    color: #e8eaed !important;
}

[data-theme="dark"] .faq-question {
    color: #e8eaed !important;
    background-color: transparent !important;
}

[data-theme="dark"] .faq-question:hover {
    background-color: rgba(56, 189, 248, 0.10) !important;
}

[data-theme="dark"] .faq-icon {
    color: #38bdf8 !important;
}

[data-theme="dark"] .faq-answer {
    background-color: transparent !important;
}

[data-theme="dark"] .faq-answer::-webkit-scrollbar-track {
    background: transparent !important;
}

[data-theme="dark"] .faq-answer::-webkit-scrollbar-thumb {
    background: #38bdf8 !important;
}

[data-theme="dark"] .faq-answer-inner {
    background-color: transparent !important;
}

[data-theme="dark"] .faq-answer-inner p,
[data-theme="dark"] .faq-answer-inner li {
    color: #b0b8c4 !important;
}

[data-theme="dark"] .faq-answer-inner strong {
    color: #e8eaed !important;
}

[data-theme="dark"] .faq-answer-inner em {
    color: #d1d5db !important;
}

[data-theme="dark"] .faq-answer-inner a,
[data-theme="dark"] .faq-item a {
    color: #5eb8e8 !important;
}

[data-theme="dark"] .faq-answer-inner a:hover,
[data-theme="dark"] .faq-item a:hover {
    color: #7dd3fc !important;
}

/* FAQ section heading and subtitle (in case they have inline styles) */
[data-theme="dark"] .section-title,
[data-theme="dark"] .section-subtitle {
    color: #e8eaed !important;
}

/* Blockquote inside FAQ (e.g., 1 Enoch passages) */
[data-theme="dark"] .faq-answer-inner blockquote,
[data-theme="dark"] .faq-item blockquote {
    background-color: rgba(56, 189, 248, 0.12) !important;
    border-left-color: #38bdf8 !important;
    color: #e8eaed !important;
}

[data-theme="dark"] .faq-answer-inner blockquote p {
    color: #e8eaed !important;
}

/* Table inside FAQ (e.g., comparative canon table) */
[data-theme="dark"] .faq-answer-inner table thead,
[data-theme="dark"] .faq-item table thead,
[data-theme="dark"] .faq-answer-inner table tr[style*="background"],
[data-theme="dark"] .faq-item table tr[style*="background"] {
    background-color: rgba(56, 189, 248, 0.15) !important;
}

[data-theme="dark"] .faq-answer-inner table th,
[data-theme="dark"] .faq-item table th {
    background-color: rgba(56, 189, 248, 0.15) !important;
    color: #e8eaed !important;
    border-color: #2a3340 !important;
}

[data-theme="dark"] .faq-answer-inner table td,
[data-theme="dark"] .faq-item table td {
    border-color: #2a3340 !important;
    color: #e8eaed !important;
}

[data-theme="dark"] .faq-answer-inner table tbody tr:nth-child(even),
[data-theme="dark"] .faq-item table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Code blocks inside FAQ (e.g., transliteration examples) */
[data-theme="dark"] .faq-answer-inner code,
[data-theme="dark"] .faq-item code {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #fbd38d !important;
    padding: 0.1rem 0.3rem !important;
    border-radius: 3px !important;
}

