/* FocusRead - Modern UI Styles */
/* Redesigned to match product images */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Colors */
    --primary-blue: #3B82C4;
    --primary-blue-dark: #2563EB;
    --primary-blue-light: #60A5FA;

    /* Gradients */
    --gradient-light: linear-gradient(180deg, #B8D4E8 0%, #E8F4FC 50%, #F0F8FF 100%);
    --gradient-reading: radial-gradient(ellipse at center, #2A27F5 0%, #2A27F5 40%, #1e1db0 70%, #14137a 100%);
    --gradient-completion: linear-gradient(180deg, #C5DCE8 0%, #E8F4FC 50%, #F5FAFF 100%);

    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Status Colors */
    --success-green: #22C55E;
    --success-green-light: #4ADE80;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Dark theme variables */
    --dark-bg: #1A1A2E;
    --dark-surface: #16213E;
    --dark-text: #E0E0E0;
    --dark-border: #2C3E50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CUSTOM SCROLLBAR STYLING
   ============================================ */

/* Light theme scrollbar (default) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gray-400) 0%, var(--gray-500) 100%);
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gray-500) 0%, var(--gray-600) 100%);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Dark theme scrollbar */
.dark-theme::-webkit-scrollbar-track,
#reading-screen.dark-theme ::-webkit-scrollbar-track,
.completion-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme::-webkit-scrollbar-thumb,
#reading-screen.dark-theme ::-webkit-scrollbar-thumb,
.completion-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme::-webkit-scrollbar-thumb:hover,
#reading-screen.dark-theme ::-webkit-scrollbar-thumb:hover,
.completion-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.5) 100%);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) var(--gray-100);
}

.dark-theme,
#reading-screen.dark-theme,
.dark-theme * {
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Mobile - hide scrollbar while keeping scroll functionality */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    ::-webkit-scrollbar-thumb {
        border: none;
    }
}

/* Screen Base */
.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   HOME / LANDING SCREEN - Modern SaaS Design
   ============================================ */

#landing-screen {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 25%, #f5f9ff 50%, #eef3fb 75%, #f8faff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    animation: fadeIn 0.6s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle background pattern */
#landing-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(59, 130, 196, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

/* Landing Header */
#landing-screen .landing-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

/* Brand Badge */
#landing-screen .brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(59, 130, 196, 0.1);
    border: 1px solid rgba(59, 130, 196, 0.2);
    border-radius: var(--radius-full);
    color: var(--primary-blue);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

#landing-screen .brand-badge svg {
    width: 16px;
    height: 16px;
}

#landing-screen .app-title {
    font-size: 56px;
    font-weight: 800;
    font-style: italic;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2563EB 50%, #4F46E5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

#landing-screen .app-tagline {
    font-size: 20px;
    color: var(--gray-600);
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

#landing-screen .app-subtagline {
    display: block;
    font-size: 14px;
    color: var(--gray-400);
    font-weight: 400;
}

/* Upload Section */
#landing-screen .upload-section {
    width: 100%;
    max-width: 680px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

/* Upload Card - Glassmorphism */
#landing-screen .upload-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

#landing-screen .upload-card:hover {
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Upload Card Header */
#landing-screen .upload-card-header {
    text-align: center;
    margin-bottom: 28px;
}

#landing-screen .upload-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(59, 130, 196, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-blue);
}

#landing-screen .upload-icon-wrapper svg {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
}

#landing-screen .upload-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

#landing-screen .upload-subtitle {
    font-size: 15px;
    color: var(--gray-500);
    font-weight: 400;
}

/* Input Container */
#landing-screen .input-container {
    width: 100%;
    margin-bottom: 20px;
}

#landing-screen #text-input {
    width: 100%;
    min-height: 160px;
    padding: 20px 24px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    resize: vertical;
    color: var(--gray-700);
    line-height: 1.6;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#landing-screen #text-input::placeholder {
    color: var(--gray-400);
}

#landing-screen #text-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 196, 0.12);
}

#landing-screen #text-input:hover:not(:focus) {
    border-color: var(--gray-300);
}

/* File Upload Area */
#landing-screen .file-upload-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    margin-top: 12px;
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

#landing-screen .file-upload-area:hover {
    background: rgba(59, 130, 196, 0.04);
    border-color: var(--primary-blue);
}

#landing-screen .file-upload-area.dragover {
    background: rgba(59, 130, 196, 0.08);
    border-color: var(--primary-blue);
    border-style: solid;
}

#landing-screen .upload-drop-icon {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 196, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    flex-shrink: 0;
}

#landing-screen .upload-drop-icon svg {
    width: 20px;
    height: 20px;
}

#landing-screen .upload-drop-text {
    font-size: 14px;
    color: var(--gray-600);
}

#landing-screen .upload-drop-text strong {
    color: var(--gray-700);
}

#landing-screen .upload-browse {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#landing-screen .file-upload-area input[type="file"] {
    display: none;
}

/* Hide app-subtagline */
#landing-screen .app-subtagline {
    display: none;
}

/* File Type Badges */
#landing-screen .file-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}

#landing-screen .file-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

#landing-screen .file-badge:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

#landing-screen .file-badge svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

#landing-screen .file-size-limit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(59, 130, 196, 0.08);
    border: 1px solid rgba(59, 130, 196, 0.15);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-blue);
}

#landing-screen .file-size-limit svg {
    width: 14px;
    height: 14px;
}

/* Button Group */
#landing-screen .button-group {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 0;
}

#landing-screen .btn {
    height: 52px;
    padding: 0 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

#landing-screen .btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

#landing-screen .btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2563EB 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(59, 130, 196, 0.35);
}

