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

:root {
    --bg-color: #000000;
    --surface: #121212;
    --primary: #5856d6;
    --primary-dim: rgba(88, 86, 214, 0.2);
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --hitbox: 72px; /* Minimum 64px, pushing to 72px for perfect car glances */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    width: 100%; height: 100vh; overflow: hidden;
    background: var(--bg-color); color: var(--text-main);
    font-family: 'Inter', sans-serif;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}
body { 
    display: flex; flex-direction: column; 
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Header & Tabs */
.car-header {
    display: flex; height: var(--hitbox); background: var(--surface);
    border-bottom: 2px solid #222; z-index: 10;
}
.car-tabs {
    display: flex; flex: 1;
}
.tab-btn {
    flex: 1; height: var(--hitbox); background: none; border: none;
    color: var(--text-dim); font-size: 1.25rem; font-family: 'Amiri', serif;
    font-weight: 700; cursor: pointer; transition: 0.2s;
    border-bottom: 4px solid transparent;
}
.tab-btn.active {
    color: var(--text-main); border-bottom-color: var(--primary);
    background: linear-gradient(to top, rgba(88,86,214,0.1), transparent);
}
.exit-car-btn {
    width: var(--hitbox); height: var(--hitbox);
    display: flex; align-items: center; justify-content: center;
    background: #2a2a2a; text-decoration: none;
    border-left: 2px solid #111;
}
.exit-car-btn svg { width: 32px; height: 32px; fill: #ff453a; }

/* Content Area */
.car-content { flex: 1; position: relative; overflow: hidden; }
.tab-panel {
    display: none; height: 100%; flex-direction: column;
    padding: 24px; animation: fadeIn 0.3s ease;
}
.tab-panel.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Prayer Text Container */
.prayer-text-container {
    flex: 1; overflow-y: auto; padding-bottom: 40px;
    font-family: 'Amiri', serif; font-size: 38px; line-height: 1.8; /* Huge text */
    text-align: right;
    scrollbar-width: none;
}
.prayer-text-container::-webkit-scrollbar { display: none; }
.prayer-chunk {
    margin-bottom: 36px; transition: color 0.3s;
    padding: 20px; background: rgba(255,255,255,0.03);
    border-radius: 16px; border: 1px solid rgba(255,255,255,0.05);
}

/* Scaffold for active sync highlighting */
.prayer-chunk.active-sync { 
    color: #ffffff; 
    border-color: var(--primary);
    background: var(--primary-dim);
    box-shadow: 0 0 20px rgba(88,86,214,0.1);
}

/* Audio Controls */
.audio-controls {
    display: flex; justify-content: space-evenly; align-items: center;
    height: 120px; background: var(--surface); border-radius: 24px;
    padding: 0 24px; margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}
.play-pause-btn {
    width: 90px; height: 90px; border-radius: 50%;
    background: linear-gradient(135deg, #5856d6, #af52de);
    border: none; color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 8px 24px rgba(88, 86, 214, 0.4);
}
.play-pause-btn svg { width: 44px; height: 44px; fill: currentColor; }

.skip-btn {
    width: var(--hitbox); height: var(--hitbox); background: rgba(255,255,255,0.05); 
    border: none; border-radius: 50%; color: var(--text-main); 
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.skip-btn svg { width: 36px; height: 36px; fill: currentColor; }

.speed-btn {
    width: var(--hitbox); height: var(--hitbox); background: rgba(255,255,255,0.05);
    border: none; border-radius: 16px; color: var(--text-main);
    font-size: 1.3rem; font-weight: bold; cursor: pointer;
    font-variant-numeric: tabular-nums;
}

/* Progress */
.progress-bar-container { display: flex; align-items: center; gap: 20px; padding: 0 10px; }
.progress-bar {
    flex: 1; height: 24px; background: #222; border-radius: 12px; 
    overflow: hidden; cursor: pointer; position: relative;
}
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #5856d6, #af52de); pointer-events: none; }
.time-readout { font-size: 1.4rem; font-family: monospace; font-variant-numeric: tabular-nums; color: var(--text-dim); }

/* Sync Spans */
.sync-span { transition: color 0.2s ease, text-shadow 0.2s ease; }
.sync-span.active-sync { color: var(--primary); text-shadow: 0 0 12px rgba(88,86,214,0.4); font-weight: bold; }

