/* ==========================================================================
   CSS Design System & Stylesheet for AetherRead Web Novel Reader
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.2);

    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --max-content-width: 720px;
    --reader-font-size: 18px;

    /* Default Theme (Dark Mode) */
    --bg-primary: #0b0f19;
    --bg-secondary: rgba(18, 24, 38, 0.8);
    --bg-card: #131b2e;
    --bg-panel: rgba(22, 30, 49, 0.95);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(255, 255, 255, 0.08);
    --accent-color: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --accent-glow: rgba(59, 130, 246, 0.35);

    --header-bg: rgba(11, 15, 25, 0.75);
    --footer-bg: rgba(11, 15, 25, 0.9);
}

/* Theme Mappings */
body.theme-light {
    --bg-primary: #f7f9fc;
    --bg-secondary: rgba(255, 255, 255, 0.8);
    --bg-card: #ffffff;
    --bg-panel: rgba(255, 255, 255, 0.96);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.08);
    --accent-color: #2563eb;
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --accent-glow: rgba(37, 99, 235, 0.15);
    --header-bg: rgba(247, 249, 252, 0.85);
    --footer-bg: rgba(247, 249, 252, 0.95);
}

body.theme-sepia {
    --bg-primary: #f4edd8;
    --bg-secondary: rgba(24cfb9, 236, 213, 0.8);
    --bg-card: #FAF4E5;
    --bg-panel: rgba(246, 238, 220, 0.98);
    --text-primary: #433422;
    --text-secondary: #6e563b;
    --text-muted: #8c7355;
    --border-color: rgba(110, 86, 59, 0.12);
    --accent-color: #b45309;
    --accent-gradient: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    --accent-glow: rgba(180, 83, 9, 0.15);
    --header-bg: rgba(244, 237, 216, 0.85);
    --footer-bg: rgba(244, 237, 216, 0.95);
}

body.theme-oled {
    --bg-primary: #000000;
    --bg-secondary: rgba(10, 10, 10, 0.8);
    --bg-card: #0a0a0a;
    --bg-panel: rgba(12, 12, 12, 0.98);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.12);
    --accent-color: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --accent-glow: rgba(59, 130, 246, 0.45);
    --header-bg: rgba(0, 0, 0, 0.8);
    --footer-bg: rgba(0, 0, 0, 0.95);
}

/* Typography Classes */
.font-lora { font-family: 'Lora', Georgia, serif; }
.font-playfair { font-family: 'Playfair Display', serif; }
.font-outfit { font-family: 'Outfit', 'Segoe UI', sans-serif; }

/* Font Size Mapping (dynamically set via custom property) */
.chapter-content {
    font-size: var(--reader-font-size, 18px);
}

/* Reset & Base Elements */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overscroll-behavior-y: contain;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

/* Backdrop Glow Elements */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.12;
    filter: blur(130px);
    transition: opacity var(--transition-medium);
}
.theme-light .bg-glow { opacity: 0.04; }
.theme-sepia .bg-glow { opacity: 0.05; }
.theme-oled .bg-glow { display: none; }

.bg-glow-1 {
    top: -100px;
    right: -100px;
    background: #3b82f6;
}
.bg-glow-2 {
    bottom: -200px;
    left: -200px;
    background: #8b5cf6;
}

/* Core Layout */
.view-container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 24px 60px 24px;
    z-index: 1;
    position: relative;
}

.hidden {
    display: none !important;
}

/* Buttons */
button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition-fast);
}

.icon-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}
.icon-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.text-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.text-btn:hover {
    color: var(--text-primary);
    background: var(--border-color);
}

.nav-btn {
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 14px var(--accent-glow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}
.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--text-muted);
    box-shadow: none;
}

/* Main Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: background-color var(--transition-medium);
}
.header-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.logo-icon {
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
}
.logo-sub {
    color: var(--accent-color);
    font-weight: 400;
}

/* Hero Section */
.dashboard-hero {
    text-align: center;
    margin-bottom: 48px;
    padding: 40px 0;
}
.dashboard-hero h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 2.8rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dashboard-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Sections */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
.section-header h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
}
.badge {
    background: var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}
.sorting-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.sorting-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.sort-select {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sort-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Novels Grid & Cards */
.novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.novel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 260px;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.novel-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}
.novel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-medium);
}
.novel-card:hover::before {
    opacity: 1;
}

.card-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.card-source {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}
.card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.stat-item {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-bookmark-badge {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}
.theme-light .card-bookmark-badge {
    background: rgba(124, 58, 237, 0.06);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.15);
}