#landing-screen .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563EB 0%, var(--primary-blue-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(59, 130, 196, 0.45);
}

#landing-screen .btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

#landing-screen .btn-primary:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#landing-screen .btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

#landing-screen .btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* Features Section */
#landing-screen .features-section {
    display: flex;
    justify-content: center;
    gap: 56px;
    flex-wrap: wrap;
    max-width: 700px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

#landing-screen .feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    transition: transform var(--transition-fast);
}

#landing-screen .feature-item:hover {
    transform: translateY(-4px);
}

#landing-screen .feature-icon {
    width: 52px;
    height: 52px;
    background: rgba(59, 130, 196, 0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    transition: background var(--transition-fast);
}

#landing-screen .feature-item:hover .feature-icon {
    background: rgba(59, 130, 196, 0.12);
}

#landing-screen .feature-icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.5;
}

#landing-screen .feature-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#landing-screen .feature-label strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}

#landing-screen .feature-label span {
    display: block;
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 400;
}

/* Trust Section */
#landing-screen .trust-section {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 1;
}

#landing-screen .trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
}

#landing-screen .trust-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

#landing-screen .trust-divider {
    width: 4px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 50%;
}

/* Hidden Elements (Preserved Functionality) */
#landing-screen .character-counter {
    display: none;
}

#landing-screen .preview-card {
    display: none;
}

#landing-screen .saved-sessions {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    #landing-screen {
        padding: 32px 20px;
    }

    #landing-screen .app-title {
        font-size: 42px;
    }

    #landing-screen .app-tagline {
        font-size: 17px;
    }

    #landing-screen .upload-card {
        padding: 28px 24px;
    }

    #landing-screen .upload-title {
        font-size: 20px;
    }

    #landing-screen .button-group {
        flex-direction: column;
    }

    #landing-screen .btn {
        width: 100%;
    }

    #landing-screen .features-section {
        gap: 32px;
    }

    #landing-screen .trust-section {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    #landing-screen .trust-divider {
        display: none;
    }
}

/* ============================================
   SETTINGS SCREEN
   ============================================ */

#settings-screen {
    background: var(--gradient-light);
    min-height: 100vh;
    padding: 48px 32px;
    animation: fadeIn 0.5s ease;
}

/* Settings Header - Professional Typography */
#settings-screen .settings-header {
    text-align: center;
    margin-bottom: 48px;
}

#settings-screen .settings-title {
    font-size: 32px;
    font-weight: 700;
    font-style: italic;
    color: var(--primary-blue);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

#settings-screen .settings-subtitle {
    color: var(--gray-500);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Settings Content Grid */
#settings-screen .settings-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    max-width: 1120px;
    margin: 0 auto;
}

/* Settings Panel - Card Design */
#settings-screen .settings-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-card);
}

/* Preview Panel */
#settings-screen .preview-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

/* Settings Section Spacing */
#settings-screen .settings-section {
    margin-bottom: 32px;
}

#settings-screen .settings-section:last-child {
    margin-bottom: 0;
}

/* Settings Labels - Clean Typography */
#settings-screen .settings-label {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 10px;
    font-size: 15px;
    letter-spacing: -0.01em;
}

#settings-screen .settings-description {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* Slider Styles - Refined */
#settings-screen .slider-container {
    margin-top: 10px;
}

#settings-screen .slider-container input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--gray-200), var(--gray-300));
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

#settings-screen .slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(59, 130, 196, 0.45);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

#settings-screen .slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(59, 130, 196, 0.5);
}

#settings-screen .slider-container input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    border: none;
    box-shadow: 0 3px 8px rgba(59, 130, 196, 0.45);
}

#settings-screen .slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

#settings-screen .slider-value {
    margin-top: 14px;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 14px;
    text-align: center;
    background: rgba(59, 130, 196, 0.08);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

/* Select Dropdown - Polished */
#settings-screen select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background: var(--white);
    color: var(--gray-700);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#settings-screen select:hover {
    border-color: var(--gray-300);
}

#settings-screen select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 196, 0.12);
}

/* Toggle Button Group - Premium Design with Gradient */
#settings-screen .button-toggle-group {
    display: flex;
    gap: 10px;
}

#settings-screen .toggle-btn {
    flex: 1;
    height: 48px;
    padding: 0 20px;
    border: 2px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--gray-600);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

#settings-screen .toggle-btn:hover:not(.active) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(59, 130, 196, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 196, 0.15);
}

#settings-screen .toggle-btn.active {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2563EB 50%, #4F46E5 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow:
        0 4px 14px rgba(59, 130, 196, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#settings-screen .toggle-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Advanced Options - Clean Layout */
#settings-screen #advanced-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--transition-fast);
}

#settings-screen #advanced-toggle:hover {
    color: var(--primary-blue);
}

#settings-screen #advanced-options {
    margin-top: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

#settings-screen #advanced-options input[type="checkbox"] {
    accent-color: var(--primary-blue);
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

#settings-screen #advanced-options label {
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    font-weight: 500;
}

#settings-screen #advanced-options>div {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
}

#settings-screen #advanced-options>div:last-child {
    margin-bottom: 0;
}

/* Preview Panel Styles - Refined */
#settings-screen .preview-box {
    flex: 0 0 auto;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(59, 130, 196, 0.03) 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
}

#settings-screen .preview-label {
    font-size: 11px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
}

#settings-screen .preview-text {
    text-align: center;
    line-height: 1.6;
    color: var(--gray-700);
    font-weight: 500;
}

#settings-screen .preview-text.small {
    font-size: 18px;
}

#settings-screen .preview-text.medium {
    font-size: 24px;
}

#settings-screen .preview-text.large {
    font-size: 30px;
}

