/*
File Name: styles.css
Version: 0.16.28
Description: Surah selector promoted to main title width, Settings Grid expanded for Translation labels.
*/

@import url('https://fonts.googleapis.com/css2?family=Amiri+Quran&display=swap');

:root {
  --bg-base: #050505;
  --bg-surface: rgba(18, 18, 18, 0.65);
  --bg-surface-elevated: rgba(30, 30, 30, 0.7);
  --bg-surface-active: rgba(25, 25, 25, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-active: rgba(82, 82, 82, 0.8);
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent-primary: #e5e5e5;
  --accent-highlight: #d4d4d4;
  --accent-glow: rgba(255, 255, 255, 0.08);

  --badge-ok-bg: rgba(52, 211, 153, 0.2);
  --badge-ok-color: #34d399; 
  --badge-haram-bg: rgba(244, 63, 94, 0.2);
  --badge-haram-color: #fb7185; 

  --quran-font-size: 2.2rem;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; -ms-user-select: none; user-select: none; 
}

button, a, input, select, .date-picker-button, .icon-btn, .lang-btn {
  touch-action: manipulation;
}

html, body {
  background-color: var(--bg-base); color: var(--text-primary); font-family: var(--font-stack);
  width: 100vw; height: 100vh; overflow: hidden; -webkit-font-smoothing: antialiased;
}

#sky-bg { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; width: 100vw; height: 100vh; transition: background 3s ease, opacity 0.8s ease; pointer-events: none; }
#celestial-body { position: absolute; width: 80px; height: 80px; border-radius: 50%; z-index: 2; transform: translate(-50%, -50%); pointer-events: none; transition: top 2s ease-out, left 2s ease-out, opacity 0.8s ease; }
#clouds-layer { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 3; pointer-events: none; overflow: hidden; width: 100vw; height: 100vh; transition: opacity 0.8s ease; }

/* DYNAMIC BACKGROUND FADING FOR QURAN DARK MODE */
body.quran-active[data-quran-theme="dark"] #sky-bg,
body.quran-active[data-quran-theme="dark"] #celestial-body,
body.quran-active[data-quran-theme="dark"] #clouds-layer {
  opacity: 0 !important;
}

