/* * 
 * TUWA - The Sacred Valley
 * Apple HIG Compliant Architecture (macOS/iOS/tvOS/visionOS)
 * Refactored for uncompromising aesthetic perfection.
 */

/* --- 0. APPLE HIG GLOBAL VARIABLES --- */
:root {
    --vh: 100vh;
    
    /* Apple System Colors - Light Mode (Default) */
    --bg: #F2F2F7; /* System Grouped Background Light */
    --surface: #FFFFFF; /* Elevated Surface */
    --surface-secondary: #F2F2F7;
    
    --text-primary: #000000;
    --text-secondary: rgba(60, 60, 67, 0.6); /* System Gray Secondary */
    --text-tertiary: rgba(60, 60, 67, 0.3);
    
    --accent: #000000;
    --accent-blue: #007AFF; /* Apple Blue */
    --accent-indigo: #5856D6; /* Apple Indigo */
    --accent-red: #FF3B30; /* Apple Red */
    --accent-green: #34C759; /* Apple Green */
    --accent-orange: #FF9500; /* Apple Orange */
    --accent-yellow: #FFCC00; /* Apple Yellow */
    
    /* Apple Glass Materials (Light) */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --glass-vibrancy: blur(20px) saturate(180%);
    
    /* Geometry & Squircles */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-squircle: 24px;
    --radius-pill: 999px;
    
    /* Fluid Spring Animation */
    --transition-spring: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-snappy: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    
    /* Microscopic Multi-Layered Shadows */
    --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.04), 0 2px 5px rgba(0, 0, 0, 0.02);
    --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-floating: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Apple System Colors - Dark Mode */
        --bg: #1C1C1E; /* System Grouped Background Dark */
        --surface: #2C2C2E;
        --surface-secondary: #3A3A3C;
        
        --text-primary: #FFFFFF;
        --text-secondary: rgba(235, 235, 245, 0.6);
        --text-tertiary: rgba(235, 235, 245, 0.3);
        
        --accent: #FFFFFF;
        --accent-blue: #0A84FF;
        --accent-indigo: #5E5CE6;
        --accent-red: #FF453A;
        --accent-green: #30D158;
        --accent-orange: #FF9F0A;
        --accent-yellow: #FFD60A;
        
        /* Apple Glass Materials (Dark) */
        --glass-bg: rgba(44, 44, 46, 0.65);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-highlight: rgba(255, 255, 255, 0.08);
        --glass-vibrancy: blur(24px) saturate(200%);
        
        --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.1);
        --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
        --shadow-floating: 0 24px 48px rgba(0, 0, 0, 0.4), 0 8px 16px rgba(0, 0, 0, 0.2);
    }
}

/* --- Accessibility: Reduce Motion & Reduce Transparency (HIG §47) --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .island-search-box,
    .enter-trigger,
    .surah-card,
    #search-overlay,
    #hero-subtitle-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: var(--surface) !important;
    }
    .island-search-box.ai-thinking::before {
        opacity: 0.4;
    }
}

/* --- 1. GLOBAL RESET & TYPOGRAPHY --- */
* {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

html {
    background-color: var(--bg);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.47059;
    font-size: 17px;
    letter-spacing: -0.022em;
    font-weight: 400;
    height: 100vh;
    height: -webkit-fill-available;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease;
    touch-action: manipulation;
}

/* Base Image Setup */
img:not([src]), img[src=""], img[src="#"] { visibility: hidden !important; }
img { object-fit: cover; }

/* --- 2. APP BRANDING --- */
.app-brand {
    position: fixed;
    top: max(24px, env(safe-area-inset-top, 24px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    height: 48px;
    transition: var(--transition-spring);
    cursor: pointer;
    padding: 0 16px;
}

html[dir="rtl"] .app-brand { }

.app-brand:hover {
    opacity: 0.85;
}

.brand-icon img {
    width: 44px;
    height: 44px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.brand-text {
    font-weight: 700;
    font-size: 32px;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    line-height: 1;
    white-space: nowrap;
}

@media screen and (max-width: 768px) {
    .brand-text { display: none; }
    .app-brand { top: max(16px, env(safe-area-inset-top, 16px)); }
}

/* --- 3. DYNAMIC ISLAND SEARCH BOX --- */
#island-search-wrapper {
    position: fixed;
    bottom: max(40px, calc(env(safe-area-inset-bottom, 0px) + 16px));
    left: max(16px, env(safe-area-inset-left, 16px));
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: none;
    z-index: 9999;
}

.island-search-box {
    pointer-events: auto;
    position: relative;
    z-index: 10;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-vibrancy);
    -webkit-backdrop-filter: var(--glass-vibrancy);
    border: 0.5px solid var(--glass-border);
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    padding: 12px 16px;
    width: 280px;
    min-height: 44px;
    box-shadow: var(--shadow-floating);
    transition: var(--transition-spring);
    transform: translateY(0) scale(1);
}

.search-icon-wrapper {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    margin-right: 12px;
}

#island-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.02em;
    width: 100%;
    outline: none;
    min-height: 44px;
}

#island-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.island-search-box:focus-within,
.island-search-box:hover {
    width: 320px;
    background: var(--surface);
    border-color: var(--glass-highlight);
    box-shadow: var(--shadow-floating);
}

/* Enter Trigger Button - HIG Section 26: minimum 44pt touch target */
.enter-trigger {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-vibrancy);
    -webkit-backdrop-filter: var(--glass-vibrancy);
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-elevated);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: auto;
    transition: var(--transition-spring);
    color: var(--text-primary);
    cursor: pointer;
}