#settings-screen .preview-time {
    text-align: center;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 16px;
    padding-top: 0;
    font-weight: 500;
}

/* Stats Card in Settings - Polished */
#settings-screen .stats-card {
    padding: 28px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

#settings-screen .stats-card .stats-title {
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
    font-size: 15px;
    letter-spacing: -0.01em;
}

#settings-screen .stats-card .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

#settings-screen .stats-card .stat-item {
    text-align: center;
    padding: 16px 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-100);
    transition: box-shadow var(--transition-fast);
}

#settings-screen .stats-card .stat-item:hover {
    box-shadow: var(--shadow-sm);
}

#settings-screen .stats-card .stat-label {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

#settings-screen .stats-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-blue);
}

/* Settings Action Buttons - Professional Design */
#settings-screen .settings-action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

#settings-screen .settings-action-buttons .btn {
    flex: 1;
    height: 56px;
    padding: 0 32px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

#settings-screen .settings-action-buttons .btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

#settings-screen .settings-action-buttons .btn span {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Primary Button - Begin Session */
#settings-screen .settings-action-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2563EB 50%, #4F46E5 100%);
    color: var(--white);
    box-shadow:
        0 4px 16px rgba(59, 130, 196, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#settings-screen .settings-action-buttons .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#settings-screen .settings-action-buttons .btn-primary:hover::before {
    left: 100%;
}

#settings-screen .settings-action-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 24px rgba(59, 130, 196, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#settings-screen .settings-action-buttons .btn-primary:hover svg {
    transform: scale(1.1);
}

#settings-screen .settings-action-buttons .btn-primary:active {
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(59, 130, 196, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

#settings-screen .settings-action-buttons .btn-primary svg {
    fill: currentColor;
}

/* Secondary Button - Back to Edit */
#settings-screen .settings-action-buttons .btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#settings-screen .settings-action-buttons .btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#settings-screen .settings-action-buttons .btn-secondary:hover svg {
    transform: translateX(-4px);
}

#settings-screen .settings-action-buttons .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Responsive - Stack buttons on mobile */
@media (max-width: 560px) {
    #settings-screen .settings-action-buttons {
        flex-direction: column-reverse;
    }

    #settings-screen .settings-action-buttons .btn {
        width: 100%;
    }
}

/* ============================================
   READING SCREEN
   ============================================ */

#reading-screen {
    background: var(--gradient-reading);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background 0.3s ease, max-height 0.4s ease, border-radius 0.4s ease, margin 0.4s ease;
}

/* Half Screen Mode */
#reading-screen.half-screen {
    max-height: 50vh;
    min-height: 50vh;
    margin: 25vh auto 0;
    width: 90%;
    max-width: 1200px;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#reading-screen.half-screen .segment-display {
    padding: 20px;
}

#reading-screen.half-screen .segment-info {
    top: 10px;
    padding: 8px 12px;
    font-size: 11px;
}

#reading-screen.half-screen .segment-counter {
    top: 10px;
    font-size: 13px;
}

#reading-screen.half-screen .control-bar {
    padding: 10px 16px;
}

#reading-screen.half-screen .bottom-controls-wrapper {
    bottom: 75px;
}

#reading-screen.half-screen .seek-bar-container {
    width: 90%;
}

#reading-screen.half-screen .segment-line.current {
    font-size: 1.4em;
}

#reading-screen.half-screen .segment-line.prev,
#reading-screen.half-screen .segment-line.next {
    font-size: 1em;
}

/* Adjust half screen for smaller viewports */
@media (max-height: 700px) {
    #reading-screen.half-screen {
        max-height: 60vh;
        min-height: 60vh;
        margin: 20vh auto 0;
    }
}

@media (max-width: 768px) {
    #reading-screen.half-screen {
        width: 95%;
        border-radius: 15px;
    }

    #reading-screen.half-screen .bottom-controls-wrapper {
        bottom: 70px;
        padding: 0 12px;
    }

    #reading-screen.half-screen .seek-bar-container {
        width: 100%;
    }
}

/* Dark theme - blue gradient with white text (default) */
#reading-screen.dark-theme {
    background: var(--gradient-reading);
}

#reading-screen.dark-theme .segment-line {
    color: white;
}

#reading-screen.dark-theme .segment-line.prev,
#reading-screen.dark-theme .segment-line.next {
    color: rgba(255, 255, 255, var(--context-opacity, 0.5));
}

#reading-screen.dark-theme .control-bar {
    background: rgba(0, 0, 0, 0.4);
}

#reading-screen.dark-theme .control-btn,
#reading-screen.dark-theme .speed-btn,
#reading-screen.dark-theme .control-value {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

#reading-screen.dark-theme .segment-counter {
    color: rgba(255, 255, 255, 0.7);
}

/* Light theme - white background with black text */
#reading-screen.light-theme {
    background: linear-gradient(180deg, #f5f7fa 0%, #ffffff 50%, #f0f4f8 100%);
}

#reading-screen.light-theme .segment-line {
    color: #1a1a2e;
}

#reading-screen.light-theme .segment-line.prev,
#reading-screen.light-theme .segment-line.next {
    color: rgba(26, 26, 46, var(--context-opacity, 0.4));
}

#reading-screen.light-theme .control-bar {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

#reading-screen.light-theme .control-btn,
#reading-screen.light-theme .speed-btn,
#reading-screen.light-theme .control-value {
    background: #f0f4f8;
    color: #1a1a2e;
    border: 1px solid #e0e5eb;
}

#reading-screen.light-theme .control-btn:hover,
#reading-screen.light-theme .speed-btn:hover {
    background: #e0e5eb;
}

