﻿/* ============================================================
   Landing page — 114 surahs listing
   ============================================================ */

:root {
  --bg: #f3e9d2;
  --fg: #2a1810;
  --primary: #0d4f3c;
  --primary-2: #166548;
  --primary-dark: #0a3d2e;
  --gold: #b8860b;
  --gold-light: #d4af37;
  --gold-dark: #8b6914;
  --card: #fffaef;
  --border: #c9a961;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Tajawal', sans-serif;
  color: var(--fg);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 10%, rgba(184, 134, 11, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 88% 90%, rgba(13, 79, 60, 0.1) 0%, transparent 45%);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.font-display {
  font-family: 'Reem Kufi', sans-serif;
}

/* ---------- Header ---------- */
.landing-header {
  background: linear-gradient(135deg, #082e23 0%, var(--primary) 55%, var(--primary-2) 100%);
  border-bottom: 4px solid var(--gold);
  color: #fffaef;
  text-align: center;
  padding: 1.75rem 1rem 1.5rem;
  position: relative;
}

.site-settings-btn {
  position: absolute;
  top: 14px;
  left: 12px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  background-color: transparent;
  box-shadow: none;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  z-index: 20;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.15s ease, transform 0.2s ease;
}

.site-settings-btn i {
  color: #ffffff;
  pointer-events: none;
}

.site-settings-btn:hover {
  background: transparent;
  opacity: 0.85;
  transform: rotate(45deg);
}

.site-settings-btn:active {
  opacity: 0.7;
}

.site-settings-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* ---------- Site settings modal ---------- */
.site-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(8, 46, 35, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.site-settings-overlay.is-open {
  display: flex;
}

.site-settings-card {
  width: min(420px, 100%);
  background: linear-gradient(160deg, #fffaef 0%, #f5e6c8 100%);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 1.25rem 1.15rem 1.15rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  color: var(--fg);
  text-align: right;
}

.site-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.site-settings-head h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.site-settings-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(201, 169, 97, 0.4);
  border-radius: 14px;
}

.site-settings-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.site-settings-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fffaef;
  flex-shrink: 0;
}

.site-settings-label strong {
  display: block;
  color: var(--primary-dark);
  font-size: 0.98rem;
}

.site-settings-label p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #6b5a45;
  line-height: 1.4;
}

/* Toggle switch */
.sound-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.sound-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sound-switch-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c9b896;
  border: 1px solid rgba(139, 105, 20, 0.35);
  position: relative;
  transition: background 0.2s;
}

.sound-switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.sound-switch input:checked + .sound-switch-ui {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.sound-switch input:checked + .sound-switch-ui::after {
  transform: translateX(-20px);
}

.sound-switch-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 2.5rem;
}

.site-settings-preview {
  margin-top: 0.85rem;
  width: 100%;
  border: 1.5px solid var(--gold);
  background: linear-gradient(135deg, #fff8e7, #f0d896);
  color: var(--primary-dark);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.site-settings-preview:hover {
  filter: brightness(1.03);
}

.site-settings-note {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: #6b5a45;
  text-align: center;
  line-height: 1.45;
}

.landing-header .ornament {
  font-family: 'Amiri Quran', serif;
  font-size: 1.5rem;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.landing-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: #f5e6c8;
}

.landing-header p {
  margin: 0.4rem 0 0;
  color: var(--gold-light);
  font-size: 0.95rem;
}

/* ---------- Toolbar ---------- */
.landing-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  background: rgba(255, 250, 239, 0.85);
  border: 1px solid rgba(201, 169, 97, 0.45);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.toolbar-label {
  font-family: 'Reem Kufi', sans-serif;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
}

.search-wrap {
  position: relative;
  flex: 1 1 220px;
  max-width: 360px;
}

.search-wrap i {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dark);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 2.4rem 0.6rem 0.85rem;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  background: #fff;
  color: var(--fg);
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--primary);
}

.surah-count {
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Grid ---------- */
.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.85rem;
}

.surah-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(145deg, #fffaef 0%, #f7edd4 100%);
  border: 1.5px solid rgba(201, 169, 97, 0.55);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  box-shadow: 0 3px 10px rgba(45, 24, 16, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  min-height: 76px;
}

.surah-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(13, 79, 60, 0.12);
  border-color: var(--gold);
}

.surah-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.surah-card.is-available {
  border-color: rgba(13, 79, 60, 0.45);
  background: linear-gradient(145deg, #f3faf6 0%, #fffaef 55%, #f7edd4 100%);
  box-shadow: 0 4px 14px rgba(13, 79, 60, 0.12);
}

.surah-card.is-available:hover {
  border-color: var(--primary);
}

.surah-card.is-soon {
  opacity: 0.92;
}

.surah-number {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Amiri Quran', serif;
  font-size: 0.95rem;
  color: #fffaef;
  background: radial-gradient(circle, var(--gold-light) 0%, var(--gold) 65%, var(--gold-dark) 100%);
  box-shadow: 0 2px 6px rgba(139, 105, 20, 0.35);
}

.surah-card.is-available .surah-number {
  background: radial-gradient(circle, #1f7a5a 0%, var(--primary) 70%, #082e23 100%);
}

.surah-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.surah-name {
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.surah-meta {
  font-size: 0.8rem;
  color: #6b5a45;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.surah-meta .dot {
  opacity: 0.5;
}

.surah-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.surah-card.is-available .surah-badge {
  background: rgba(13, 79, 60, 0.12);
  color: var(--primary);
  border-color: rgba(13, 79, 60, 0.25);
}

.surah-card.is-soon .surah-badge {
  background: rgba(184, 134, 11, 0.12);
  color: var(--gold-dark);
  border-color: rgba(184, 134, 11, 0.3);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b5a45;
  padding: 2rem 1rem;
}

/* ---------- Toast ---------- */
.coming-soon-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: linear-gradient(135deg, #082e23 0%, var(--primary) 100%);
  color: #fffaef;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: min(92vw, 420px);
  text-align: center;
}

.coming-soon-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Footer note ---------- */
.landing-note {
  margin-top: 1.75rem;
  text-align: center;
  color: #6b5a45;
  font-size: 0.88rem;
}

.landing-note strong {
  color: var(--primary);
}

/* Phone / small-screen styles live in css/phone.css (loaded after this file) */
