:root {
  --green:  #2d6a4f;
  --green2: #40916c;
  --green3: #74c69d;
  --gold:   #e9c46a;
  --gold2:  #f4a261;
  --cream:  #fefae0;
  --dark:   #1b2d27;
  --card:   #ffffff;
  --shadow: 0 4px 20px rgba(45,106,79,0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--dark);
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  text-decoration: none;
}

.nav-btn {
  flex: 1;
  padding: 12px 0 10px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.5);
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: color 0.2s;
  text-decoration: none;
}

.nav-btn .nav-icon { font-size: 1.3rem; }
.nav-btn.active { color: var(--gold); }

/* ── HEADER ── */
.header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--green) 100%);
  color: white;
  padding: 28px 20px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.header-arabic { font-family:'Amiri',serif; font-size:1.6rem; color:var(--gold); margin-bottom:4px; position:relative; }
.header h1 { font-size:1.35rem; font-weight:900; letter-spacing:-0.5px; position:relative; }
.header p  { font-size:0.82rem; opacity:0.75; margin-top:4px; position:relative; }

.date-bar {
  background: var(--green2);
  color: white;
  text-align: center;
  padding: 9px;
  font-size: 0.88rem;
  font-weight: 700;
}

/* ── STAR BAR ── */
.star-bar {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 14px 20px;
  text-align: center;
}

.star-bar-label {
  color: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.star-row { display:flex; justify-content:center; align-items:center; gap:4px; flex-wrap:wrap; min-height:32px; }

.star-item {
  font-size: 1.5rem;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  opacity: 0.2;
  filter: grayscale(1);
}

.star-item.lit {
  opacity: 1;
  filter: none;
  transform: scale(1.15);
  animation: starPop 0.4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes starPop {
  0%   { transform: scale(0.5); }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1.15); }
}

.star-hint {
  color: rgba(255,255,255,0.45);
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 5px;
}

.star-hint.warn { color: #ff8a65; }
.star-hint.good { color: var(--green3); }

/* ── PROGRESS RING ── */
.progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 8px;
}