#reading-screen.light-theme .play-btn {
    background: var(--primary-blue);
    color: white;
}

#reading-screen.light-theme .segment-counter {
    color: rgba(26, 26, 46, 0.6);
}

#reading-screen.light-theme .progress-fill {
    background: var(--primary-blue);
}

#reading-screen.high-contrast {
    background: #000;
}

/* Segment Display */
.segment-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: hidden;
    position: relative;
}

.segment-display.light-theme,
.segment-display.dark-theme {
    background: transparent;
}

.segment-display.high-contrast {
    background: #000;
}

.scroll-container {
    height: 280px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 900px;
}

.line-wrapper {
    position: relative;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.segment-line {
    position: absolute;
    width: 100%;
    text-align: center;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.5;
    padding: 0 20px;
    color: var(--white);
}

.segment-line.prev {
    transform: translateY(-80px);
    opacity: 0.3;
    font-weight: 400;
}

.segment-line.current {
    transform: translateY(0);
    opacity: 1;
    font-weight: 600;
}

.segment-line.next {
    transform: translateY(80px);
    opacity: 0.3;
    font-weight: 400;
}

.segment-line.small {
    font-size: 20px;
}

.segment-line.small.prev,
.segment-line.small.next {
    font-size: 16px;
}

.segment-line.medium {
    font-size: 26px;
}

.segment-line.medium.prev,
.segment-line.medium.next {
    font-size: 20px;
}

.segment-line.large {
    font-size: 34px;
}

.segment-line.large.prev,
.segment-line.large.next {
    font-size: 26px;
}

/* High contrast overrides */
.high-contrast .segment-line {
    color: #FFFF00;
}

.high-contrast .segment-line.prev,
.high-contrast .segment-line.next {
    color: #888;
}

/* Navigation Buttons */
.nav-buttons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 12px;
    z-index: 200;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn svg {
    flex-shrink: 0;
}

.nav-btn span {
    font-size: 13px;
}

#reading-screen.light-theme .nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#reading-screen.light-theme .nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Adjust for half-screen mode */
#reading-screen.half-screen .nav-buttons {
    top: 10px;
    left: 10px;
}

#reading-screen.half-screen .nav-btn {
    padding: 8px 12px;
    font-size: 12px;
}

#reading-screen.half-screen .nav-btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive - hide text on small screens */
@media (max-width: 768px) {
    .nav-btn span {
        display: none;
    }

    .nav-btn {
        padding: 10px;
    }
}

/* Segment Info - Hidden by default */
.segment-info {
    display: none;
}

/* Segment Counter - Positioned bottom right */
.segment-counter {
    position: absolute;
    bottom: 100px;
    right: 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.segment-counter.light-theme,
.segment-counter.dark-theme {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
}

.segment-counter.high-contrast {
    background: transparent;
    color: #FFFF00;
}

.counter-line {
    line-height: 1.5;
    text-align: right;
}

.counter-line:first-child {
    display: block;
}

.counter-line:last-child {
    display: none;
}

/* Control Bar */
.control-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 24px;
    background: rgba(30, 60, 90, 0.85);
    backdrop-filter: blur(10px);
    border-top: none;
    position: relative;
    z-index: 100;
}

.control-bar.light-theme,
.control-bar.dark-theme {
    background: rgba(30, 60, 90, 0.85);
}

.control-bar.high-contrast {
    background: #000;
    border-top: 2px solid #FFFF00;
}

.control-group {
    display: flex;
    gap: 4px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--white);
}

.control-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.control-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.control-btn.play-btn {
    width: 56px;
    height: 56px;
    font-size: 20px;
    background: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(59, 130, 196, 0.4);
}

.control-btn.play-btn:hover {
    background: var(--primary-blue-dark);
    transform: scale(1.05);
}

.control-btn.exit-btn {
    background: rgba(255, 255, 255, 0.15);
}

.control-btn.exit-btn:hover {
    background: rgba(239, 68, 68, 0.8);
}

/* Theme overrides for control buttons */
.control-btn.light-theme,
.control-btn.dark-theme {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: none;
}

.control-btn.high-contrast {
    background: #000;
    color: #FFFF00;
    border: 2px solid #FFFF00;
}

/* Speed Control */
.speed-control {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 8px;
}

.control-label {
    display: none;
}

.speed-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.speed-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all var(--transition-fast);
}

.speed-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.speed-btn.light-theme,
.speed-btn.dark-theme {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: none;
}

.control-value {
    font-size: 14px;
    font-weight: 600;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 0 8px;
}

.control-value.light-theme,
.control-value.dark-theme {
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
}

/* Bottom Controls Wrapper - Contains seek bar */
.bottom-controls-wrapper {
    position: absolute !important;
    bottom: 95px;
    left: 0;
    right: 0;
    display: flex !important;
    justify-content: center;
    z-index: 150 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Interactive Seek Bar */
.seek-bar-container {
    width: 80%;
    max-width: 600px;
    padding: 12px 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.seek-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s ease;
    touch-action: none;
    display: block !important;
    visibility: visible !important;
    /* Prevent scroll when dragging on touch */
}

.seek-bar:hover {
    height: 10px;
}

.seek-bar:hover .seek-handle {
    transform: translateX(-50%) translateY(-50%) scale(1.2);
}

.seek-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ADE80, var(--primary-blue));
    border-radius: 4px;
    transition: width 0.05s linear;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

.seek-handle {
    position: absolute;
    left: 0%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    z-index: 20;
    pointer-events: auto;
    touch-action: none;
    /* Prevent scroll when dragging */
}

