/* ============================================
   CSS VARIABLES & THEMING
   ============================================ */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-dimmed: rgba(33, 37, 41, 0.2);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.1);
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --highlight-bg: #fef3c7;
    --highlight-border: #f59e0b;
    --success: #10b981;
    --error: #ef4444;
}

[data-theme="sepia"] {
    --bg-primary: #f5f0e1;
    --bg-secondary: #ebe4d3;
    --bg-tertiary: #ddd5c3;
    --text-primary: #433422;
    --text-secondary: #6b5a45;
    --text-dimmed: rgba(67, 52, 34, 0.2);
    --border: #c9bea8;
    --highlight-bg: #fff8dc;
    --highlight-border: #b8860b;
}

[data-theme="dark"] {
    --bg-primary: #1e1e2e;
    --bg-secondary: #181825;
    --bg-tertiary: #313244;
    --text-primary: #cdd6f4;
    --text-secondary: #a6adc8;
    --text-dimmed: rgba(205, 214, 244, 0.15);
    --accent: #89b4fa;
    --accent-hover: #74a8f7;
    --accent-light: rgba(137, 180, 250, 0.15);
    --border: #45475a;
    --shadow: rgba(0, 0, 0, 0.4);
    --highlight-bg: rgba(250, 204, 21, 0.15);
    --highlight-border: #f9e2af;
}

[data-theme="contrast"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-dimmed: rgba(255, 255, 255, 0.15);
    --accent: #00ff88;
    --accent-hover: #00cc6a;
    --accent-light: rgba(0, 255, 136, 0.15);
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.6);
    --highlight-bg: rgba(0, 255, 136, 0.2);
    --highlight-border: #00ff88;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lexend', system-ui, -apple-system, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   NAVIGATION
   ============================================ */
.main-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    padding: 15px 0;
}

.nav-tabs {
    display: flex;
    gap: 5px;
}