.ring-box { position:relative; width:110px; height:110px; }
.ring-box svg { transform:rotate(-90deg); }
.ring-bg   { fill:none; stroke:#d8f3dc; stroke-width:10; }
.ring-fill {
  fill:none; stroke:var(--green2); stroke-width:10;
  stroke-linecap:round; stroke-dasharray:283;
  stroke-dashoffset:283;
  transition:stroke-dashoffset 0.6s cubic-bezier(.4,0,.2,1);
}
.ring-text { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.ring-text .pct { font-size:1.5rem; font-weight:900; color:var(--green); }
.ring-text .lbl { font-size:0.65rem; color:#666; font-weight:700; }
.progress-msg { margin-top:8px; font-size:0.88rem; font-weight:700; color:var(--green); text-align:center; }

/* ── SECTION TITLE ── */
.section-title { display:flex; align-items:center; gap:8px; margin:18px 16px 10px; }
.section-title .badge {
  background:var(--green); color:white; border-radius:20px;
  padding:3px 12px; font-size:0.78rem; font-weight:800;
  text-transform:uppercase; letter-spacing:0.5px;
}
.section-title .line { flex:1; height:2px; background:linear-gradient(to right,var(--green3),transparent); border-radius:2px; }

/* ── TASK CARD ── */
.task-card {
  background: var(--card);
  border-radius: 16px;
  margin: 0 16px 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.3s, transform 0.2s;
  cursor: pointer;
}

.task-card:active { transform: scale(0.98); }
.task-card.done   { border-color:var(--green3); background:#f0faf4; }
.task-inner { display:flex; align-items:center; padding:14px 16px; gap:14px; }

.check-circle {
  width:34px; height:34px; border-radius:50%;
  border:2.5px solid var(--green3);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
  transition:background 0.25s, border-color 0.25s;
  font-size:1rem; color:transparent;
}

.task-card.done .check-circle { background:var(--green2); border-color:var(--green2); color:white; }
.task-info { flex:1; }
.task-name { font-size:0.95rem; font-weight:800; color:var(--dark); line-height:1.3; }
.task-card.done .task-name { color:var(--green2); }
.task-sub  { font-size:0.76rem; color:#888; margin-top:2px; font-weight:600; }
.task-right { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.task-emoji { font-size:1.5rem; }
.task-time-badge {
  background:#f0faf4; color:var(--green2);
  border-radius:8px; padding:2px 8px;
  font-size:0.7rem; font-weight:800;
}
.task-card.done .task-time-badge { background:var(--green3); color:white; }

.level-pill {
  display:inline-block; border-radius:20px; padding:1px 8px;
  font-size:0.65rem; font-weight:800; text-transform:uppercase; letter-spacing:0.4px; margin-top:3px;
}

.pill-must_do    { background:#ffe0e0; color:#c0392b; }
.pill-extra_prayer { background:#fff3cd; color:#856404; }
.pill-morning_dua  { background:#e8f4f8; color:#1565c0; }
.pill-evening_dua  { background:#e8f4f8; color:#1565c0; }
.pill-charity      { background:#e8f5e9; color:#2e7d32; }

/* ── REWARD BOX ── */
.reward-box {
  margin:0 16px 10px;
  background:linear-gradient(135deg,#fff8e1,#fffde7);
  border:2px solid var(--gold); border-radius:14px; padding:12px 14px;
  display:none; animation:popIn 0.3s ease;
}
.reward-box.show { display:block; }
.reward-box p { font-size:0.8rem; color:#5d4037; font-weight:700; line-height:1.5; }
.reward-title { font-size:0.72rem; font-weight:900; color:#e65100; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:4px; }

/* ── CHARITY ── */
.charity-card {
  margin:0 16px 10px;
  background:linear-gradient(135deg,var(--dark),var(--green));
  border-radius:16px; padding:16px; color:white;
  box-shadow:0 6px 24px rgba(45,106,79,0.3);
}
.charity-top { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.charity-top .emoji { font-size:1.8rem; }
.charity-top h3 { font-size:1rem; font-weight:900; }
.charity-top p  { font-size:0.75rem; opacity:0.8; }

.charity-btn {
  width:100%; background:var(--gold); color:var(--dark);
  border:none; border-radius:12px; padding:11px;
  font-size:0.9rem; font-weight:900; cursor:pointer;
  font-family:'Nunito',sans-serif; transition:background 0.2s, transform 0.15s;
}
.charity-btn:active { transform:scale(0.97); }
.charity-btn.given  { background:var(--green3); color:white; }

/* ── QUOTE ── */
.quote-card {
  margin:0 16px 10px;
  background:white; border-left:4px solid var(--gold2);
  border-radius:0 12px 12px 0; padding:14px; box-shadow:var(--shadow);
}
.quote-card p    { font-size:0.82rem; color:#444; font-style:italic; line-height:1.6; }
.quote-card span { font-size:0.72rem; color:var(--green2); font-weight:800; display:block; margin-top:6px; }

/* ── DONE BANNER ── */
.done-banner {
  display:none; margin:16px;
  background:linear-gradient(135deg,var(--green),var(--green2));
  border-radius:16px; padding:20px; text-align:center; color:white;
  box-shadow:0 8px 30px rgba(45,106,79,0.35); animation:popIn 0.5s ease;
}
.done-banner.show { display:block; }
.done-banner .big { font-size:2.5rem; }
.done-banner h2   { font-size:1.2rem; font-weight:900; margin:8px 0 4px; }
.done-banner p    { font-size:0.82rem; opacity:0.9; }

/* ── RESET / VIEW HISTORY BUTTON ── */
.reset-btn {
  display:inline-block; margin:6px auto 0;
  background:none; border:2px solid var(--green3); color:var(--green);
  border-radius:20px; padding:7px 22px;
  font-size:0.8rem; font-weight:800; cursor:pointer;
  font-family:'Nunito',sans-serif; transition:background 0.2s;
  text-decoration: none;
}
.reset-btn:hover { background:#d8f3dc; }

/* ── HISTORY PAGE ── */
.hist-header {
  background:linear-gradient(135deg,var(--dark),var(--green));
  color:white; padding:28px 20px 22px; text-align:center;
}
.hist-header h1 { font-size:1.4rem; font-weight:900; }
.hist-header p  { font-size:0.82rem; opacity:0.75; margin-top:4px; }

.hist-empty {
  text-align:center; padding:50px 20px;
  color:#888; font-size:0.9rem; font-weight:700;
}
.hist-empty .big { font-size:3rem; margin-bottom:10px; }

.hist-card {
  background:white; border-radius:16px;
  margin:12px 16px 0; padding:16px;
  box-shadow:var(--shadow);
  animation:popIn 0.3s ease;
}
.hist-top {
  display:flex; justify-content:space-between;
  align-items:flex-start; margin-bottom:10px;
}
.hist-date { font-size:0.85rem; font-weight:900; color:var(--dark); }
.hist-date-sub { font-size:0.72rem; color:#888; font-weight:700; }
.hist-stars { display:flex; gap:2px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.hist-star  { font-size:1.1rem; }
.hist-star.dim { opacity:0.15; filter:grayscale(1); }
.hist-count { font-size:0.72rem; font-weight:900; color:var(--green2); }

.hist-tasks {
  display:flex; flex-wrap:wrap; gap:5px; margin-top:8px;
}
.hist-task-chip {
  background:#f0faf4; color:var(--green2);
  border-radius:20px; padding:3px 10px;
  font-size:0.68rem; font-weight:800;
}
.hist-task-chip.must { background:#ffe0e0; color:#c0392b; }

.hist-clear-btn {
  background:none; border:2px solid #ffccbc; color:#e64a19;
  border-radius:20px; padding:7px 22px;
  font-size:0.8rem; font-weight:800; cursor:pointer;
  font-family:'Nunito',sans-serif;
}

.hist-summary {
  margin:12px 16px 0; background:linear-gradient(135deg,#1a1a2e,#16213e);
  border-radius:16px; padding:16px; color:white; text-align:center;
}
.hist-summary h3 {
  font-size:0.85rem; font-weight:900; opacity:0.7;
  text-transform:uppercase; letter-spacing:0.5px; margin-bottom:10px;
}
.hist-stats { display:flex; justify-content:space-around; }
.hist-stat-val { font-size:1.6rem; font-weight:900; color:var(--gold); }
.hist-stat-lbl { font-size:0.68rem; opacity:0.7; font-weight:700; margin-top:2px; }

@keyframes popIn {
  from { opacity:0; transform:scale(0.94) translateY(6px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