.seek-handle:hover {
    transform: translateX(-50%) translateY(-50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.seek-handle:active {
    cursor: grabbing;
    transform: translateX(-50%) translateY(-50%) scale(1.25);
}

.seek-time {
    display: flex !important;
    justify-content: center;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    visibility: visible !important;
    opacity: 1 !important;
}

/* Light theme seek bar styles */
#reading-screen.light-theme .seek-bar {
    background: rgba(0, 0, 0, 0.15);
}

#reading-screen.light-theme .seek-time {
    color: rgba(26, 26, 46, 0.6);
}

#reading-screen.light-theme .seek-handle {
    background: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(59, 130, 196, 0.4);
}

/* Jump Dialog */
.jump-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    min-width: 300px;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-normal);
}

.jump-dialog.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.jump-dialog h3 {
    margin-bottom: 16px;
    color: var(--gray-800);
    font-weight: 600;
}

.jump-dialog input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
}

.jump-dialog input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* ============================================
   COMPLETION SCREEN
   ============================================ */

#completion-screen {
    background: var(--gradient-completion);
    min-height: 100vh;
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

/* Completion Modal */
.completion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.completion-modal.visible {
    display: flex;
}

.completion-modal-content {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease;
    padding: 40px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.completion-header {
    text-align: center;
    margin-bottom: 40px;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: var(--success-green);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.35);
    animation: successPulse 0.6s ease-out;
}

.success-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 3;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.completion-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.completion-subtitle {
    color: var(--gray-500);
    font-size: 16px;
}

/* Stats Container */
.stats-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    box-shadow: var(--shadow-card);
    margin-bottom: 32px;
    width: 100%;
    max-width: 600px;
}

.completion-modal .stats-container {
    max-width: 100%;
    background: transparent;
    box-shadow: none;
    padding: 20px 0;
}

.stats-main-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.stat-column {
    text-align: center;
}

.stat-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.stat-number span {
    font-size: 18px;
    font-weight: 500;
}

.stat-name {
    color: var(--gray-500);
    font-size: 13px;
}

/* Hide detailed stats */
.stats-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.completion-modal .stats-detail {
    display: grid;
}

.detail-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
}

.detail-label {
    font-size: 13px;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label svg {
    width: 14px;
    height: 14px;
    stroke: var(--gray-500);
    flex-shrink: 0;
}

.detail-value {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.insights-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    padding: 16px;
    border-radius: 12px;
    margin-top: 20px;
}

.completion-modal .insights-card {
    display: block;
}

.insights-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-blue);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insights-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary-blue);
}

.insights-text {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.6;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 32px;
}

.completion-modal .action-buttons {
    max-width: 100%;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .completion-modal .action-buttons {
        grid-template-columns: 1fr;
    }
}

.btn-action {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-action svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.btn-action.primary {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(59, 130, 196, 0.3);
}

.btn-action.primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 196, 0.4);
}

.btn-action.secondary {
    background: var(--white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-action.secondary:hover {
    background: rgba(59, 130, 196, 0.08);
}

/* Completion Page Action Buttons - Proper Padding */
#completion-screen .btn-action {
    padding: 16px 28px;
}

#completion-screen .btn-action.primary {
    padding: 16px 32px;
}

#completion-screen .btn-action.secondary {
    padding: 14px 24px;
}

/* Share Section - Hidden */
.share-section {
    display: none;
}

/* Back Link */
.back-link {
    color: var(--gray-600);
    text-decoration: underline;
    font-size: 15px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--primary-blue);
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(26, 26, 46, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    padding: 36px 40px;
    border-radius: var(--radius-xl);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.modal-text {
    color: var(--gray-500);
    margin-bottom: 28px;
    line-height: 1.6;
    font-size: 15px;
}

.modal-buttons {
    display: flex;
    gap: 14px;
}

.modal-buttons .btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.modal-buttons .btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.modal-buttons .btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
}

.modal-buttons .btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.modal-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