.card-bottom {
    margin-top: 24px;
}
.btn-card-action {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover {
    box-shadow: 0 6px 16px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--text-secondary);
    color: var(--bg-primary);
}

/* Loader Spinner */
.loading-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-secondary);
    gap: 16px;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   READER INTERFACE
   ========================================================================== */

#view-reader {
    overscroll-behavior-y: contain;
}

/* Sub-header Navigation Bar */
.reader-nav-bar {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: background-color var(--transition-medium);
}

.reader-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.novel-title-meta {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chapter-title-meta {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.reader-header-actions .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
}
.icon-btn.active-bookmark {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
}

/* Visual Settings Panel */
.settings-panel {
    position: fixed;
    top: 136px;
    right: 24px;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 101;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideDown var(--transition-fast);
}
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.settings-section h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 700;
}

.theme-options, .size-options, .font-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.theme-options {
    grid-template-columns: repeat(4, 1fr);
}

.theme-opt, .size-opt, .font-opt {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 4px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}
.theme-opt:hover, .size-opt:hover, .font-opt:hover {
    border-color: var(--text-secondary);
}

.theme-opt.active, .size-opt.active, .font-opt.active {
    background: var(--accent-gradient);
    color: #ffffff;
    border-color: transparent;
}

.opt-light { background: #ffffff; color: #1e293b; }
.opt-sepia { background: #f4ecd8; color: #433422; }
.opt-dark { background: #131b2e; color: #f1f5f9; }
.opt-oled { background: #000000; color: #f8fafc; border-color: #334155; }

/* Chapter Text Content */
.reader-content-wrapper {
    max-width: var(--max-content-width);
    margin: 40px auto 120px auto;
    padding: 0 16px;
}

.chapter-content {
    line-height: 1.8;
    letter-spacing: 0.3px;
    transition: font-size var(--transition-fast);
}

/* Clean up parsed HTML formats from scrapers */
.chapter-content h1, .chapter-content h2, .chapter-content h3, .chapter-content h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    line-height: 1.3;
    margin: 36px 0 18px 0;
    color: var(--text-primary);
}
.chapter-content h1 { font-size: 2.2rem; border-bottom: 2px solid var(--border-color); padding-bottom: 8px; }
.chapter-content h2 { font-size: 1.7rem; }
.chapter-content h3 { font-size: 1.4rem; }

.chapter-content p {
    margin-bottom: 24px;
    text-align: justify;
}

.chapter-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-color);
}

.chapter-content div.navigation, .chapter-content .navigation {
    display: none !important; /* Hide scraped navigation menus in chapter HTML */
}

/* Reader Sticky Navigation Footer */
.reader-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-medium);
}

.footer-nav {
    width: 100%;
    max-width: var(--max-content-width);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.footer-nav .nav-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Jump to Chapter Container */
.jump-container {
    position: relative;
}

.jump-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.jump-btn:hover {
    background: var(--border-color);
}

.jump-menu {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: calc(100vw - 32px);
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 102;
    animation: slideUp var(--transition-fast);
}
@keyframes slideUp {
    from { transform: translate(-50%, 10px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.jump-menu-header {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jump-input-row {
    display: flex;
    gap: 8px;
}
.jump-input-row input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    outline: none;
}
.jump-input-row button {
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
}

.jump-chapters-list {
    max-height: min(280px, 35vh);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.jump-chap-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    transition: all var(--transition-fast);
}
.jump-chap-item:hover {
    background: var(--border-color);
    color: var(--text-primary);
}
.jump-chap-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    font-weight: 600;
}

/* Toast Message */
.toast {
    position: fixed;
    bottom: 92px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    z-index: 150;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

/* Responsive adjustments */
@media(max-width: 600px) {
    .view-container {
        padding-top: 80px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .main-header {
        height: 60px;
    }
    .reader-nav-bar {
        top: 60px;
        padding: 0 12px;
    }
    .novel-title-meta {
        max-width: 100px;
    }
    .chapter-title-meta {
        max-width: 110px;
        font-size: 0.8rem;
    }
    .reader-user-badge {
        display: none !important;
    }
    .reader-header-actions {
        gap: 4px;
    }
    .reader-header-actions .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .mode-select {
        padding: 4px 6px !important;
        font-size: 11px !important;
        max-width: 95px;
    }
    .dashboard-hero h1 {
        font-size: 2.2rem;
    }
    .novels-grid {
        grid-template-columns: 1fr;
    }
    .settings-panel {
        width: calc(100% - 32px);
        right: 16px;
        left: 16px;
        top: 120px;
    }
    .footer-nav .nav-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* Settings Slider Controls */
.settings-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    margin-top: 6px;
    margin-bottom: 6px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.control-val {
    min-width: 54px;
    text-align: right;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    transition: transform var(--transition-fast);
}

.settings-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.settings-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: var(--accent-color);
    transition: transform var(--transition-fast);
    cursor: pointer;
}

.settings-slider::-moz-range-thumb:hover {
    transform: scale(1.25);
}

/* Alphabet filters style for AetherRead Reader UI */
.alphabet-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    backdrop-filter: blur(12px);
}

.alphabet-btn {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.alphabet-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.alphabet-btn.active {
    background: var(--accent-gradient);
    color: #ffffff;
    border-color: transparent;
}

/* Authentication and Account Views */
.auth-card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
    box-sizing: border-box;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    transition: transform var(--transition-slow);
}

.auth-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-primary);
}

.auth-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0;
    margin-bottom: 32px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--accent-color);
}

