/* ============================================
   QAARI — Base Styles & Animations
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Amiri:wght@400;700&display=swap');

/* ── Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-size: inherit;
}

input {
    font-family: inherit;
    color: inherit;
    border: none;
    background: none;
    outline: none;
}

ul,
ol {
    list-style: none;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ── Selection ── */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.arabic-text {
    font-family: var(--font-arabic);
    direction: rtl;
    line-height: 2;
    letter-spacing: 0;
}

/* ── Utility Classes ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-accent {
    color: var(--text-accent);
}

.text-muted {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

/* ── Animations ── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 8px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(29, 185, 84, 0.1);
    }
}

@keyframes equalizerBar {

    0%,
    100% {
        height: 4px;
    }

    50% {
        height: 16px;
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-base) both;
}

.animate-fade-in-up {
    animation: fadeInUp var(--transition-slow) both;
}

.animate-slide-up {
    animation: slideUp var(--transition-slow) both;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Staggered animations for lists */
.stagger-item {
    animation: fadeInUp 0.4s ease both;
}

.stagger-item:nth-child(1) {
    animation-delay: 0.03s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.06s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.09s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.12s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.15s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.18s;
}

.stagger-item:nth-child(7) {
    animation-delay: 0.21s;
}

.stagger-item:nth-child(8) {
    animation-delay: 0.24s;
}

.stagger-item:nth-child(9) {
    animation-delay: 0.27s;
}

.stagger-item:nth-child(10) {
    animation-delay: 0.30s;
}

.stagger-item:nth-child(n+11) {
    animation-delay: 0.33s;
}

/* ── Loading Skeleton ── */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-hover) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ── Equalizer Animation (Now Playing) ── */
.equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.equalizer-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 1px;
    animation: equalizerBar 0.8s ease-in-out infinite;
}

.equalizer-bar:nth-child(1) {
    animation-delay: 0s;
}

.equalizer-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.equalizer-bar:nth-child(3) {
    animation-delay: 0.4s;
}

.equalizer-bar:nth-child(4) {
    animation-delay: 0.1s;
}

/* ── Islamic Geometric Pattern (subtle BG) ── */
.pattern-bg {
    position: relative;
}

.pattern-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.02;
    background-image:
        radial-gradient(circle at 25% 25%, var(--accent) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, var(--accent) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ── Page Transitions ── */
#content {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

#content.page-exit {
    opacity: 0;
    transform: translateY(6px);
}

#content.page-enter {
    animation: fadeInUp 0.35s ease both;
}

/* ── Skeleton Cards ── */
.skeleton-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-hover) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line.w-30 {
    width: 30%;
}

.skeleton-line.w-50 {
    width: 50%;
}

.skeleton-line.w-70 {
    width: 70%;
}

.skeleton-line.w-80 {
    width: 80%;
}

.skeleton-line.h-lg {
    height: 24px;
}

.skeleton-line.h-xl {
    height: 40px;
    border-radius: var(--radius-md);
}

.skeleton-circle {
    border-radius: var(--radius-full);
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-hover) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ── Now-Playing Fullscreen View ── */
.now-playing-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.now-playing-overlay.closing {
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.now-playing-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--glass-bg);
    transition: all var(--transition-fast);
    z-index: 10;
}

.now-playing-close:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
}

.now-playing-art {
    width: 280px;
    height: 280px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-lg), 0 0 60px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.now-playing-art .surah-num-big {
    font-size: 100px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.12);
    position: absolute;
}

.now-playing-art .surah-name-ar {
    font-family: var(--font-arabic);
    font-size: var(--text-4xl);
    color: white;
    direction: rtl;
    position: relative;
    z-index: 1;
    text-align: center;
}

.now-playing-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-1);
}

.now-playing-subtitle {
    font-size: var(--text-md);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-8);
}

.now-playing-progress {
    width: 100%;
    max-width: 500px;
    margin-bottom: var(--space-6);
}

.now-playing-progress-bar {
    width: 100%;
    height: 5px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    cursor: pointer;
    position: relative;
    margin-bottom: var(--space-2);
}

.now-playing-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.1s linear;
    position: relative;
}