/* Mobile responsive modal */
@media (max-width: 480px) {
    .modal-content {
        padding: 28px 24px;
        margin: 0 16px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-buttons .btn {
        width: 100%;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-800);
    color: var(--white);
    padding: 14px 24px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    opacity: 0;
    transition: all var(--transition-normal);
    font-size: 14px;
    font-weight: 500;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE DESIGN - COMPREHENSIVE MOBILE SUPPORT
   ============================================ */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {

    /* Settings Page */
    #settings-screen .settings-content {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }

    #settings-screen .preview-panel {
        order: -1;
    }

    /* Completion Page */
    .stats-main-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets */
@media (max-width: 768px) {

    /* ===== HOME PAGE ===== */
    #landing-screen {
        padding: 32px 20px;
    }

    #landing-screen .app-title {
        font-size: 42px;
    }

    #landing-screen .app-tagline {
        font-size: 17px;
    }

    #landing-screen .upload-card {
        padding: 28px 20px;
    }

    #landing-screen .upload-card-header {
        margin-bottom: 20px;
    }

    #landing-screen .upload-icon-wrapper {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }

    #landing-screen .upload-icon-wrapper svg {
        width: 28px;
        height: 28px;
    }

    #landing-screen .upload-title {
        font-size: 18px;
    }

    #landing-screen .upload-subtitle {
        font-size: 14px;
    }

    #landing-screen #text-input {
        min-height: 140px;
        padding: 16px;
        font-size: 14px;
    }

    #landing-screen .file-upload-area {
        flex-direction: column;
        padding: 20px;
        gap: 8px;
    }

    #landing-screen .file-types {
        gap: 8px;
    }

    #landing-screen .file-badge,
    #landing-screen .file-size-limit {
        padding: 5px 10px;
        font-size: 11px;
    }

    #landing-screen .button-group {
        flex-direction: column;
        gap: 12px;
    }

    #landing-screen .btn {
        width: 100%;
        height: 48px;
        font-size: 14px;
    }

    #landing-screen .features-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px;
        justify-content: center;
    }

    #landing-screen .feature-item {
        flex: 0 1 140px;
    }

    #landing-screen .feature-icon {
        width: 44px;
        height: 44px;
    }

    #landing-screen .feature-icon svg {
        width: 22px;
        height: 22px;
    }

    #landing-screen .feature-label strong {
        font-size: 13px;
    }

    #landing-screen .feature-label span {
        font-size: 12px;
    }

    #landing-screen .trust-section {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    #landing-screen .trust-divider {
        display: none;
    }

    /* ===== SETTINGS PAGE ===== */
    #settings-screen {
        padding: 32px 16px;
    }

    #settings-screen .settings-header {
        margin-bottom: 32px;
    }

    #settings-screen .settings-title {
        font-size: 24px;
    }

    #settings-screen .settings-subtitle {
        font-size: 14px;
    }

    #settings-screen .settings-panel,
    #settings-screen .preview-panel {
        padding: 24px 20px;
    }

    #settings-screen .settings-section {
        margin-bottom: 24px;
    }

    #settings-screen .settings-label {
        font-size: 14px;
    }

    #settings-screen .settings-description {
        font-size: 12px;
    }

    #settings-screen .button-toggle-group {
        flex-wrap: wrap;
    }

    #settings-screen .toggle-btn {
        height: 42px;
        padding: 0 14px;
        font-size: 13px;
        min-width: calc(33.33% - 8px);
    }

    #settings-screen .preview-box {
        padding: 20px;
        min-height: 100px;
    }

    #settings-screen .preview-text.medium {
        font-size: 20px;
    }

    #settings-screen .stats-card {
        padding: 20px;
    }

    #settings-screen .stats-card .stat-value {
        font-size: 18px;
    }

    #settings-screen .settings-action-buttons {
        flex-direction: column-reverse;
        gap: 12px;
    }

    #settings-screen .settings-action-buttons .btn {
        width: 100%;
        height: 52px;
    }

    /* ===== READING PAGE ===== */
    #reading-screen .segment-display {
        padding: 60px 16px 20px;
    }

    .scroll-container {
        height: 240px;
        max-width: 100%;
    }

    .line-wrapper {
        height: 80px;
    }

    .segment-line {
        padding: 0 12px;
        line-height: 1.4;
    }

    .segment-line.prev {
        transform: translateY(-75px);
    }

    .segment-line.next {
        transform: translateY(75px);
    }

    .segment-line.small {
        font-size: 16px;
    }

    .segment-line.small.prev,
    .segment-line.small.next {
        font-size: 13px;
    }

    .segment-line.medium {
        font-size: 18px;
    }

    .segment-line.medium.prev,
    .segment-line.medium.next {
        font-size: 14px;
    }

    .segment-line.large {
        font-size: 22px;
    }

    .segment-line.large.prev,
    .segment-line.large.next {
        font-size: 17px;
    }

    .nav-buttons {
        top: 12px;
        left: 12px;
        gap: 8px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .nav-btn span {
        display: none;
    }

    .nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .segment-counter {
        top: 12px;
        right: 16px;
        bottom: auto;
        font-size: 12px;
    }

    .control-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
        justify-content: center;
        row-gap: 8px;
    }

    .control-group {
        gap: 4px;
    }

    .control-btn {
        width: 38px;
        height: 38px;
    }

    .control-btn svg {
        width: 16px;
        height: 16px;
    }

    .control-btn.play-btn {
        width: 48px;
        height: 48px;
    }

    .control-btn.play-btn svg {
        width: 20px;
        height: 20px;
    }

    .speed-control {
        margin: 0 2px;
    }

    .speed-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .control-value {
        font-size: 11px;
        min-width: 36px;
        height: 28px;
        padding: 0 4px;
    }

    /* Bottom controls wrapper - above control bar */
    .bottom-controls-wrapper {
        position: absolute !important;
        bottom: 110px !important;
        left: 0;
        right: 0;
        padding: 0 20px;
        z-index: 150 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .seek-bar-container {
        width: 100% !important;
        max-width: none !important;
        padding: 12px 0;
        display: block !important;
        visibility: visible !important;
    }

    .seek-bar {
        height: 8px !important;
        background: rgba(255, 255, 255, 0.4) !important;
        display: block !important;
    }

    .seek-handle {
        width: 26px;
        height: 26px;
        display: block !important;
    }

    .seek-time {
        font-size: 12px !important;
        margin-top: 10px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* ===== COMPLETION PAGE ===== */
    #completion-screen {
        padding: 40px 20px;
    }

    .completion-header {
        margin-bottom: 32px;
    }

    .success-icon {
        width: 60px;
        height: 60px;
    }

    .success-icon svg {
        width: 30px;
        height: 30px;
    }

    .completion-title {
        font-size: 26px;
    }

    .completion-subtitle {
        font-size: 14px;
    }

    .stats-container {
        padding: 24px 20px;
    }

    .stats-main-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stat-column {
        display: flex;
        align-items: center;
        gap: 16px;
        text-align: left;
        padding: 16px;
        background: rgba(59, 130, 196, 0.05);
        border-radius: 12px;
    }

    .stat-icon {
        margin: 0;
        width: 48px;
        height: 48px;
        background: rgba(59, 130, 196, 0.1);
        border-radius: 12px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-name {
        font-size: 12px;
    }

    .stats-detail {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 100%;
    }

    .btn-action {
        padding: 14px 20px;
        font-size: 14px;
    }

    .completion-modal-content {
        padding: 28px 20px;
        width: 95%;
    }

    .completion-modal .action-buttons {
        grid-template-columns: 1fr;
    }

    /* ===== MODALS ===== */
    .modal-content {
        padding: 24px 20px;
        margin: 0 16px;
        max-width: calc(100% - 32px);
    }

    .jump-dialog {
        padding: 24px 20px;
        min-width: 280px;
        width: 90%;
    }
}

/* Small Tablets / Large Phones */
@media (max-width: 600px) {

    /* Settings toggle buttons - 2 per row */
    #settings-screen .button-toggle-group {
        gap: 8px;
    }

    #settings-screen .toggle-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }

    /* Theme buttons - stack if 3 options */
    #settings-screen #theme-group .toggle-btn {
        flex: 1 1 100%;
    }

    /* Stats grid */
    #settings-screen .stats-card .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    #settings-screen .stats-card .stat-item {
        padding: 12px 8px;
    }

    #settings-screen .stats-card .stat-value {
        font-size: 16px;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {

    /* ===== HOME PAGE ===== */
    #landing-screen {
        padding: 24px 16px;
    }

    #landing-screen .brand-badge {
        padding: 6px 12px;
        font-size: 11px;
    }

    #landing-screen .app-title {
        font-size: 36px;
    }

    #landing-screen .app-tagline {
        font-size: 15px;
    }

    #landing-screen .landing-header {
        margin-bottom: 28px;
    }

    #landing-screen .upload-card {
        padding: 20px 16px;
    }

    #landing-screen .upload-icon-wrapper {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    #landing-screen .upload-icon-wrapper svg {
        width: 24px;
        height: 24px;
    }

    #landing-screen .upload-title {
        font-size: 16px;
    }

    #landing-screen #text-input {
        min-height: 120px;
        padding: 14px;
    }

    #landing-screen .file-upload-area {
        padding: 16px;
    }

    #landing-screen .upload-drop-icon {
        width: 36px;
        height: 36px;
    }

    #landing-screen .upload-drop-text {
        font-size: 13px;
    }

    #landing-screen .file-types {
        gap: 6px;
    }

    #landing-screen .file-badge {
        padding: 4px 8px;
        font-size: 10px;
    }

    #landing-screen .btn {
        height: 46px;
        font-size: 13px;
        padding: 0 20px;
    }

    #landing-screen .features-section {
        gap: 16px;
        margin-bottom: 32px;
    }

    #landing-screen .feature-item {
        flex: 0 1 100px;
    }

    #landing-screen .feature-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    #landing-screen .feature-icon svg {
        width: 20px;
        height: 20px;
    }

    #landing-screen .trust-item {
        font-size: 11px;
    }

    /* ===== SETTINGS PAGE ===== */
    #settings-screen {
        padding: 24px 12px;
    }

    #settings-screen .settings-title {
        font-size: 20px;
    }

    #settings-screen .settings-panel,
    #settings-screen .preview-panel {
        padding: 20px 16px;
        border-radius: 16px;
    }

    #settings-screen .toggle-btn {
        height: 40px;
        font-size: 12px;
        padding: 0 10px;
    }

    #settings-screen .slider-container input[type="range"]::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    #settings-screen .slider-value {
        font-size: 12px;
        padding: 6px 12px;
    }

    #settings-screen select {
        padding: 12px 14px;
        font-size: 13px;
    }

    #settings-screen .preview-text.small {
        font-size: 16px;
    }

    #settings-screen .preview-text.medium {
        font-size: 18px;
    }

    #settings-screen .preview-text.large {
        font-size: 22px;
    }

    #settings-screen .settings-action-buttons .btn {
        height: 48px;
        font-size: 14px;
    }

    #settings-screen .settings-action-buttons .btn svg {
        width: 18px;
        height: 18px;
    }

    /* ===== READING PAGE ===== */
    #reading-screen .segment-display {
        padding: 50px 12px 20px;
    }

    .scroll-container {
        height: 200px;
    }

    .line-wrapper {
        height: 70px;
    }

    .segment-line {
        line-height: 1.3;
    }

    .segment-line.prev {
        transform: translateY(-65px);
    }

    .segment-line.next {
        transform: translateY(65px);
    }

    .segment-line.small {
        font-size: 14px;
    }

    .segment-line.small.prev,
    .segment-line.small.next {
        font-size: 11px;
    }

    .segment-line.medium {
        font-size: 16px;
    }

    .segment-line.medium.prev,
    .segment-line.medium.next {
        font-size: 12px;
    }

    .segment-line.large {
        font-size: 20px;
    }

    .segment-line.large.prev,
    .segment-line.large.next {
        font-size: 15px;
    }

    .nav-buttons {
        top: 8px;
        left: 8px;
    }

    .nav-btn {
        padding: 8px;
    }

    .segment-counter {
        top: 8px;
        right: 12px;
        bottom: auto;
        font-size: 11px;
    }

    .control-bar {
        padding: 8px 10px;
        gap: 5px;
        row-gap: 6px;
    }

    .control-btn {
        width: 34px;
        height: 34px;
    }

    .control-btn svg {
        width: 14px;
        height: 14px;
    }

    .control-btn.play-btn {
        width: 42px;
        height: 42px;
    }

    .control-btn.play-btn svg {
        width: 16px;
        height: 16px;
    }

    .speed-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .control-value {
        font-size: 9px;
        min-width: 28px;
        height: 24px;
    }

    /* Bottom controls wrapper */
    .bottom-controls-wrapper {
        position: absolute !important;
        bottom: 105px !important;
        padding: 0 16px;
        z-index: 150 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .seek-bar-container {
        padding: 10px 0;
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
    }

    .seek-bar {
        height: 7px !important;
        background: rgba(255, 255, 255, 0.4) !important;
        display: block !important;
    }

    .seek-time {
        display: flex !important;
        font-size: 11px !important;
        margin-top: 8px;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .seek-handle {
        width: 20px;
        height: 20px;
    }

    .seek-time {
        font-size: 10px;
        margin-top: 6px;
    }

    /* ===== COMPLETION PAGE ===== */
    #completion-screen {
        padding: 32px 16px;
    }

    .success-icon {
        width: 56px;
        height: 56px;
    }

    .success-icon svg {
        width: 28px;
        height: 28px;
    }

    .completion-title {
        font-size: 22px;
    }

    .stats-container {
        padding: 20px 16px;
    }

    .stat-column {
        padding: 12px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
    }

    .stat-number {
        font-size: 22px;
    }

    .btn-action {
        padding: 12px 16px;
        font-size: 13px;
    }

    /* Toast */
    .toast {
        padding: 12px 20px;
        font-size: 13px;
        max-width: calc(100% - 32px);
    }
}