.enter-trigger:hover, 
.enter-trigger:focus {
    background: var(--surface);
    transform: scale(1.05);
    outline: none;
}

.island-search-box:focus-within + .enter-trigger,
.island-search-box:hover + .enter-trigger {
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.85);
    pointer-events: none;
}

/* Apple Intelligence Inspired Glow — HIG Compliant */
/* §12: Static gradient border on glass (no continuous animation).
   §47: Reduced-motion kills all animations; reduced-transparency removes blur. */
.island-search-box.ai-thinking {
    width: 280px !important;
    transform: translateY(0) scale(1) !important;
    background: var(--surface);
    /* Subtle entrance on state change (HIG §12: animate only on state changes) */
    animation: ai-think-fadein 0.4s ease-out both;
}

.island-search-box.ai-thinking::before {
    content: '';
    position: absolute;
    inset: -2px;
    z-index: -1;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--accent-blue) 120deg, 
        var(--accent-indigo) 240deg,
        transparent 360deg
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 2px;
}

@keyframes ai-think-fadein {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes island-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.island-error {
    animation: island-shake 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    border-color: var(--accent-red) !important;
}

/* --- 4. DASHBOARD & HERO VIEW --- */
#dashboard-view {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

#dashboard-view.active { display: flex; animation: fade-in 0.6s var(--transition-spring); }

@keyframes fade-in { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.hero-banner {
    height: 55vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 max(16px, env(safe-area-inset-left, 16px));
    padding-right: max(16px, env(safe-area-inset-right, 16px));
    overflow: hidden;
    flex-shrink: 0;
    transition: var(--transition-spring);
}

.hero-shadow-overlay {
    position: absolute; inset: 0;
    z-index: 2;
    background: linear-gradient(to right, var(--bg) 0%, transparent 60%);
}

.hero-content {
    max-width: 700px;
    z-index: 5;
    position: relative;
    margin-top: 4vh;
}

.hero-super {
    display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px;
    font-weight: 600; color: var(--text-secondary);
    letter-spacing: 0.04em; text-transform: uppercase; font-size: 1.2rem;
}

.hero-super span.badge {
    background: var(--glass-bg);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    border: 0.5px solid var(--glass-border);
    backdrop-filter: var(--glass-vibrancy);
}

.hero-title-text, .heroz-title-text {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    font-size: clamp(34px, 6vw, 96px);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    text-shadow: var(--shadow-soft);
}

.heroz-title-text { margin-bottom: 80px; }

.hero-subtitle {
    display: none;
    font-size: 22px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

/* --- 5. CONTENT SECTIONS & SURAH CARDS (HIG Sections 11, 36) --- */
.row-section {
    padding: 16px 0;
    position: relative;
    z-index: 5;
}

.row-header {
    margin-left: max(16px, env(safe-area-inset-left, 16px));
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.card-scroller {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px max(16px, env(safe-area-inset-left, 16px)) 32px max(16px, env(safe-area-inset-right, 16px));
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.surah-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    aspect-ratio: 16 / 9;
    background: var(--surface);
    border: 0.5px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-spring);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    min-height: 44px;
}

.surah-card:hover, .surah-card:focus {
    transform: scale(1.02) translateY(-4px);
    box-shadow: var(--shadow-floating);
    border-color: var(--text-tertiary);
    z-index: 10;
    outline: none;
}

.card-bg-num {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 6.4rem;
    font-weight: 700;
    color: var(--text-tertiary);
    line-height: 1;
    letter-spacing: -0.04em;
    opacity: 0.3;
}

.card-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
}

/* --- 6. SEARCH OVERLAY (HIG Section 16) --- */
#search-overlay {
    position: fixed; inset: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-vibrancy);
    -webkit-backdrop-filter: var(--glass-vibrancy);
    z-index: 2500;
    display: none;
    grid-template-columns: 320px 1fr;
}
#search-overlay.active { display: grid; }