.now-playing-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--text-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.now-playing-time {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.now-playing-controls {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.now-playing-ctrl-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.now-playing-ctrl-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.now-playing-ctrl-btn.active {
    color: var(--accent);
}

.now-playing-ctrl-btn svg {
    width: 24px;
    height: 24px;
}

.now-playing-play-btn {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    transition: all var(--transition-fast);
}

.now-playing-play-btn:hover {
    transform: scale(1.06);
    background: var(--accent);
}

.now-playing-play-btn svg {
    width: 28px;
    height: 28px;
}

.now-playing-ayah-info {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    text-align: center;
}

.now-playing-extras {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.now-playing-volume {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 80%;
    max-width: 300px;
    margin: 0 auto var(--space-4);
}

.now-playing-volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-subtle);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.now-playing-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.now-playing-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
}

/* ── Mobile Bottom Nav ── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    z-index: var(--z-player);
    padding: 0 var(--space-2);
}

.mobile-bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-1);
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 600;
    transition: color var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
}

.mobile-nav-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-nav-btn.active {
    color: var(--accent);
}

.mobile-nav-btn:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }

    /* Player bar is now fixed above the bottom nav, no need to shift nav */
    .mobile-bottom-nav.player-active {
        bottom: 0;
    }

    /* Adjust main content padding for bottom nav */
    .main-content {
        padding-bottom: calc(56px + var(--space-4)) !important;
    }

    /* When player is visible, add more padding for both bars */
    .mobile-bottom-nav.player-active~.main-content,
    body:has(.player-bar:not(.hidden)) .main-content {
        padding-bottom: calc(56px + 70px + var(--space-4)) !important;
    }

    /* Hide sidebar keyboard shortcuts on mobile */
    .sidebar .sidebar-section:last-child {
        display: none;
    }
}

/* ── Ayah Translation Row ── */
.ayah-translation {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 0 var(--space-4) var(--space-2) calc(36px + var(--space-4) + var(--space-4));
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-1);
}

/* ══════════════════════════════════════
   MODAL SYSTEM
   ══════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: var(--space-4);
}

.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6) var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: var(--text-xl);
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    justify-content: flex-end;
}

/* ══════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: calc(var(--player-height) + var(--space-4));
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 340px;
}

.toast.toast-success {
    border-left: 3px solid var(--accent);
}

.toast.toast-info {
    border-left: 3px solid var(--blue);
}

.toast.toast-warning {
    border-left: 3px solid var(--warning);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast.hiding {
    animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ══════════════════════════════════════
   THEME TOGGLE
   ══════════════════════════════════════ */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
    font-size: 18px;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
}

/* Light theme top-header override */
[data-theme="light"] .top-header {
    background: rgba(248, 249, 250, 0.85);
}

[data-theme="light"] .hero {
    background: linear-gradient(135deg,
            rgba(5, 150, 105, 0.1),
            rgba(16, 185, 129, 0.05),
            var(--bg-tertiary));
}

/* ══════════════════════════════════════
   KEYBOARD SHORTCUTS MODAL
   ══════════════════════════════════════ */
.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 var(--space-2);
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    font-family: var(--font-ui);
    color: var(--text-secondary);
}

.shortcut-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ══════════════════════════════════════
   QUEUE DRAWER
   ══════════════════════════════════════ */
.queue-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: 100vw;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    z-index: var(--z-overlay);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
}

.queue-drawer.closing {
    animation: slideOutRight 0.25s ease forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
    }
}

.queue-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.queue-drawer-header h2 {
    font-size: var(--text-xl);
    font-weight: 700;
}

.queue-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

.queue-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.queue-item:hover {
    background: var(--glass-bg-hover);
}