.auth-submit-btn {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-footer {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 24px;
    margin-bottom: 0;
}

.auth-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Password Strength Meter */
.pwd-strength-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.pwd-strength-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.pwd-strength-indicator {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: #ef4444;
    transition: width var(--transition-medium), background var(--transition-medium);
}

.pwd-strength-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.3;
}

/* User Badges in Header */
.user-badge {
    display: inline-flex;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    margin-right: 8px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    line-height: 1.4;
}

/* Settings Logout Layout */
.account-info-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.account-details span {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-all;
}

.settings-logout-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.settings-logout-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: transparent;
}

/* Spinner small */
.spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

/* Verification Card succeeds styles */
.verify-success-icon {
    font-size: 3.5rem;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 24px;
}

.verify-description {
    font-family: 'Outfit', sans-serif;
    font-size: 0.98rem;
    line-height: 1.6;
    text-align: center;
    color: #e2e8f0;
    margin-bottom: 24px;
}

/* Resend Verification Dialog & Info Cards - High Contrast & High Readability */
.resend-box {
    margin-top: 14px;
    margin-bottom: 16px;
    padding: 16px;
    background: #181825;
    border: 1px solid #45475a;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.resend-box-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #f5e0dc;
    margin-bottom: 12px;
    line-height: 1.5;
}

.btn-resend-action {
    display: inline-block;
    width: 100%;
    padding: 11px 16px;
    background: #89b4fa;
    color: #11111b;
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 8px rgba(137, 180, 250, 0.3);
}

.btn-resend-action:hover {
    background: #b4befe;
    color: #11111b;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(180, 190, 254, 0.4);
}

.btn-resend-action:active {
    transform: translateY(0);
}

.resend-status-feedback {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.resend-status-feedback.success {
    background: rgba(166, 227, 161, 0.15);
    border: 1px solid #a6e3a1;
    color: #a6e3a1;
}

.resend-status-feedback.error {
    background: rgba(243, 139, 168, 0.15);
    border: 1px solid #f38ba8;
    color: #f38ba8;
}
}

#btn-verify-back {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

#btn-verify-back:hover {
    background: var(--border-color);
}

/* Floating Selection Dictionary Button */
#floating-dict-btn {
    position: fixed;
    z-index: 10000;
    background: #6200ee;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    gap: 6px;
    transition: transform 0.1s ease, opacity 0.1s ease;
    font-family: 'Outfit', sans-serif;
}

#floating-dict-btn:hover {
    background: #3700b3;
    transform: scale(1.05);
}

#floating-dict-btn::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #6200ee transparent;
    display: block;
    width: 0;
}

/* Dictionary Substitute Highlights */
.dict-highlight {
    color: var(--accent-color, #3b82f6);
    border-bottom: 1.5px dashed var(--accent-color, #3b82f6);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    padding: 0 2px;
    border-radius: 2px;
}

.dict-highlight:hover {
    background: var(--accent-glow, rgba(59, 130, 246, 0.15));
    border-bottom-style: solid;
    text-shadow: 0 0 8px var(--accent-glow, rgba(59, 130, 246, 0.4));
}

/* Page Content Editor */
.edit-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: var(--color-text, #fff);
    background: var(--color-bg-dim, #222);
    border: 1px solid var(--color-border, #444);
    border-radius: 6px;
    box-sizing: border-box;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.edit-textarea:focus {
    border-color: var(--color-primary, #6200ee);
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}
