/* ============================================
   Ramadan 30-Day Quranic Challenge
   Dark theme with gold accents
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0c1929;
  --bg-secondary: #111f33;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --gold: #d4af55;
  --gold-light: #e8cc7a;
  --gold-dim: rgba(212, 175, 85, 0.3);
  --text-primary: #e8e0d4;
  --text-secondary: #a89e91;
  --text-muted: #6b6157;
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.15);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(212, 175, 85, 0.3);
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ar: 'Amiri', 'Traditional Arabic', serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-en);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Screen System --- */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.screen.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* --- Home Screen --- */
.home-header {
  text-align: center;
  padding: 3rem 0 2rem;
}

.home-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.home-title {
  font-family: var(--font-ar);
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.home-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.home-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.home-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-en);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-primary);
  width: 100%;
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--gold-dim);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-back {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-back:hover {
  color: var(--text-primary);
}

/* --- Home Disclaimers --- */
.home-disclaimers {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.home-disclaimers p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.home-disclaimers a {
  color: var(--gold);
  font-size: 0.75rem;
}

/* --- Day Grid Screen --- */
.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.grid-header h2 {
  font-size: 1.25rem;
  color: var(--gold);
}

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

.day-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.25rem;
}

.day-cell-empty {
  aspect-ratio: 1;
}

.day-cell {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  padding: 0.2rem;
  gap: 0.1rem;
}

.day-cell .day-date {
  font-size: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1;
  letter-spacing: 0.02em;
}

.day-cell .day-num {
  font-size: 1rem;
  line-height: 1;
}

.day-cell .day-stars {
  font-size: 0.5rem;
  color: var(--gold);
  min-height: 0.6rem;
  line-height: 1;
}

.day-cell.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.day-cell.locked::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b6157'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM12 17c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E") no-repeat center/contain;
}

.day-cell.time-locked::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b6157'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E") no-repeat center/contain;
}

.day-cell.time-locked .day-stars {
  color: var(--text-muted);
}

.day-cell.unlocked {
  border-color: var(--border-gold);
  background: rgba(212, 175, 85, 0.08);
}

.day-cell.unlocked:hover {
  background: rgba(212, 175, 85, 0.15);
  transform: scale(1.05);
}

.day-cell.completed {
  border-color: var(--green);
  background: var(--green-dim);
  cursor: pointer;
}

.day-cell.completed:hover {
  background: rgba(74, 222, 128, 0.25);
  transform: scale(1.05);
}

.day-cell.current {
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-dim);
  animation: pulse 2s infinite;
}

/* --- Day Actions Overlay --- */
.day-actions-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

.day-actions-menu {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: slideUp 0.25s ease;
}

.day-actions-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  text-align: center;
}

.day-actions-score {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 0.5rem;
}

.day-actions-btn {
  width: 100%;
}

.day-actions-reset {
  color: var(--red);
  border-color: var(--red-dim);
}

.day-actions-reset.confirm {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

/* --- Challenge Screen --- */
.challenge-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.challenge-day-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.challenge-theme {
  font-size: 1.5rem;
  color: var(--gold);
  margin: 0.25rem 0;
}

.challenge-section-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  margin: 1rem 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Verse Card */
.verse-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.verse-context {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.6rem 0.75rem;
  border-left: 2px solid var(--border);
  margin-bottom: 1rem;
}

.verse-context:last-child {
  margin-bottom: 0;
  margin-top: 1rem;
}

.verse-context-ref {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.03em;
}

.verse-ref {
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.verse-read-link {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.15rem 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.verse-read-link:hover {
  color: var(--gold);
  border-color: var(--border-gold);
  text-decoration: none;
}

.verse-arabic {
  font-family: var(--font-ar);
  font-size: 1.5rem;
  line-height: 2;
  text-align: right;
  direction: rtl;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.verse-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.blank {
  display: inline-block;
  min-width: 120px;
  border-bottom: 2px dashed var(--gold);
  color: var(--gold);
  padding: 0 0.25rem;
  margin: 0 0.15rem;
  text-align: center;
  animation: blinkBorder 1.5s infinite;
}

.blank.filled {
  border-bottom-style: solid;
  color: var(--green);
  border-color: var(--green);
  animation: none;
  font-weight: 600;
}

/* Options */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.option-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-en);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.option-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-dim);
}

.option-btn.correct {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
  animation: glowGreen 0.6s ease;
}

.option-btn.wrong {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
  animation: shake 0.5s ease;
}

.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Encouragement message */
.encouragement {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  min-height: 2.5rem;
}

.encouragement.wrong-msg {
  color: var(--red);
  animation: fadeIn 0.3s ease;
}

/* --- Reveal Card --- */
.reveal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  animation: slideUp 0.5s ease;
}

