:root {
    --bg-base: #000000;
    --bg-glow: radial-gradient(circle at 50% 20%, #1c1c1e 0%, #000000 80%);
    --panel-bg: #1c1c1e;
    --btn-bg: rgba(30, 30, 32, 0.9);
    --btn-bg-active: rgba(60, 60, 65, 0.9);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #8e8e93;
    --accent-main: #0a84ff;
    --accent-bg: rgba(10, 132, 255, 0.15);
    --kb-key-bg: #4a4a4c;
    --kb-key-active: #666668;
}

body.theme-gold { --bg-base: #0a0800; --bg-glow: radial-gradient(circle at 50% 20%, #2a2410 0%, #0a0800 80%); --panel-bg: #1a160a; --btn-bg: rgba(42, 36, 16, 0.9); --btn-bg-active: rgba(70, 60, 30, 0.9); --border-color: rgba(255, 215, 0, 0.15); --text-main: #fcf4d4; --accent-main: #ffd700; --accent-bg: rgba(255, 215, 0, 0.15); --kb-key-bg: #383015; --kb-key-active: #50451e; }
body.theme-emerald { --bg-base: #000a05; --bg-glow: radial-gradient(circle at 50% 20%, #002412 0%, #000a05 80%); --panel-bg: #001a0d; --btn-bg: rgba(0, 40, 20, 0.9); --btn-bg-active: rgba(0, 70, 35, 0.9); --border-color: rgba(0, 200, 83, 0.15); --text-main: #e0ffe8; --accent-main: #00c853; --accent-bg: rgba(0, 200, 83, 0.15); --kb-key-bg: #00331a; --kb-key-active: #005029; }
body.theme-purple { --bg-base: #05000a; --bg-glow: radial-gradient(circle at 50% 20%, #1f0b3b 0%, #05000a 80%); --panel-bg: #140727; --btn-bg: rgba(30, 10, 60, 0.9); --btn-bg-active: rgba(50, 20, 90, 0.9); --border-color: rgba(179, 136, 255, 0.15); --text-main: #f0e6ff; --accent-main: #b388ff; --accent-bg: rgba(179, 136, 255, 0.15); --kb-key-bg: #2a154d; --kb-key-active: #402075; }

body { margin: 0; padding: 0; background-color: var(--bg-base); color: var(--text-main); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; height: 100vh; overflow: hidden; touch-action: manipulation; -webkit-user-select: none; -webkit-transform: translateZ(0); }
body.lang-ar { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Amiri", Arial, sans-serif; }

.bg-glow { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-glow); z-index: -1; transition: background 0.3s ease; }
#scroll-area { height: 100vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 350px; box-sizing: border-box; transition: filter 0.3s ease; }
#scroll-area.search-active { background: rgba(0,0,0,0.5); }

.top-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 30px; max-width: 1000px; margin: 0 auto; margin-top: 20px; }
.header-icon { background: var(--btn-bg); color: var(--text-main); border: 1px solid var(--border-color); width: 50px; height: 50px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.search-container { flex-grow: 1; margin: 0 20px; position: relative; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem; }

#search-input { width: 100%; background: var(--btn-bg); border: 2px solid transparent; padding: 15px 15px 15px 45px; border-radius: 25px; color: var(--text-main); font-size: 1.1rem; outline: none; box-sizing: border-box; font-family: inherit; transition: border-color 0.2s, background 0.3s; }
#search-input.search-active { border-color: var(--accent-main); background: var(--panel-bg); }
#search-input::placeholder { color: var(--text-muted); }

.button-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0 30px; max-width: 1000px; margin: 20px auto; }
.surah-btn { padding: 22px 10px; font-size: 1.2rem; font-weight: 500; background: var(--btn-bg); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; will-change: transform, background-color; transform: translateZ(0); transition: background 0.3s, border-color 0.3s; }
.tap-animate { animation: tap-pulse 0.2s ease-out; }
@keyframes tap-pulse { 0% { transform: scale(1); background: var(--btn-bg); } 50% { transform: scale(0.92); background: var(--btn-bg-active); } 100% { transform: scale(1); background: var(--btn-bg); } }
.surah-btn.playing { border-color: var(--accent-main); background: var(--accent-bg); color: var(--accent-main); font-weight: bold; }

/* Keyboard */
#keyboard-container { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--panel-bg); padding: 15px 10px 30px 10px; box-sizing: border-box; border-top: 1px solid var(--border-color); box-shadow: 0 -10px 30px rgba(0,0,0,0.8); z-index: 10000; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s; }
#keyboard-container.active { transform: translateY(0); }
.kb-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 12px; }
.kb-key { background: var(--kb-key-bg); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 10px; font-size: 1.4rem; font-weight: 500; padding: 18px 0; flex-grow: 1; max-width: 80px; cursor: pointer; -webkit-tap-highlight-color: transparent; will-change: transform; transform: translateZ(0); box-shadow: 0 2px 0 rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.kb-key.wide { max-width: 120px; background: var(--btn-bg); font-size: 1.3rem; }
.kb-key.space { max-width: 500px; background: var(--kb-key-bg); }
.kb-key.action-done { max-width: 150px; background: var(--accent-main); color: var(--bg-base); font-weight: bold; font-size: 1.2rem; border: none; }
.kb-key:active, .kb-key.pressed { background: var(--kb-key-active); transform: scale(0.95); }

/* Player Bar */
#player-bar { position: fixed; bottom: 20px; left: 0; right: 0; margin: 0 auto; width: 90%; max-width: 700px; background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 30px; padding: 20px 30px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,0.8); z-index: 9999; transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s, background 0.3s, border-color 0.3s; }
#player-bar.hidden { transform: translateY(150%); opacity: 0; pointer-events: none; }
.player-info { margin-bottom: 12px; }
#now-playing-title { font-size: 1.2rem; font-weight: 600; color: var(--text-main); }
.timeline-container { display: flex; align-items: center; width: 100%; gap: 15px; margin-bottom: 20px; font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
#seek-bar { flex-grow: 1; -webkit-appearance: none; background: transparent; height: 30px; }
#seek-bar::-webkit-slider-runnable-track { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
#seek-bar::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%; background: var(--text-main); margin-top: -5px; }

.controls { display: flex; gap: 30px; align-items: center; justify-content: center; width: 100%; }
.icon-btn { background: transparent; color: var(--text-main); border: none; font-size: 1.4rem; -webkit-tap-highlight-color: transparent; opacity: 0.7; padding: 10px; will-change: transform; transform: translateZ(0); }
.icon-btn.active-state { color: var(--accent-main); opacity: 1; }
.main-play { font-size: 1.8rem; opacity: 1; width: 60px; height: 60px; background: var(--text-main); color: var(--bg-base); border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0; transition: background 0.3s, color 0.3s; }
.main-play i.fa-play { margin-left: 5px; }

/* App Overlay */
#app-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 15000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
#app-overlay.active { opacity: 1; pointer-events: auto; }

/* Right Panel (Settings) */
#settings-panel { position: fixed; top: 0; right: 0; height: 100%; width: 350px; background: var(--panel-bg); border-left: 1px solid var(--border-color); box-shadow: -10px 0 30px rgba(0,0,0,0.8); z-index: 15001; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s, border-color 0.3s; display: flex; flex-direction: column; will-change: transform; }
#settings-panel.active { transform: translateX(0); }
.settings-header { display: flex; justify-content: space-between; align-items: center; padding: 30px 20px 15px; border-bottom: 1px solid var(--border-color); }
.settings-header h2 { margin: 0; font-size: 1.8rem; color: var(--text-main); }
.settings-content { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.settings-group { margin-bottom: 30px; }
.settings-group h3 { font-size: 1rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 15px; letter-spacing: 1px; }

/* Settings Toggles & Dropdowns (Screensaver) */
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.custom-toggle { position: relative; display: inline-block; width: 60px; height: 34px; }
.custom-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--kb-key-bg); transition: .3s; border-radius: 34px; border: 1px solid var(--border-color); }
.toggle-slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.custom-toggle input:checked + .toggle-slider { background-color: #34c759; border-color: #34c759; }
.custom-toggle input:checked + .toggle-slider:before { transform: translateX(26px); }

.timer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.time-btn { background: var(--btn-bg); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 0; font-size: 1rem; font-weight: bold; cursor: pointer; transition: background 0.2s, transform 0.1s; -webkit-tap-highlight-color: transparent; }
.time-btn:active { transform: scale(0.95); }
.time-btn.active { background: var(--accent-main); color: var(--bg-base); border-color: var(--accent-main); }

/* Sleek iOS Action Button */
.ios-action-btn { width: 100%; background: var(--btn-bg); color: var(--text-main); border: 1px solid var(--border-color); padding: 18px; border-radius: 16px; font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; transition: transform 0.1s, background 0.2s; -webkit-tap-highlight-color: transparent; }
.ios-action-btn i { color: var(--accent-main); font-size: 1.4rem; }
.ios-action-btn:active { background: var(--btn-bg-active); transform: scale(0.96); }

/* Segmented Control & Theme Picker */
.segmented-control { display: flex; background: var(--btn-bg); border-radius: 10px; padding: 4px; border: 1px solid var(--border-color); }
.seg-btn { flex: 1; padding: 10px; border: none; background: transparent; color: var(--text-main); font-size: 1rem; border-radius: 8px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg-btn.active { background: var(--accent-main); color: var(--bg-base); font-weight: bold; }
.theme-picker { display: flex; gap: 15px; justify-content: space-between; }
.theme-circle { width: 55px; height: 55px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 0.1s; }
.theme-circle.default { background: linear-gradient(135deg, #1c1c1e, #000000); border-color: rgba(255,255,255,0.2); }
.theme-circle.gold { background: linear-gradient(135deg, #2a2410, #0a0800); border-color: rgba(255,215,0,0.2); }
.theme-circle.emerald { background: linear-gradient(135deg, #002412, #000a05); border-color: rgba(0,200,83,0.2); }
.theme-circle.purple { background: linear-gradient(135deg, #1f0b3b, #05000a); border-color: rgba(179,136,255,0.2); }
.theme-circle.active { transform: scale(1.1); box-shadow: 0 0 15px var(--accent-main); border-color: var(--accent-main); }

/* Reciter Bottom Sheet Modal */
.modal-sheet { position: fixed; bottom: 0; left: 0; right: 0; height: 85vh; background: var(--panel-bg); border-radius: 30px 30px 0 0; z-index: 15002; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s; box-shadow: 0 -10px 40px rgba(0,0,0,0.8); display: flex; flex-direction: column; will-change: transform; }
.modal-sheet.active { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 25px 30px; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { margin: 0; font-size: 2rem; color: var(--text-main); }
.modal-content { padding: 20px 30px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

#reciters-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding-bottom: 50px; }
.reciter-card { background: var(--btn-bg); border: 2px solid transparent; border-radius: 20px; padding: 20px; display: flex; align-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 0.2s, border-color 0.2s, transform 0.1s; will-change: transform; transform: translateZ(0); }
.reciter-card:active { transform: scale(0.97); }
.reciter-card.active { border-color: var(--accent-main); background: var(--accent-bg); }

.reciter-img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; background: #333; border: 2px solid rgba(255,255,255,0.1); flex-shrink: 0; margin-right: 60px; }
.reciter-info { display: flex; flex-direction: column; }
.reciter-name { font-size: 1.3rem; font-weight: bold; color: var(--text-main); margin: 0; margin-bottom: 8px; }
.reciter-bio { font-size: 0.95rem; color: var(--text-muted); line-height: 1.4; margin: 0; }

.settings-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-color); text-align: center; color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; }
.settings-footer p { margin: 5px 0; }

body.lang-ar .reciter-card { flex-direction: row-reverse; text-align: right; }
body.lang-ar .reciter-img { margin-right: 0; margin-left: 60px; }


/* ========================================= */
/* --- NEW PREMIUM SCREENSAVER OVERLAY --- */
/* ========================================= */
#screensaver-overlay {
    position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%;
    background-color: #030305; color: #fff; z-index: 99999; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none; 
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden; cursor: pointer;
}
#screensaver-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

#screensaver-overlay .ambient-bg {
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(15, 25, 45, 0.4), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(40, 20, 50, 0.4), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(5, 5, 8, 1), #000 80%);
    animation: slowDrift 20s infinite alternate ease-in-out;
    z-index: 1;
}
@keyframes slowDrift {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(2%, 2%); }
}

#screensaver-overlay .screensaver-content { 
    position: relative; z-index: 2; text-align: center; width: 100%;
    display: flex; flex-direction: column; align-items: center;
    animation: float 8s ease-in-out infinite alternate;
}
@keyframes float {
    0% { transform: translateY(0px); }
    100% { transform: translateY(12px); }
}

#screensaver-time { font-size: 12rem; font-weight: 200; letter-spacing: -3px; margin: 0; line-height: 1; text-shadow: 0 10px 40px rgba(0,0,0,0.9); }
#screensaver-date { font-size: 2rem; font-weight: 400; color: #8e8e93; margin: 15px 0 40px; text-transform: uppercase; letter-spacing: 3px; }

#screensaver-overlay .weather-container {
    display: inline-flex; align-items: center; 
    /* Massive spacing between the icon and the text */
    gap: 30px; 
    background: rgba(30, 30, 32, 0.4); padding: 15px 35px;
    border-radius: 50px; border: 1px solid rgba(255,255,255,0.05);
    font-size: 1.6rem; color: #e0e0e0; margin-bottom: 50px;
}
#screensaver-overlay .weather-container i { color: #0a84ff; font-size: 1.8rem; }
/* Backup spacing for older iPads */
#screensaver-overlay .temp-val { font-weight: bold; color: #fff; margin-left: 15px; } 

.screensaver-dua { max-width: 80%; text-align: center; }
.dua-ar { font-size: 2.8rem; color: #fff; font-family: "Amiri", Arial, sans-serif; margin-bottom: 15px; line-height: 1.6; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.dua-en { font-size: 1.2rem; color: #999; font-weight: 300; line-height: 1.5; font-style: italic; }

/* ========================================= */
/* --- FEEDBACK PAGE STYLES --- */
/* ========================================= */
.feedback-header { display: flex; align-items: center; padding: 40px 30px 20px; max-width: 1000px; margin: 0 auto; gap: 20px; }
.feedback-header h1 { margin: 0; font-size: 2.2rem; font-weight: 700; color: var(--text-main); flex-grow: 1; }

.feedback-category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1000px; margin: 0 auto 30px; padding: 0 30px; }
.feedback-cat-btn { background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 24px; padding: 30px 15px; display: flex; flex-direction: column; align-items: center; gap: 15px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: transform 0.1s, background 0.2s, border-color 0.2s; -webkit-tap-highlight-color: transparent; }
.feedback-cat-btn i { font-size: 2.2rem; color: var(--accent-main); background: var(--accent-bg); padding: 20px; border-radius: 50%; }
.feedback-cat-btn span { color: var(--text-main); font-size: 1.1rem; font-weight: 600; text-align: center; line-height: 1.3; }
.feedback-cat-btn:active { transform: scale(0.94); background: var(--btn-bg-active); }

#feedback-input-area { max-width: 1000px; margin: 0 auto 30px; padding: 0 30px; display: none; animation: fadeIn 0.3s ease; }
#feedback-input-area.active { display: block; }
#feedback-question { font-size: 1.4rem; margin-bottom: 15px; color: var(--accent-main); font-weight: bold; }
#feedback-text-input { width: 100%; background: var(--panel-bg); border: 2px solid var(--accent-main); border-radius: 16px; padding: 20px; color: var(--text-main); font-size: 1.2rem; font-family: inherit; box-sizing: border-box; outline: none; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }

#submitted-feedbacks { max-width: 1000px; margin: 0 auto; padding: 0 30px 100px; display: flex; flex-direction: column; }
.swipe-container { position: relative; border-radius: 20px; margin-bottom: 30px; background: #ff3b30; box-shadow: 0 4px 15px rgba(0,0,0,0.3); overflow: hidden; }
.swipe-action { position: absolute; top: 0; bottom: 0; right: 0; width: 90px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: white; cursor: pointer; z-index: 1; }
.swipe-content { background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 25px; display: flex; align-items: center; gap: 20px; position: relative; z-index: 2; transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.2s, border-color 0.2s; -webkit-tap-highlight-color: transparent; }
.swipe-content.swiped { transform: translateX(-90px); }

.feedback-card-content { flex-grow: 1; }
.feedback-card-category { font-size: 0.95rem; color: var(--accent-main); font-weight: bold; margin: 0 0 8px 0; text-transform: uppercase; letter-spacing: 1px; }
.feedback-card-text { font-size: 1.3rem; color: var(--text-main); margin: 0; font-weight: 500;}

.feedback-status-icon { font-size: 2rem; width: 40px; text-align: center; transition: color 0.2s; }
.state-0 .feedback-status-icon { color: var(--border-color); } 
.state-1 { border-color: #ff3b30; } .state-1 .feedback-status-icon { color: #ff3b30; }
.state-2 { border-color: #ff9500; } .state-2 .feedback-status-icon { color: #ff9500; }
.state-3 { border-color: #34c759; } .state-3 .feedback-status-icon { color: #34c759; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

body.lang-ar .feedback-header { flex-direction: row-reverse; }
body.lang-ar .feedback-header h1 { text-align: right; }
body.lang-ar #feedback-question { text-align: right; }
body.lang-ar #feedback-text-input { text-align: right; }
body.lang-ar .swipe-content { flex-direction: row-reverse; text-align: right; }
body.lang-ar .feedback-card-category { text-align: right; }
body.lang-ar .feedback-card-text { text-align: right; }
body.lang-ar .swipe-action { right: auto; left: 0; }
body.lang-ar .swipe-content.swiped { transform: translateX(90px); }