/* =========================================================
   RAMADAN PAGE — UNIFIED PREMIUM UI
   Apple-level restraint · Spiritual · Timeless
========================================================= */

/* =========================================================
   DESIGN TOKENS
========================================================= */

:root {
  --bg-main: #f9fafb;
  --bg-elevated: rgba(255, 255, 255, 0.88);
  --bg-elevated-strong: rgba(255, 255, 255, 0.96);

  --border-soft: rgba(0, 0, 0, 0.08);
  --border-gold: rgba(181, 155, 58, 0.35);

  --text-main: #111827;
  --text-soft: #4b5563;
  --text-muted: #6b7280;

  --gold-main: #b59b3a;
  --gold-soft: rgba(181, 155, 58, 0.18);

  --radius-lg: 1.25rem;
  --radius-md: 0.85rem;

  --blur-lg: blur(16px);
}

/* =========================================================
   DIM MODE
========================================================= */

body.dim {
  --bg-main: #0f172a;
  --bg-elevated: rgba(31, 41, 55, 0.85);
  --bg-elevated-strong: rgba(31, 41, 55, 0.95);

  --border-soft: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(250, 204, 21, 0.35);

  --text-main: #e5e7eb;
  --text-soft: #9ca3af;
  --text-muted: #9ca3af;

  --gold-main: #facc15;
  --gold-soft: rgba(250, 204, 21, 0.18);
}

/* =========================================================
   DARK MODE
========================================================= */

body.dark {
  --bg-main: #020617;
  --bg-elevated: rgba(2, 6, 23, 0.92);
  --bg-elevated-strong: rgba(2, 6, 23, 0.97);

  --border-soft: rgba(255, 255, 255, 0.06);
  --border-gold: rgba(212, 175, 55, 0.35);

  --text-main: #e5e7eb;
  --text-soft: rgba(229, 231, 235, 0.65);
  --text-muted: rgba(229, 231, 235, 0.45);

  --gold-main: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.18);
}

/* =========================================================
   BASE
========================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  background:
    radial-gradient(circle at top, var(--gold-soft), transparent 60%),
    var(--bg-main);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}


/* =========================================================
   HEADER
   ========================================================= */

.app-header {
  background: var(--bg-elevated);
  backdrop-filter: var(--blur-lg);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  max-width: 1200px;
  margin: auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-title .gold {
  color: var(--gold-main);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.desktop-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.85rem;
  color: var(--text-soft);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold-main);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold-main);
  border-radius: 2px;
}


/* =========================================================
   THEME TOGGLE
   ========================================================= */

.btn_dongl {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* =========================================================
   HERO
========================================================= */

.ramadan-hero {
  max-width: 920px;
  margin: 2.5rem auto 3rem;
  padding: 4rem 2rem;
  text-align: center;

  background:
    radial-gradient(circle at top, var(--gold-soft), transparent 65%),
    var(--bg-elevated);

  border-radius: var(--radius-lg);
  border: 1px solid var(--border-gold);
  backdrop-filter: var(--blur-lg);
  position: relative;
}

.ramadan-overlay {
  position: absolute;
  inset: 0;
  background-image: url("https://www.transparenttextures.com/patterns/arabesque.png");
  opacity: 0.1;
  pointer-events: none;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 700;
}

.section-title .arabic {
  font-family: "Amiri", serif;
  color: var(--gold-main);
  font-size: 2.9rem;
}

.ramadan-subtitle {
  max-width: 620px;
  margin: 0.8rem auto 0;
  color: var(--text-soft);
}


/* =========================================================
   FASTING TRACKER — CONTAINER
========================================================= */

/* ===================================
   TRACKER COLLAPSE SYSTEM
=================================== */

#ramadan-tracker {
  overflow: hidden;
  transition:
    max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease,
    transform 0.4s ease;
}

/* Hidden state */
#ramadan-tracker.is-collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Toggle button styling */
.tracker-toggle-wrapper {
  max-width: 1100px;
  margin: 2rem auto 1rem;
  text-align: center;
}

.tracker-toggle-btn {
  padding: 0.9rem 1.8rem;
  font-size: 0.95rem;
  font-weight: 600;

  border-radius: 999px;
  border: 1px solid var(--border-gold);

  background: var(--bg-elevated);
  color: var(--gold-main);

  cursor: pointer;
  transition: all 0.3s ease;
}