.nav-tab {
    padding: 15px 20px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================
   MAIN CONTENT & VIEWS
   ============================================ */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* ============================================
   LIBRARY VIEW
   ============================================ */
.library-header {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.search-box input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.icon-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

/* Topics */
.topics-section {
    margin-bottom: 40px;
}

.topics-section h3,
.books-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topic-chip {
    padding: 10px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-chip:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.book-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow);
}

.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.book-cover-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, var(--accent-light), var(--bg-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.book-card-info {
    padding: 15px;
}

.book-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.loading-indicator {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   PASTE TEXT VIEW
   ============================================ */
.paste-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
}

.paste-container h2 {
    margin-bottom: 20px;
}

.input-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    background: transparent;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn:hover {
    border-color: var(--accent);
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#text-input {
    width: 100%;
    min-height: 250px;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#text-input:focus {
    outline: none;
    border-color: var(--accent);
}

.upload-zone {
    border: 3px dashed var(--border);
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.supported-formats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.file-name {
    text-align: center;
    margin-top: 15px;
    color: var(--accent);
    font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.primary-btn {
    width: 100%;
    padding: 16px 30px;
    margin-top: 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.primary-btn:hover {
    background: var(--accent-hover);
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.secondary-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================
   READER VIEW
   ============================================ */
#reader-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 200;
    display: flex;
    flex-direction: column;
}

#reader-view.hidden {
    display: none !important;
}

#reader-view.active {
    display: flex !important;
}

.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.toolbar-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    font-family: inherit;
}

.toolbar-btn:hover {
    background: var(--bg-tertiary);
}

.book-title {
    font-weight: 600;
    font-size: 1rem;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Feature Bar */
.feature-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    justify-content: center;
}

.feature-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.toggle-btn {
    padding: 5px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: var(--text-secondary);
}

.toggle-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Reader Content */
.reader-container {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
}

.reader-content {
    max-width: 700px;
    margin: 0 auto;
    font-size: 20px;
    line-height: 2;
    letter-spacing: 0.5px;
    word-spacing: 3px;
    outline: none;
}

/* Reading Lines */
.reading-line {
    padding: 10px 20px;
    margin: 5px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 4px solid transparent;
}

.reading-line:hover {
    background: var(--bg-secondary);
}

/* Focus Mode */
.reader-content.focus-mode .reading-line {
    color: var(--text-dimmed);
}

.reader-content.focus-mode .reading-line.active {
    color: var(--text-primary);
    background: var(--highlight-bg);
    border-left-color: var(--highlight-border);
    box-shadow: 0 2px 12px var(--shadow);
}

.reader-content.focus-mode .reading-line.adjacent {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Bionic Reading */
.bionic-bold {
    font-weight: 700;
}

/* BeeLine Colors */
.reader-content.beeline-mode .reading-line {
    background: linear-gradient(90deg, transparent 0%, transparent 100%);
}

/* BeeLine color schemes */
[data-beeline="blue-red"] .reading-line:nth-child(4n+1) { color: #2563eb; }
[data-beeline="blue-red"] .reading-line:nth-child(4n+2) { color: #7c3aed; }
[data-beeline="blue-red"] .reading-line:nth-child(4n+3) { color: #db2777; }
[data-beeline="blue-red"] .reading-line:nth-child(4n+4) { color: #dc2626; }

[data-beeline="green-purple"] .reading-line:nth-child(4n+1) { color: #059669; }
[data-beeline="green-purple"] .reading-line:nth-child(4n+2) { color: #0891b2; }
[data-beeline="green-purple"] .reading-line:nth-child(4n+3) { color: #6366f1; }
[data-beeline="green-purple"] .reading-line:nth-child(4n+4) { color: #9333ea; }

[data-beeline="orange-blue"] .reading-line:nth-child(4n+1) { color: #ea580c; }
[data-beeline="orange-blue"] .reading-line:nth-child(4n+2) { color: #ca8a04; }
[data-beeline="orange-blue"] .reading-line:nth-child(4n+3) { color: #0d9488; }
[data-beeline="orange-blue"] .reading-line:nth-child(4n+4) { color: #2563eb; }

[data-beeline="grayscale"] .reading-line:nth-child(4n+1) { color: #1f2937; }
[data-beeline="grayscale"] .reading-line:nth-child(4n+2) { color: #4b5563; }
[data-beeline="grayscale"] .reading-line:nth-child(4n+3) { color: #6b7280; }
[data-beeline="grayscale"] .reading-line:nth-child(4n+4) { color: #374151; }

/* Override beeline colors in focus mode for active line */
.reader-content.focus-mode.beeline-mode .reading-line.active {
    color: var(--text-primary) !important;
}

/* Reading Ruler */
.reading-ruler {
    position: fixed;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(
        to bottom,
        rgba(99, 102, 241, 0.03) 0%,
        rgba(99, 102, 241, 0.08) 45%,
        rgba(99, 102, 241, 0.08) 55%,
        rgba(99, 102, 241, 0.03) 100%
    );
    border-top: 2px solid rgba(99, 102, 241, 0.3);
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    pointer-events: none;
    z-index: 50;
    transition: top 0.05s ease;
}

/* TTS Word Highlight */
.tts-highlight {
    background: var(--accent-light);
    border-radius: 3px;
    padding: 0 2px;
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.keyboard-hint {
    opacity: 0.7;
}

/* ============================================
   RSVP MODE
   ============================================ */
.rsvp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsvp-container {
    text-align: center;
    padding: 40px;
    max-width: 600px;
    width: 100%;
}

.rsvp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.rsvp-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.rsvp-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

#rsvp-wpm {
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 120px;
}

.rsvp-word-container {
    position: relative;
    padding: 60px 0;
    margin-bottom: 40px;
}

.rsvp-focus-line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 100px;
    background: var(--accent);
    opacity: 0.3;
}

.rsvp-word {
    font-size: 3.5rem;
    font-weight: 600;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsvp-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.rsvp-buttons .primary-btn,
.rsvp-buttons .secondary-btn {
    width: auto;
    margin: 0;
    padding: 14px 30px;
}

.rsvp-progress {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.rsvp-progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.1s;
}

/* ============================================
   TTS CONTROLS
   ============================================ */
.tts-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}

.tts-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tts-btn:hover {
    background: var(--accent-light);
}

.tts-btn.tts-play {
    width: 55px;
    height: 55px;
    background: var(--accent);
    color: white;
}

.tts-speed {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.tts-speed input {
    width: 100px;
}

/* ============================================
   AUTO-SCROLL CONTROLS
   ============================================ */
.autoscroll-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}

.as-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.as-btn:hover {
    border-color: var(--accent);
}

#autoscroll-speed {
    min-width: 100px;
    text-align: center;
    font-weight: 500;
}

/* ============================================
   SETTINGS PANEL
   ============================================ */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    bottom: 0;
    width: 380px;
    max-width: 100%;
    background: var(--bg-primary);
    box-shadow: -4px 0 25px var(--shadow);
    z-index: 400;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.close-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.slider-row span {
    min-width: 55px;
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.theme-btn {
    padding: 12px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-btn:hover {
    border-color: var(--accent);
}

.theme-btn.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.theme-swatch {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.light-swatch { background: #ffffff; }
.sepia-swatch { background: #f5f0e1; }
.dark-swatch { background: #1e1e2e; }
.contrast-swatch { background: #000000; border-color: #00ff88; }

select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.settings-footer .secondary-btn {
    width: 100%;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 1;
}

.modal-body {
    padding: 30px;
}

.book-preview {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.modal-cover {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.book-info {
    flex: 1;
}

#modal-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.modal-author {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.modal-subjects {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-downloads {
    font-size: 0.85rem;
    color: var(--accent);
}

.modal-actions .primary-btn {
    margin-top: 0;
}

.modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-radius: 16px;
}

/* ============================================
   READING LIST
   ============================================ */
.reading-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reading-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.reading-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--shadow);
}

.reading-item-cover {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.reading-item-info {
    flex: 1;
}

.reading-item-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.reading-item-progress {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        padding: 10px;
    }

    .nav-tabs {
        width: 100%;
        justify-content: center;
    }

    .nav-tab {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .feature-bar {
        gap: 10px;
        padding: 10px;
    }

    .feature-toggle span {
        display: none;
    }

    .book-preview {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rsvp-word {
        font-size: 2.5rem;
    }

    .keyboard-hint {
        display: none;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   FOCUS STYLES
   ============================================ */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