.reveal-card h3 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.reveal-name-arabic {
  font-family: var(--font-ar);
  font-size: 2.5rem;
  text-align: center;
  color: var(--gold);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.reveal-name-transliteration {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.reveal-name-meaning {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.reveal-section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.reveal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.reveal-section-title {
  font-size: 0.75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.reveal-section p, .reveal-section a {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.reveal-section a {
  color: var(--gold);
  text-decoration: underline;
}

.btn-next {
  margin-top: 1.5rem;
  width: 100%;
}

.btn-next.btn-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-next.btn-glow {
  animation: glowGold 1s ease 2;
}

/* --- Dhikr Section --- */
.dhikr-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.dhikr-section-title {
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  font-weight: 600;
}

.dhikr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
  text-align: center;
}

.dhikr-card:active {
  transform: scale(0.97);
}

.dhikr-card.complete {
  border-color: var(--green);
  background: var(--green-dim);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.15);
  cursor: default;
}

.dhikr-card.dhikr-pulse {
  animation: dhikrPulse 0.2s ease;
}

.dhikr-arabic {
  font-family: var(--font-ar);
  font-size: 2rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.25rem;
}

.dhikr-card.complete .dhikr-arabic {
  color: var(--green);
}

.dhikr-transliteration {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.dhikr-meaning {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.dhikr-counter {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.dhikr-card.complete .dhikr-counter::after {
  content: ' \2713';
  color: var(--green);
}

.dhikr-card.complete .dhikr-counter {
  color: var(--green);
}

.dhikr-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.dhikr-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.15s ease;
}

.dhikr-card.complete .dhikr-progress-fill {
  background: var(--green);
}

@keyframes dhikrPulse {
  0% { box-shadow: 0 0 0 rgba(212, 175, 85, 0); }
  50% { box-shadow: 0 0 15px rgba(212, 175, 85, 0.4); }
  100% { box-shadow: 0 0 0 rgba(212, 175, 85, 0); }
}

/* --- Summary Screen --- */
.summary-header {
  text-align: center;
  padding: 2rem 0;
}

.summary-stars {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.summary-title {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.summary-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.summary-score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.summary-score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
}

.summary-score-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.summary-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.summary-detail-row:last-child {
  border-bottom: none;
}

.summary-detail-label {
  color: var(--text-secondary);
}

.summary-detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Summary Dua --- */
.summary-dua {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.summary-dua-arabic {
  font-family: var(--font-ar);
  font-size: 1.35rem;
  line-height: 2;
  color: var(--gold);
  direction: rtl;
  margin-bottom: 1rem;
}

.summary-dua-english {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.summary-dua-ameen {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.summary-screenshot-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  padding: 0.6rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* --- Streak Badge --- */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 175, 85, 0.1);
  border: 1px solid var(--border-gold);
  border-radius: 50px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--gold);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px var(--gold-dim); }
  50% { box-shadow: 0 0 20px var(--gold-dim); }
}

@keyframes blinkBorder {
  0%, 100% { border-color: var(--gold); }
  50% { border-color: transparent; }
}

@keyframes glowGreen {
  0% { box-shadow: 0 0 0 rgba(74, 222, 128, 0); }
  50% { box-shadow: 0 0 20px rgba(74, 222, 128, 0.3); }
  100% { box-shadow: 0 0 0 rgba(74, 222, 128, 0); }
}

@keyframes glowGold {
  0% { box-shadow: 0 0 0 var(--gold-dim); }
  50% { box-shadow: 0 0 25px var(--gold-dim); }
  100% { box-shadow: 0 0 0 var(--gold-dim); }
}

/* --- Score popup --- */
.score-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  pointer-events: none;
  animation: scoreFloat 1s ease forwards;
  z-index: 100;
}

@keyframes scoreFloat {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100%) scale(1);
  }
}

/* --- Responsive --- */
@media (max-width: 400px) {
  .screen {
    padding: 1rem;
  }

  .day-grid {
    gap: 0.35rem;
  }

  .day-cell {
    font-size: 0.95rem;
  }

  .day-cell .day-date {
    font-size: 0.45rem;
  }

  .day-cell .day-num {
    font-size: 0.9rem;
  }

  .day-cell .day-stars {
    font-size: 0.45rem;
  }

  .home-title {
    font-size: 1.6rem;
  }

  .verse-arabic {
    font-size: 1.3rem;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .reveal-name-arabic {
    font-size: 2rem;
  }

  .home-stats {
    gap: 1.25rem;
  }

  .dhikr-arabic {
    font-size: 1.6rem;
  }

  .dhikr-card {
    padding: 1rem;
  }
}

@media (min-width: 768px) {
  .screen {
    padding: 2rem;
  }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* --- Name of Allah emphasis in reveal text --- */
.name-of-allah {
  color: var(--gold);
  font-weight: 700;
}

/* --- Bismillah divider --- */
.bismillah {
  text-align: center;
  font-family: var(--font-ar);
  font-size: 1.3rem;
  color: var(--gold-dim);
  padding: 1rem 0;
}