.tracker-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}


#ramadan-tracker {
  max-width: 1100px;
  margin: 3rem auto 4rem;
  padding: 2.5rem 2.2rem;

  background:
    radial-gradient(circle at top, var(--gold-soft), transparent 65%),
    var(--bg-elevated);

  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--blur-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

/* =========================================================
   TRACKER HEADER
========================================================= */

.ramadan-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.ramadan-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-main);
}

.ramadan-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ramadan-controls {
  margin-top: 1.2rem;
}

.ramadan-controls label {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.ramadan-controls select {
  margin-left: 0.5rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 999px;

  background: var(--bg-elevated-strong);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

.ramadan-moon-hint {
  display: block;
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.35rem;
}

/* =========================================================
   CALENDAR
========================================================= */

.ramadan-calendar {
  margin-bottom: 3rem;
}

.calendar-title {
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  color: var(--text-soft);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}

/* =========================================================
   CALENDAR DAY
========================================================= */

.calendar-day {
  padding: 0.8rem 0.4rem;
  border-radius: var(--radius-md);

  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  backdrop-filter: var(--blur-lg);

  display: flex;
  flex-direction: column;
  align-items: center;

  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.calendar-day:hover {
  transform: translateY(-3px);
  border-color: var(--border-gold);
}

.calendar-day.active {
  background:
    radial-gradient(circle at top, var(--gold-soft), transparent 60%),
    var(--bg-elevated-strong);

  border-color: var(--border-gold);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.cal-hijri {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-main);
}

.cal-gregorian {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* =========================================================
   RAMADAN — DAY DETAIL CARD
========================================================= */

.ramadan-day {
  background:
    radial-gradient(circle at top, var(--gold-soft), transparent 65%),
    var(--bg-elevated);

  border-radius: var(--radius-lg);
  border: 1px solid var(--border-gold);
  backdrop-filter: var(--blur-lg);

  padding: 2.2rem 2rem;
  margin-bottom: 2.5rem;

  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.28);
  animation: fadeInUp 0.45s ease;
}

/* =========================================================
   DAY HEADER
========================================================= */

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.6rem;
}

.day-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-main);
}

.day-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================================
   EVENTS / REMINDERS
========================================================= */

.day-events {
  background: var(--gold-soft);
  border-left: 4px solid var(--gold-main);
  border-radius: var(--radius-md);

  padding: 0.7rem 1rem;
  margin-bottom: 1.8rem;

  font-size: 0.85rem;
  color: var(--text-soft);
}

/* =========================================================
   INTERACTIONS & ACCESSIBILITY
========================================================= */