.keyboard-section {
    background: var(--surface);
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    border-right: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

#search-input-display {
    background: var(--surface-secondary);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 17px;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-bottom: 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
    border: 0.5px solid var(--glass-border);
}

.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.key {
    aspect-ratio: 1;
    background: var(--surface-secondary);
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 0.5px solid var(--glass-border);
    transition: var(--transition-snappy);
    min-height: 44px;
    min-width: 44px;
}

.key:hover, .key:focus {
    background: var(--text-primary);
    color: var(--bg);
    box-shadow: var(--shadow-elevated);
    z-index: 2;
    outline: none;
}

.key.wide { grid-column: span 2; aspect-ratio: auto; }

.results-section {
    padding: 32px;
    overflow-y: auto;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding-bottom: 80px;
}

.no-results {
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 500;
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 40px;
}

/* --- 7. CINEMA / PLAYER VIEW --- */
#cinema-view {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    opacity: 0; pointer-events: none;
    transition: opacity 0.6s var(--transition-spring);
    background-color: var(--bg);
}
#cinema-view.active { opacity: 1; pointer-events: all; z-index: 1000; }

#loading-overlay {
    position: fixed; inset: 0;
    background-color: var(--bg);
    z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.5s ease;
}

.loader-spinner {
    width: 48px; height: 48px;
    border: 3px solid var(--glass-border);
    border-radius: 50%;
    border-top-color: var(--text-primary);
    animation: apple-spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 2rem;
}

@keyframes apple-spin { 100% { transform: rotate(360deg); } }

.start-btn {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-vibrancy);
    -webkit-backdrop-filter: var(--glass-vibrancy);
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-elevated);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 600;
    padding: 16px 40px;
    cursor: pointer;
    transition: var(--transition-spring);
}

.start-btn:hover {
    background: var(--surface);
    transform: scale(1.05);
    box-shadow: var(--shadow-floating);
}

.container {
    flex: 1;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 32px;
    padding-bottom: 120px;
    position: relative;
    z-index: 1;
}

#chapter-title {
    position: fixed; top: max(40px, env(safe-area-inset-top, 40px)); left: max(16px, env(safe-area-inset-left, 16px));
    color: var(--text-primary);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.04em;
    z-index: 100;
    transition: var(--transition-spring);
}

#cinema-view.active #chapter-title { display: none !important; }
body.idle #chapter-title { opacity: 0; transform: translateY(-20px); }

#translation-text {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: -0.02em;
    padding: 0 16px;
    transition: opacity 0.4s ease;
}

/* --- 8. PLAYER ISLAND + SELECTS ROW (HIG Sections 28, 29) --- */
#selects-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    flex-wrap: wrap;
    transition: var(--transition-spring);
}
body.idle #selects-row { opacity: 0; pointer-events: none; }
#selects-row .custom-select-wrapper .custom-select-trigger {
    font-size: 15px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--surface-secondary);
    border: 0.5px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-snappy);
    font-weight: 500;
}
#selects-row .custom-select-wrapper .custom-select-trigger:hover {
    color: var(--text-primary);
    background: var(--surface);
}
#selects-row .custom-options { bottom: 100%; top: auto; margin-bottom: 8px; }

#player-island {
    position: fixed;
    bottom: max(40px, calc(env(safe-area-inset-bottom, 0px) + 16px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-vibrancy);
    -webkit-backdrop-filter: var(--glass-vibrancy);
    border: 0.5px solid var(--glass-border);
    border-radius: 40px;
    box-shadow: var(--shadow-floating);
    transition: var(--transition-spring);
    user-select: none;
    -webkit-user-select: none;
}

body.idle #player-island { transform: translate(-50%, 150%); opacity: 0; }
.island-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.island-play-btn:hover { background: rgba(255, 255, 255, 0.25); }
.island-play-btn:active { transform: scale(0.9); }