/* Very Small Phones */
@media (max-width: 360px) {
    #landing-screen .app-title {
        font-size: 30px;
    }

    #landing-screen .upload-title {
        font-size: 15px;
    }

    #landing-screen .btn {
        height: 44px;
        font-size: 12px;
    }

    #settings-screen .settings-title {
        font-size: 18px;
    }

    #settings-screen .toggle-btn {
        font-size: 11px;
        height: 38px;
    }

    .segment-line.medium {
        font-size: 18px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

    .control-btn.play-btn {
        width: 44px;
        height: 44px;
    }

    /* Progress bar visibility */
    .bottom-controls-wrapper {
        position: absolute !important;
        bottom: 100px !important;
        padding: 0 14px;
        z-index: 150 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .seek-bar-container {
        width: 100% !important;
        padding: 8px 0;
        display: block !important;
        visibility: visible !important;
    }

    .seek-bar {
        height: 7px !important;
        background: rgba(255, 255, 255, 0.4) !important;
        display: block !important;
    }

    .seek-time {
        display: flex !important;
        font-size: 10px !important;
        margin-top: 6px;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .completion-title {
        font-size: 20px;
    }
}

/* Landscape Mode for Phones */
@media (max-height: 500px) and (orientation: landscape) {
    #reading-screen .segment-display {
        padding: 12px;
    }

    .scroll-container {
        height: 100px;
    }

    .line-wrapper {
        height: 40px;
    }

    .segment-line.prev {
        transform: translateY(-40px);
    }

    .segment-line.next {
        transform: translateY(40px);
    }

    .segment-line.medium {
        font-size: 18px;
    }

    .control-bar {
        padding: 8px 12px;
    }

    .control-btn {
        width: 34px;
        height: 34px;
    }

    .control-btn.play-btn {
        width: 42px;
        height: 42px;
    }

    /* Bottom controls for landscape */
    .bottom-controls-wrapper {
        position: absolute !important;
        bottom: 80px !important;
        padding: 0 16px;
        z-index: 150 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .seek-bar-container {
        padding: 6px 0;
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
    }

    .seek-bar {
        height: 6px !important;
        background: rgba(255, 255, 255, 0.4) !important;
        display: block !important;
    }

    .seek-handle {
        width: 24px;
        height: 24px;
    }

    .seek-time {
        display: flex !important;
        font-size: 10px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .segment-counter {
        bottom: 60px;
    }
}

/* Touch Device Enhancements */
@media (hover: none) and (pointer: coarse) {

    /* Ensure progress bar is always visible on touch devices */
    .bottom-controls-wrapper {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 150 !important;
    }

    .seek-bar-container {
        width: 100%;
        display: block !important;
        visibility: visible !important;
    }

    .seek-bar {
        height: 7px;
        background: rgba(255, 255, 255, 0.35);
        display: block !important;
        visibility: visible !important;
    }

    .seek-time {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Increase touch targets */
    #landing-screen .btn,
    #settings-screen .toggle-btn,
    #settings-screen .settings-action-buttons .btn,
    .btn-action,
    .control-btn,
    .nav-btn,
    .speed-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Ensure control bar is above other elements */
    .control-bar {
        z-index: 200;
        position: relative;
    }

    /* Ensure buttons have proper stacking */
    .control-btn,
    .speed-btn {
        position: relative;
        z-index: 10;
    }

    /* Remove hover effects on touch */
    #landing-screen .btn:hover,
    #settings-screen .toggle-btn:hover:not(.active),
    .control-btn:hover,
    .nav-btn:hover,
    .speed-btn:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.15);
    }

    /* Add active states for touch feedback */
    #landing-screen .btn:active,
    #settings-screen .toggle-btn:active,
    .control-btn:active,
    .nav-btn:active,
    .speed-btn:active {
        transform: scale(0.95);
        opacity: 0.85;
    }

    /* Play button active state */
    .control-btn.play-btn:active {
        transform: scale(0.95);
        background: var(--primary-blue-dark);
    }

    /* Larger seek handle for touch */
    .seek-handle {
        width: 28px;
        height: 28px;
    }

    /* Ensure seek bar container doesn't block control bar */
    .seek-bar-container {
        z-index: 50;
        width: 100%;
    }

    /* Ensure bottom controls are visible */
    .bottom-controls-wrapper {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Increase seek bar visibility */
    .seek-bar {
        height: 7px;
        background: rgba(255, 255, 255, 0.35);
    }
}

/* Print Styles */
@media print {

    .control-bar,
    .nav-buttons,
    .seek-bar-container,
    .toast {
        display: none !important;
    }

    #reading-screen {
        background: white !important;
    }

    .segment-line {
        color: black !important;
    }
}