button,
.calendar-day {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
.calendar-day:focus-visible {
  outline: 2px solid var(--gold-main);
  outline-offset: 2px;
}

/* =========================================================
   RESPONSIVE — TRACKER & CALENDAR
========================================================= */

@media (max-width: 900px) {
  .calendar-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 600px) {
  #ramadan-tracker {
    padding: 2rem 1.4rem;
    margin: 2.2rem 1rem 3rem;
  }

  .calendar-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .ramadan-header h2 {
    font-size: 1.6rem;
  }
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   FASTING STATUS BUTTONS
========================================================= */

.fasting-status {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.fast-btn {
  flex: 1;
  padding: 0.85rem 1rem;

  font-size: 0.9rem;
  font-weight: 600;

  border-radius: 999px;
  border: 1px solid var(--border-soft);

  background: var(--bg-elevated-strong);
  color: var(--text-soft);

  cursor: pointer;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.fast-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

/* ===== FASTED ===== */

.fast-btn.fasted.active {
  background:
    radial-gradient(circle at top, rgba(34, 197, 94, 0.35), transparent 60%),
    rgba(34, 197, 94, 0.22);

  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;

  box-shadow: 0 12px 35px rgba(34, 197, 94, 0.45);
}

/* ===== MISSED ===== */

.fast-btn.missed.active {
  background:
    radial-gradient(circle at top, rgba(239, 68, 68, 0.35), transparent 60%),
    rgba(239, 68, 68, 0.22);

  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;

  box-shadow: 0 12px 35px rgba(239, 68, 68, 0.45);
}

/* =========================================================
   MEAL TRACKER
========================================================= */

.meal-tracker {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}

.meal-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;

  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);

  background: var(--bg-elevated-strong);
  border: 1px solid var(--border-soft);
}

.meal-item input {
  accent-color: var(--gold-main);
}

.meal-item label {
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* =========================================================
   NOTES
========================================================= */

.fasting-notes {
  width: 100%;
  min-height: 100px;

  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;

  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);

  background: var(--bg-elevated-strong);
  color: var(--text-main);

  resize: vertical;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.fasting-notes::placeholder {
  color: var(--text-muted);
}

.fasting-notes:focus {
  outline: none;
  border-color: var(--border-gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

/* =========================================================
   RAMADAN INDEX CARDS
========================================================= */

.ramadan-grid {
  max-width: 1150px;
  margin: auto;
  padding: 0 1.25rem 3.5rem;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.ramadan-card {
  padding: 1.4rem;
  border-radius: var(--radius-lg);

  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);

  display: flex;
  gap: 1rem;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.ramadan-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.ramadan-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);

  background: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ramadan-content {
  flex: 1;
}

.ramadan-title {
  margin: 0;
}

.ramadan-title-arabic {
  margin-top: 0.15rem;
}

.ramadan-arrow {
  font-size: 1.4rem;
  color: var(--text-muted);
  align-self: center;
  transition: transform 0.25s ease, color 0.25s ease;
}

.ramadan-card:hover .ramadan-arrow {
  transform: translateX(4px);
  color: var(--gold-main);
}

.crescent {
  margin-top: 2rem;
  font-size: 2.2rem;
  color: var(--gold-main);
  animation: glow 3s ease-in-out infinite;
}

  .crescent {
    margin-top: 1.4rem;
    font-size: 1.9rem;
  }

/* =========================================================
   FOOTER
========================================================= */

.app-footer {
  text-align: center;
  padding: 2rem 1rem 4.5rem;
  color: var(--text-muted);
}

/* =========================================================
   MOBILE NAV
========================================================= */

.mobile-nav {
  position: fixed;
  bottom: 0;
  width: 100%;

  background: var(--bg-elevated-strong);
  backdrop-filter: var(--blur-lg);

  border-top: 1px solid var(--border-soft);
  display: none;
  justify-content: space-around;

  padding: 0.6rem 0;
}

/* =========================================================
   MOBILE POLISH
========================================================= */
/* ===============================
   MOBILE & SMALL SCREEN TUNING
   (SAFE — NON BREAKING)
================================ */

@media (max-width: 768px) {
  /* Navigation */
  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  /* Status & meals stack naturally */
  .fasting-status,
  .meal-tracker {
    flex-direction: column;
  }

  /* Hero spacing */
  .ramadan-hero {
    padding: 3rem 1.8rem;
  }

  /* Titles scale down cleanly */
  .section-title {
    font-size: 2rem;
  }

  .section-title .arabic {
    font-size: 2.6rem;
  }
}

@media (max-width: 480px) {
  /* Cards */
  .ramadan-card {
    padding: 1.2rem;
  }

  .ramadan-arrow {
    display: none;
  }

  /* Hero refinement */
  .ramadan-hero {
    margin: 1.5rem 1rem 2.5rem;
    padding: 2.4rem 1.4rem;
    border-radius: 1rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  }

  /* Section titles — vertical rhythm */
  .section-title {
    font-size: 1.55rem;
    line-height: 1.35;
    letter-spacing: 0.2px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
  }

  .section-title .divider {
    display: none;
  }

  .section-title .latin {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
  }

  .section-title .arabic {
    font-size: 2.2rem;
    line-height: 1.1;
  }

  /* Subtitle & accents */
  .ramadan-subtitle {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: 0.9rem;
  }

  .arabic-text {
    display: block;
    margin-top: 0.4rem;
    font-size: 1.15rem;
  }

  .crescent {
    margin-top: 1.4rem;
    font-size: 1.9rem;
  }
}

/* ===============================
   REDUCED MOTION (ACCESSIBILITY)
================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