.queue-item-art {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.queue-item-sub {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.queue-item-remove {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    opacity: 0;
    transition: all var(--transition-fast);
}

.queue-item:hover .queue-item-remove {
    opacity: 1;
}

.queue-item-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.queue-item-remove svg {
    width: 14px;
    height: 14px;
}

.queue-drawer-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: center;
}

/* ══════════════════════════════════════
   AUDIO VISUALIZER
   ══════════════════════════════════════ */
.visualizer-canvas {
    width: 100%;
    height: 40px;
    opacity: 0.6;
}

.now-playing-visualizer {
    width: 100%;
    max-width: 500px;
    height: 60px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

/* ══════════════════════════════════════
   BOOKMARK INDICATOR
   ══════════════════════════════════════ */
.ayah-bookmark-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    opacity: 0;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.ayah-item:hover .ayah-bookmark-btn {
    opacity: 1;
}

.ayah-bookmark-btn.bookmarked {
    opacity: 1;
    color: var(--warning);
}

.ayah-bookmark-btn:hover {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.ayah-bookmark-btn svg {
    width: 14px;
    height: 14px;
}

/* ══════════════════════════════════════
   SURAH INFO MODAL
   ══════════════════════════════════════ */
.surah-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.surah-info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.surah-info-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.surah-info-value {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

.surah-info-context {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
    padding: var(--space-4);
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

/* ══════════════════════════════════════
   TRANSLATION SELECTOR
   ══════════════════════════════════════ */
.translation-select {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.translation-select:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

/* ══════════════════════════════════════
   SPEED DISPLAY BADGE
   ══════════════════════════════════════ */
.speed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 38px;
}

.speed-badge:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.speed-badge.active {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: var(--accent);
}

/* ══════════════════════════════════════
   SLEEP TIMER
   ══════════════════════════════════════ */
.sleep-timer-btn {
    position: relative;
}

.sleep-timer-btn .timer-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--radius-full);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════════
   SLEEP TIMER DROPDOWN
   ══════════════════════════════════════ */
.sleep-timer-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    z-index: var(--z-modal);
    min-width: 160px;
    display: none;
}

.sleep-timer-dropdown.open {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.sleep-timer-option {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: left;
    transition: background var(--transition-fast);
}

.sleep-timer-option:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.sleep-timer-option.active {
    color: var(--accent);
}

/* ══════════════════════════════════════
   FOCUS VISIBLE (Accessibility)
   ══════════════════════════════════════ */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* Lazy load fade-in */
.lazy-visible {
    animation: fadeInUp 0.35s ease both;
}

/* ══════════════════════════════════════
   BOOKMARK PAGE
   ══════════════════════════════════════ */
.bookmark-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.bookmark-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-1px);
}

.bookmark-card-art {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.bookmark-card-info {
    flex: 1;
    min-width: 0;
}

.bookmark-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.bookmark-card-sub {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.bookmark-card-note {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 2px;
}

.bookmark-card-remove {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    opacity: 0;
    transition: all var(--transition-fast);
}

.bookmark-card:hover .bookmark-card-remove {
    opacity: 1;
}

.bookmark-card-remove:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

.bookmark-card-remove svg {
    width: 16px;
    height: 16px;
}

/* ══════════════════════════════════════
   ERROR STATE WITH RETRY
   ══════════════════════════════════════ */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16);
    text-align: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
}

.error-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.error-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* ── Responsive adjustments for new components ── */
@media (max-width: 768px) {
    .queue-drawer {
        width: 100%;
    }

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

    .surah-info-grid {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        bottom: calc(70px + 56px + var(--space-4));
    }

    .toast {
        max-width: 100%;
    }

    /* Translation select full width */
    .translation-select {
        width: 100%;
        max-width: 100%;
    }

    /* Now playing overlay — mobile */
    .now-playing-overlay {
        padding: var(--space-4);
    }

    .now-playing-art {
        width: 200px;
        height: 200px;
        margin-bottom: var(--space-6);
    }

    .now-playing-title {
        font-size: var(--text-xl);
    }

    .now-playing-controls {
        gap: var(--space-4);
    }

    .now-playing-ctrl-btn {
        width: 40px;
        height: 40px;
    }

    .now-playing-play-btn {
        width: 56px;
        height: 56px;
    }

    /* Speed badge in player bar */
    .speed-badge {
        font-size: 10px;
        min-width: 32px;
        padding: 1px 6px;
    }

    /* Ayah text slightly smaller */
    .ayah-text {
        font-size: var(--text-lg);
        line-height: 2;
    }

    /* Ayah translation text */
    .ayah-translation {
        padding-left: var(--space-4);
    }

    /* Bookmark cards */
    .bookmark-card-remove {
        opacity: 1;
    }
}