.island-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tuwa branding inside the island bar — compact sizing (HIG §26: 44pt touch target, visual can be smaller) */
#player-island .app-brand {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    z-index: auto;
    height: 44px;
    padding: 0 4px;
    gap: 6px;
    background: transparent;
    border: none;
    box-shadow: none;
    flex-shrink: 0;
}
#player-island .brand-icon img {
    width: 22px;
    height: 22px;
    filter: none;
}
#player-island .brand-text {
    font-size: 15px;
    line-height: 1;
    font-weight: 600;
}

.island-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.island-volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.island-icon-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.island-icon-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.1); }
.island-icon-btn:active { transform: scale(0.9); }

/* Volume popover slider (HIG Section 33) */
.volume-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.92);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    padding: 12px 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-vibrancy);
    -webkit-backdrop-filter: var(--glass-vibrancy);
    border: 0.5px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-floating);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 110;
}
.volume-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--glass-bg);
}
.island-volume-wrap.volume-open .volume-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
}

.island-volume-slider {
    width: 120px; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}
.island-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    border: none;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform 0.15s;
}
.island-volume-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.island-volume-slider::-moz-range-thumb {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    border: none;
}

/* EQ & Audio Out buttons inside island */
#player-island #eq-btn,
#player-island #audio-out-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
#player-island #eq-btn:hover,
#player-island #audio-out-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.1); }
#player-island #eq-btn:active,
#player-island #audio-out-btn:active { transform: scale(0.9); }
#player-island #eq-btn.eq-active,
#player-island #audio-out-btn.out-active { color: var(--text-primary); }

/* Translation select inside island */
#player-island #translationSelectWrapper .custom-select-trigger {
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    font-weight: 500;
    letter-spacing: 0.02em;
    min-height: 44px;
}
#player-island #translationSelectWrapper .custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.18);
}
#player-island #translationSelectWrapper .custom-options {
    bottom: 100%;
    top: auto;
    margin-bottom: 8px;
}

/* Custom Select Dropdowns */
select {
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 500;
    padding: 10px 32px 10px 16px;
    background-color: var(--surface-secondary);
    color: var(--text-primary);
    border: 0.5px solid var(--glass-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    appearance: none;
    transition: var(--transition-snappy);
}

select:focus, select:hover {
    outline: none;
    background-color: var(--surface);
    box-shadow: var(--shadow-soft);
}

/* --- 9. TRANSITION LAYER --- */
#transition-fade-layer {
    position: fixed; inset: 0;
    background-color: var(--bg);
    z-index: 9999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.8s var(--transition-spring);
}
#transition-fade-layer.active { opacity: 1; pointer-events: all; }

/* --- 10. RESPONSIVE DESIGN (HIG Sections 3, 11) --- */
@media screen and (max-width: 768px) {
    #player-island {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
        padding: 8px 12px;
        gap: 8px;
    }
    .volume-popover { padding: 8px 12px; }
    .island-volume-slider { width: 80px; }
    #selects-row { gap: 8px; padding: 8px; }
    #selects-row .custom-select-wrapper .custom-select-trigger { font-size: 13px; padding: 8px; }
    
    #chapter-title {
        position: relative; top: 0; left: 0;
        text-align: center; margin-bottom: 24px;
    }
    
    .hero-title-text { text-align: left; margin-left: 0; }
}

@media screen and (min-width: 2500px) {
    .surah-card { flex: 0 0 320px; }
    .hero-banner { padding: 0 48px; }
}

/* --- IMPORTED: inline-styles.css content (consolidated) --- */
.row-header-top-results { margin-top: 0; }
.row-section-hidden { display: none; }
.row-section-padding-bottom { padding-bottom: 100px; }

.ai-recommendation-badge {
    font-size: 12px;
    background: #0A84FF;
    color: #FFFFFF;
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase; 
}

.splash-footer-description {
    margin-top: 1rem;
    font-size: 15px;
    color: rgba(235, 235, 245, 0.6);
    letter-spacing: -0.24px;
}

.text {
    color: #FFFFFF;
    font-weight: 500;
    text-shadow: 0px 4px 16px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.02em;
}

.glass-panel {
    background: rgba(30, 30, 30, 0.65);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-radius: 16px;
    border: 0.5px solid rgba(255, 255, 255, 0.15);
}

/* --- IMPORTED: user-select.css content (consolidated, HIG Section 37) --- */
.custom-select-trigger,
.nav-item,
.app-brand,
.surah-card,
.enter-trigger,
.island-play-btn,
.island-icon-btn,
#eq-btn,
#audio-out-btn,
.key {
    -webkit-user-select: none;
    user-select: none;
}

#translation-text,
#search-input-display,
.card-title,
.hero-title-text,
.heroz-title-text,
body,
p,
h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    user-select: text;
}