.cloud { position: absolute; background: #ffffff; border-radius: 50%; filter: blur(40px); opacity: 0.2; animation: floatCloud linear infinite; }
.cloud.c1 { width: 300px; height: 100px; top: 10%; left: -300px; animation-duration: 45s; }
.cloud.c2 { width: 400px; height: 120px; top: 35%; left: -400px; animation-duration: 65s; animation-delay: -15s; }
.cloud.c3 { width: 250px; height: 80px; top: 65%; left: -250px; animation-duration: 55s; animation-delay: -30s; }

@keyframes floatCloud { 0% { transform: translateX(0); } 100% { transform: translateX(calc(100vw + 400px)); } }

body.visuals-off #sky-bg { background: #050505 !important; }
body.visuals-off #celestial-body, body.visuals-off #clouds-layer { opacity: 0 !important; visibility: hidden; }

/* MASTER SLIDER FOR HORIZONTAL SWIPE */
.master-slider {
  display: flex; width: 100vw; height: 100vh; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; position: relative; z-index: 10;
}
.master-slider::-webkit-scrollbar { display: none; }

.app-wrapper {
  position: relative; width: 100vw; height: 100vh; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; scroll-snap-align: start;
  padding-top: calc(env(safe-area-inset-top, 50px) + 28px); padding-bottom: calc(env(safe-area-inset-bottom, 16px) + 32px);
  padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
}

.quran-wrapper {
  width: 100vw; height: 100vh; max-width: 600px; margin: 0 auto; flex-shrink: 0; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 16px; transition: background 0.3s ease; position: relative;
  padding-top: calc(env(safe-area-inset-top, 50px) + 28px); padding-bottom: calc(env(safe-area-inset-bottom, 16px) + 32px);
  padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
}

/* THEME ENGINE */
.quran-wrapper[data-theme="dark"] { background: transparent; }
.quran-wrapper[data-theme="light"] { background: #f8f9fa; }
.quran-wrapper[data-theme="light"] .quran-header { background: #ffffff; border-color: #e2e8f0; }
.quran-wrapper[data-theme="light"] .qh-surah-select { background-color: #f1f5f9; border-color: #cbd5e1; color: #1a1a1a; }
.quran-wrapper[data-theme="light"] .district-select { background-color: #f1f5f9; color: #1a1a1a; border-color: #cbd5e1; }
.quran-wrapper[data-theme="light"] .district-select-wrapper::after { color: #1a1a1a; }
.quran-wrapper[data-theme="light"] .qs-btn { background: #f1f5f9; color: #1a1a1a; border-color: #cbd5e1; }
.quran-wrapper[data-theme="light"] .verse-row { background: #ffffff; border-color: #e2e8f0; }
.quran-wrapper[data-theme="light"] .verse-arabic { color: #1a1a1a; }
.quran-wrapper[data-theme="light"] .verse-translation { color: #4a5568; }
.quran-wrapper[data-theme="light"] .bismillah-header { color: #1a1a1a; }
.quran-wrapper[data-theme="light"] .quran-verses.is-reading-mode { background: #ffffff; border-color: #e2e8f0; }
.quran-wrapper[data-theme="light"] .qm-btn.active, .quran-wrapper[data-theme="light"] .theme-btn.active { background: #e2e8f0; color: #1a1a1a; }
.quran-wrapper[data-theme="light"] .qm-btn, .quran-wrapper[data-theme="light"] .theme-btn, .quran-wrapper[data-theme="light"] .font-btn { color: #4a5568; }
.quran-wrapper[data-theme="light"] .quran-mode-switcher { border-color: #cbd5e1; }
.quran-wrapper[data-theme="light"] .theme-toggles { border-color: #cbd5e1; }
.quran-wrapper[data-theme="light"] .font-btn { border-color: #cbd5e1; }
.quran-wrapper[data-theme="light"] .verse-number-side { background: #f1f5f9; color: #0ea5e9; border-color: #bae6fd; }
.quran-wrapper[data-theme="light"] .floating-restore-btn { background: #ffffff; color: #1a1a1a; border-color: #cbd5e1; }

.quran-wrapper[data-theme="sepia"] { background: #f4ecd8; }
.quran-wrapper[data-theme="sepia"] .quran-header { background: #fdf6e3; border-color: #e4d5b7; }
.quran-wrapper[data-theme="sepia"] .qh-surah-select { background-color: #ede0c8; border-color: #d1c0a0; color: #433422; }
.quran-wrapper[data-theme="sepia"] .district-select { background-color: #ede0c8; color: #433422; border-color: #d1c0a0; }
.quran-wrapper[data-theme="sepia"] .district-select-wrapper::after { color: #433422; }
.quran-wrapper[data-theme="sepia"] .qs-btn { background: #ede0c8; color: #433422; border-color: #d1c0a0; }
.quran-wrapper[data-theme="sepia"] .verse-row { background: #fdf6e3; border-color: #e4d5b7; }
.quran-wrapper[data-theme="sepia"] .verse-arabic { color: #433422; }
.quran-wrapper[data-theme="sepia"] .verse-translation { color: #65533d; }
.quran-wrapper[data-theme="sepia"] .bismillah-header { color: #433422; }
.quran-wrapper[data-theme="sepia"] .quran-verses.is-reading-mode { background: #fdf6e3; border-color: #e4d5b7; }
.quran-wrapper[data-theme="sepia"] .qm-btn.active, .quran-wrapper[data-theme="sepia"] .theme-btn.active { background: #e4d5b7; color: #433422; }
.quran-wrapper[data-theme="sepia"] .qm-btn, .quran-wrapper[data-theme="sepia"] .theme-btn, .quran-wrapper[data-theme="sepia"] .font-btn { color: #65533d; }
.quran-wrapper[data-theme="sepia"] .quran-mode-switcher { border-color: #d1c0a0; }
.quran-wrapper[data-theme="sepia"] .theme-toggles { border-color: #d1c0a0; }
.quran-wrapper[data-theme="sepia"] .font-btn { border-color: #d1c0a0; }
.quran-wrapper[data-theme="sepia"] .verse-number-side { background: #ede0c8; color: #b45309; border-color: #fcd34d; }
.quran-wrapper[data-theme="sepia"] .floating-restore-btn { background: #fdf6e3; color: #433422; border-color: #e4d5b7; }

/* FULLSCREEN QURAN MODE (ANIMATED) */
.floating-restore-btn { 
  position: absolute; top: calc(env(safe-area-inset-top, 50px) + 28px); right: max(16px, env(safe-area-inset-right)); 
  z-index: 50; background: var(--bg-surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); 
  border: 1px solid var(--border-subtle); color: var(--text-primary); border-radius: 8px; padding: 6px; 
  opacity: 0; transform: translateY(-15px); pointer-events: none; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
}
.quran-wrapper.is-fullscreen .quran-header { 
  max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; border-width: 0; opacity: 0; 
  transform: translateY(-20px); pointer-events: none; overflow: hidden; 
}
.quran-wrapper.is-fullscreen .floating-restore-btn { 
  opacity: 1; transform: translateY(0); pointer-events: auto; 
}
.quran-wrapper.is-fullscreen .quran-verses { padding-top: 48px; }

.quran-header { 
  display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-subtle); 
  padding: 12px 16px; border-radius: 12px; backdrop-filter: blur(8px); 
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); max-height: 600px; transform: translateY(0); opacity: 1; 
}
.qh-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 8px; }
.qh-controls { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; flex-shrink: 0; }

.qh-surah-wrapper { flex: 1; min-width: 0; }
.qh-surah-select { width: 100%; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem !important; font-weight: 700; border: 1px solid var(--border-active); background-color: var(--bg-surface-elevated); }

.qh-controls .district-select { font-size: 13px !important; padding: 6px 22px 6px 8px; }
#verse-select { max-width: 75px; }

.quran-settings-panel { max-height: 0; overflow: hidden; transition: max-height 0.3s cubic-bezier(0.25, 1, 0.5, 1); opacity: 0; }
.quran-settings-panel.is-expanded { max-height: 300px; opacity: 1; padding-top: 16px; }

/* Settings Grid Logic */
.qs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 8px; }
.qs-item { display: flex; }
.qs-col-span-2 { grid-column: 1 / -1; }
.qs-vertical { flex-direction: column; align-items: stretch; gap: 6px; }
.qs-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-left: 2px; }
.qs-full { width: 100%; font-size: 0.85rem !important; }

.quran-mode-switcher, .theme-toggles { display: flex; background: rgba(0,0,0,0.3); border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; width: 100%; }
.qm-btn, .theme-btn { flex: 1; background: none; border: none; color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; padding: 8px 4px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.qm-btn.active, .theme-btn.active { background: var(--bg-surface-elevated); color: var(--text-primary); }
.theme-btn svg { transition: transform 0.2s; }
.theme-btn:active svg { transform: scale(0.9); }

.font-toggles { display: flex; gap: 8px; width: 100%; }
.font-btn { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--border-subtle); border-radius: 8px; color: var(--text-secondary); font-size: 0.9rem; font-weight: 700; cursor: pointer; }
.font-btn:active { transform: scale(0.95); }

.quran-verses { 
  flex: 1; overflow-y: auto; padding: 4px 2px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 12px, black calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0px, black 12px, black calc(100% - 12px), transparent 100%);
  transition: padding 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.quran-verses::-webkit-scrollbar { display: none; }

.bismillah-header { display: block !important; font-family: 'Amiri Quran', serif; font-size: 2.2rem; color: #ffffff; text-align: center; padding: 16px 0 24px 0; width: 100%; }

.verse-row { display: flex; flex-direction: row-reverse; justify-content: space-between; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 24px 20px; backdrop-filter: blur(8px); gap: 16px; scroll-margin-top: 16px; cursor: pointer; transition: background-color 0.2s; }
.verse-row:active { background: var(--bg-surface-active); }
.verse-right-stack { display: flex; flex-direction: column; gap: 12px; flex: 1; pointer-events: none; }
.verse-arabic { font-family: 'Amiri Quran', serif; font-size: var(--quran-font-size); color: #ffffff; line-height: 2.2; text-align: right; direction: rtl; }
.verse-translation { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; text-align: left; direction: ltr; }

.verse-sidebar { display: flex; flex-direction: column; align-items: center; gap: 16px; flex-shrink: 0; padding-top: 4px; pointer-events: none; }
.verse-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: auto; }
.verse-number-side { background: var(--bg-surface-elevated); color: var(--accent-primary); font-size: 0.75rem; font-weight: 700; width: auto; min-width: 36px; padding: 0 8px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 16px; border: 1px solid var(--border-active); }
.copy-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; transition: color 0.2s, transform 0.1s; }
.copy-btn:active { transform: scale(0.85); color: var(--text-primary); }

/* READING MODE OVERRIDES */
.quran-verses.is-reading-mode { display: block; padding: 24px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; backdrop-filter: blur(8px); text-align: center; direction: rtl; line-height: 2.2; }
.quran-verses.is-reading-mode .verse-row { display: inline; background: none; border: none; padding: 0; margin: 0; backdrop-filter: none; pointer-events: none; }
.quran-verses.is-reading-mode .verse-right-stack { display: inline; }
.quran-verses.is-reading-mode .verse-translation, .quran-verses.is-reading-mode .verse-sidebar { display: none; }
.quran-verses.is-reading-mode .verse-arabic { display: inline; }

.main-nav-dots { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 100; pointer-events: none; transition: opacity 0.3s; }
body.quran-active .main-nav-dots { opacity: 0.3; }
body.quran-active #nightstand-mode { display: none !important; }

/* FRIDAY BANNER */
.friday-banner { display: none; align-items: center; justify-content: space-between; background: rgba(52, 211, 153, 0.15); border: 1px solid rgba(52, 211, 153, 0.4); padding: 10px 14px; border-radius: 8px; margin-top: 8px; backdrop-filter: blur(8px); cursor: pointer; transition: transform 0.2s; }
.friday-banner.is-visible { display: flex; animation: slideDownFade 0.4s ease forwards; }
.friday-banner:active { transform: scale(0.98); }
.fb-text { font-size: 0.75rem; color: #a7f3d0; font-weight: 600; line-height: 1.3; }
.fb-close { background: none; border: none; color: #34d399; font-size: 1.2rem; cursor: pointer; padding: 0 4px; line-height: 1; }

/* VERSE FOCUS MODAL OVERRIDES */
.qv-modal-body { padding: 0 !important; display: flex; flex-direction: column; max-height: 75vh; overflow: hidden; }
.qv-scroll-area { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 16px; }
.qv-arabic { font-family: 'Amiri Quran', serif; font-size: calc(var(--quran-font-size) + 0.5rem); color: #ffffff; line-height: 2.2; text-align: center; direction: rtl; }
.qv-translation { font-size: 1rem; color: var(--text-secondary); line-height: 1.6; text-align: center; direction: ltr; }
.qv-sticky-footer { padding: 16px 20px; background: var(--bg-surface-elevated); border-top: 1px solid var(--border-subtle); border-radius: 0 0 16px 16px; flex-shrink: 0; display: flex; justify-content: center; }

/* EXISTING APP STYLES */
.header-bar { display: flex; flex-direction: column; gap: 8px; padding-bottom: 2px; flex-shrink: 0; width: 100%; }
.header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.brand-cluster { display: flex; align-items: center; gap: 8px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-surface-elevated); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border-subtle); padding: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-logo svg { width: 100%; height: 100%; }
.header-title-box h1 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); text-transform: uppercase; line-height: 1.1; margin: 0; }
.controls-cluster { display: flex; gap: 6px; align-items: center; }

.icon-btn { background: var(--bg-surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border-subtle); color: var(--text-primary); border-radius: 6px; padding: 0 8px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; cursor: pointer; transition: transform 0.1s ease; }
.icon-btn:active { transform: scale(0.88); }
.lang-switcher { display: flex; background-color: var(--bg-surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 2px; }
.lang-btn { background: none; border: none; color: var(--text-muted); font-size: 0.65rem; font-weight: 600; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.lang-btn.active { background-color: var(--bg-surface-elevated); color: var(--text-primary); }

.header-bottom { 
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--bg-surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); 
  padding: 6px 8px 6px 14px; border-radius: 8px; border: 1px solid var(--border-subtle); width: 100%; 
}

.date-picker-button { position: relative; display: flex; flex-direction: column; flex-grow: 1; align-items: flex-start; cursor: pointer; }
.date-stacked { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; pointer-events: none; }
.date-row-top { display: flex; align-items: center; gap: 6px; }
.date-gregorian { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.01em; color: var(--text-primary); white-space: nowrap; transition: color 0.3s; }
.date-hijrah { font-size: 0.7rem; font-weight: 500; color: var(--text-secondary); transition: color 0.3s;}

.date-stacked.is-not-today .date-gregorian { color: var(--accent-primary); }
.date-stacked.is-not-today .date-hijrah { color: var(--text-primary); }

#native-date-input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px !important; }

.district-select-wrapper { position: relative; flex-shrink: 0; }
.district-select {
  appearance: none; background-color: rgba(30, 30, 30, 0.8); border: 1px solid rgba(255, 255, 255, 0.25); color: #ffffff;
  font-size: 14px !important; 
  font-weight: 600; padding: 6px 28px 6px 10px; border-radius: 6px; outline: none; cursor: pointer; font-family: var(--font-stack); box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.district-select-wrapper::after { content: "▼"; font-size: 0.6rem; color: var(--text-primary); position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }

.hero-tracker {
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(10, 10, 10, 0.8) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border-subtle); border-radius: 12px;
  padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; flex-shrink: 0; width: 100%;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); max-height: 250px; opacity: 1; transform-origin: top;
}
.hero-tracker.is-collapsed {
  max-height: 0; opacity: 0; margin-bottom: -8px; padding-top: 0; padding-bottom: 0; border-width: 0; transform: scaleY(0.9); pointer-events: none;
}
.hero-tracker::after { content: ""; position: absolute; top: 0; right: 0; width: 150px; height: 100%; background: radial-gradient(circle at top right, var(--accent-glow) 0%, transparent 80%); pointer-events: none; }

.hero-top-bar { display: flex; justify-content: space-between; align-items: center; z-index: 1; margin-bottom: 2px; min-height: 24px; }
.hero-now-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }

.hero-name { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; color: #ffffff; line-height: 1; z-index: 1; }
.hero-time { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; z-index: 1; }

.progress-container { width: 100%; display: flex; flex-direction: column; gap: 4px; z-index: 1; margin-top: 2px; transition: opacity 0.3s; }
.progress-countdown { font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.progress-track { width: 100%; height: 6px; background-color: var(--border-subtle); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--accent-primary); border-radius: 999px; box-shadow: 0 0 10px var(--accent-primary); transition: width 0.8s ease; }

.ptr-container { width: 100%; height: 0px; overflow: hidden; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ptr-spinner { width: 18px; height: 18px; border: 2.5px solid var(--text-secondary); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; display: block; margin: auto; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.return-today-wrapper { display: none; padding: 0 4px; margin-bottom: 6px; width: 100%; flex-shrink: 0; }
.return-today-wrapper.is-visible { display: block; animation: slideDownFade 0.3s ease forwards; }

@keyframes slideDownFade {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.return-today-btn { 
  width: 100%; background: rgba(255, 255, 255, 0.08); border: 1px dashed var(--border-subtle); 
  color: var(--text-primary); padding: 12px; border-radius: 10px; font-size: 0.85rem; 
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; 
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: all 0.2s ease; 
}
.return-today-btn:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.15); }

.prayer-list {
  display: flex; flex-direction: column; gap: 8px; width: 100%; flex-grow: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 12px, black calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0px, black 12px, black calc(100% - 12px), transparent 100%);
  padding: 4px 2px; 
  scrollbar-width: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.prayer-list.is-updating { opacity: 0; transform: translateY(15px); }
.prayer-list::-webkit-scrollbar { display: none; }

.prayer-row {
  display: flex; align-items: center; justify-content: space-between; border-radius: 10px; width: 100%; flex-shrink: 0; 
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); 
  cursor: default;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.3s ease;
  transform-origin: center; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.prayer-row.is-fardhu { background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 16px 14px; }
.prayer-row.is-secondary { background: rgba(10, 10, 10, 0.4); border: 1px dashed var(--border-subtle); padding: 12px 14px; }
.prayer-row.is-active { background: linear-gradient(90deg, var(--bg-surface-active) 0%, rgba(10,10,10,0.6) 100%); border: 1px solid var(--border-active); box-shadow: inset 3px 0 0 var(--accent-primary), 0 4px 12px rgba(0,0,0,0.15); }
.prayer-row.is-past { opacity: 0.4; filter: grayscale(1); box-shadow: none; }

.row-left-fardhu { width: 80px; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); pointer-events: none;}
.row-left-sec { width: 80px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; pointer-events: none;}
.prayer-row.is-active .row-left-fardhu, .prayer-row.is-active .row-left-sec { color: var(--accent-primary); }

.row-mid { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-start; padding: 0 4px; pointer-events: none; }
.fiqh-badge { font-size: 0.6rem; font-weight: 600; padding: 3px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.fiqh-badge.is-ok { background-color: var(--badge-ok-bg); color: var(--badge-ok-color); }
.fiqh-badge.is-haram { background-color: var(--badge-haram-bg); color: var(--badge-haram-color); }

.row-right-fardhu { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); text-align: right; pointer-events: none;}
.row-right-sec { font-size: 0.95rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-muted); text-align: right; pointer-events: none;}
.prayer-row.is-active .row-right-fardhu, .prayer-row.is-active .row-right-sec { color: #ffffff; }

.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; padding: 16px; }
.modal-backdrop.is-visible { opacity: 1; pointer-events: auto; }
.modal-card { background: rgba(24, 24, 27, 0.95); border: 1px solid var(--border-active); border-radius: 16px; width: 100%; max-width: 420px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.6); transform: translateY(10px); transition: transform 0.25s ease; }
.modal-backdrop.is-visible .modal-card { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; }
.modal-header h3 { font-size: 1.15rem; font-weight: 700; color: #ffffff; }
.modal-close-btn { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; padding: 0 6px; line-height: 1; transition: transform 0.1s; }
.modal-close-btn:active { transform: scale(0.85); }
.modal-body { display: flex; flex-direction: column; gap: 10px; font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; }
.modal-desc { color: var(--text-secondary); }
.modal-benefit-box { background: rgba(52, 211, 153, 0.1); border-left: 3px solid #34d399; padding: 10px 12px; border-radius: 0 8px 8px 0; color: #a7f3d0; font-size: 0.8rem; }
.modal-source { font-size: 0.75rem; color: var(--text-muted); font-style: italic; margin-top: 4px; }
.about-body a { color: var(--badge-ok-color); text-decoration: none; font-weight: 600; transition: opacity 0.2s; }
.about-body a:active { opacity: 0.7; }
.about-version { font-size: 0.7rem; color: var(--text-muted); margin-top: 8px; }

.site-footer { position: relative; z-index: 50; display: flex; justify-content: center; align-items: center; flex-shrink: 0; padding-top: 6px; margin-top: auto; background: transparent !important; border: none !important; box-shadow: none !important; pointer-events: none; }
.info-btn { pointer-events: auto; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-subtle); color: var(--text-muted); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.info-btn:active { transform: scale(0.85); background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }

#nightstand-mode { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: #000000; z-index: 9999; color: var(--text-primary); flex-direction: column; }
.ns-scroll-container { display: flex; width: 100vw; height: 100vh; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ns-scroll-container::-webkit-scrollbar { display: none; }
.ns-panel { min-width: 100vw; height: 100vh; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; position: relative; }

.ns-panel-1 { flex-direction: column; }
#ns-time { font-size: 28vmin; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.02em; }
#ns-date { font-size: 5vmin; color: var(--text-secondary); margin-top: 1vh; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
#ns-next { font-size: 6vmin; color: var(--text-primary); margin-top: 3vh; font-weight: 600; background: var(--bg-surface-elevated); padding: 1.5vh 4vw; border-radius: 99px; border: 1px solid var(--border-subtle); font-variant-numeric: tabular-nums; }
.blink-colon { animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }

.ns-panel-2 { flex-direction: row; padding: 12vh 8vw; gap: 4vw; align-items: stretch; justify-content: center; height: 100vh; width: 100vw;}

.ns-widget-left { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; }
#ns-time-2 { font-size: 30vmin; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.02em; text-align: center; }
#ns-date-2 { font-size: 4vmin; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; text-align: center; }

.ns-widget-right-wrapper { flex: 1; position: relative; display: flex; height: 100%; overflow: hidden; }
.ns-widget-right { flex: 1; display: flex; flex-direction: column; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; height: 100%; }
.ns-widget-right::-webkit-scrollbar { display: none; }

.ns-widget-page { height: 100%; width: 100%; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; scroll-snap-align: start; padding-left: 2vw; }
.ns-widget-page-1 { gap: 4vh; }
.ns-widget-page-2 { gap: 2vh; padding-right: 6vw; }

.ns-widget-dots { position: absolute; right: 2vw; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 1.5vh; transition: opacity 0.4s ease; z-index: 10001; pointer-events: none; }
.ns-widget-dots.hidden { opacity: 0; }
.ns-widget-dot { width: 1.2vw; height: 1.2vw; max-width: 8px; max-height: 8px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: background 0.3s, transform 0.3s; }
.ns-widget-dot.active { background: var(--text-primary); transform: scale(1.3); }

.ns-prayer-row { display: flex; justify-content: space-between; width: 100%; font-size: 4vmin; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ns-prayer-row.is-active-ns { color: var(--accent-primary); font-weight: 700; }
.ns-prayer-row.is-next { color: var(--text-primary); font-weight: 700; }

.ns-time-left { font-size: 5.5vmin; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ns-right-mid { display: flex; flex-direction: column; align-items: flex-start; gap: 1vh; transform: translateY(-2vh); }
.ns-current-icon { width: 12vmin; height: 12vmin; color: var(--text-primary); }
.ns-current-icon svg { width: 100%; height: 100%; }
.ns-current-name { font-size: 11vmin; font-weight: 700; color: var(--text-primary); line-height: 1; }

.ns-right-bottom { display: flex; flex-direction: column; gap: 0.5vh; }
.ns-next-info { font-size: 4.5vmin; color: var(--text-primary); display: flex; align-items: center; gap: 2vw; }
.ns-next-info svg { width: 5vmin; height: 5vmin; }
.ns-starts-at { font-size: 4.5vmin; color: var(--text-primary); }

.ns-dots { position: absolute; bottom: 6vh; left: 0; right: 0; display: flex; justify-content: center; gap: 2vw; pointer-events: none; z-index: 10000; }
.ns-dot { width: 1.2vw; height: 1.2vw; max-width: 8px; max-height: 8px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: background 0.3s, transform 0.3s; }
.ns-dot.active { background: var(--text-primary); transform: scale(1.3); }

@media (orientation: landscape) and (max-height: 600px) {
  .master-slider, .modal-backdrop, #sky-bg, #celestial-body, #clouds-layer { display: none !important; }
  #nightstand-mode { display: flex; }
}

@media (min-width: 1024px) {
  .main-nav-dots { display: none !important; }
  
  .master-slider {
    display: flex;
    justify-content: center;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 6vh 32px;
    overflow: visible;
    scroll-snap-type: none;
    height: 100vh;
  }
  
  .app-wrapper {
    width: auto;
    flex: 2;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto 1fr auto;
    gap: 32px;
    padding: 0;
    max-width: 800px;
  }
  .quran-wrapper {
    width: auto;
    flex: 1.2;
    height: 100%;
    padding: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    max-width: 500px;
  }
  
  .header-bar {
    grid-column: 1 / -1;
    grid-row: 1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .header-bottom { width: auto; min-width: 400px; }
  
  .hero-tracker {
    grid-column: 1;
    grid-row: 2 / span 3;
    max-height: none;
    height: 100%;
    border-radius: 24px;
    padding: 60px 40px;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  }
  .hero-tracker.is-collapsed {
    max-height: none;
    opacity: 0.6;
    transform: none;
    margin: 0;
    padding: 60px 40px;
    border-width: 1px;
  }
  .hero-name { font-size: 4rem; margin-bottom: 8px; }
  .hero-time { font-size: 1rem; margin-bottom: 24px; }
  .progress-countdown { font-size: 1.1rem; }
  .progress-track { height: 8px; }
  
  #return-today-wrapper { grid-column: 2; grid-row: 2; margin-bottom: -16px; }
  #prayer-list-container { grid-column: 2; grid-row: 3; padding-right: 16px; margin-top: 8px; }
  
  .site-footer { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; }
  
  #ptr-indicator { display: none !important; }
  
  .prayer-row {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.3s ease;
  }
  .prayer-row:hover {
    transform: scale(1.02) translateX(4px);
    background-color: var(--bg-surface-active);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
    z-index: 20;
  }
}