:root {
  --emerald-950: #061510;
  --emerald-900: #0b241b;
  --emerald-800: #13392c;
  --emerald-700: #1b503e;
  --gold-300: #f0d79c;
  --gold-400: #dfc077;
  --gold-500: #c59b47;
  --gold-600: #9f792d;
  --gold-100: #f9f2e3;
  --ivory: #faf8f2;
  --surface: #ffffff;
  --ink: #171e1b;
  --ink-muted: #5b6761;
  --border: #e6dfd0;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-card: 0 12px 36px rgba(6, 21, 16, 0.07);
  --shadow-hover: 0 18px 44px rgba(6, 21, 16, 0.11);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Header */
.hero-header {
  position: relative;
  overflow: hidden;
  background: var(--emerald-950);
  color: #fff;
  padding-top: calc(20px + env(safe-area-inset-top));
  border-bottom: 2px solid rgba(223, 192, 119, 0.45);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.48;
  transform: scale(1.03);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 21, 16, 0.72) 0%,
    rgba(6, 21, 16, 0.56) 48%,
    rgba(6, 21, 16, 0.94) 100%
  );
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.sanctuary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(223, 192, 119, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-300);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 8px var(--gold-400);
}

.hero-actions {
  display: flex;
  gap: 8px;
}

.glass-btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
}

.glass-btn:hover,
.glass-btn.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--gold-400);
}

.glass-btn-gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: var(--emerald-950);
  border-color: transparent;
}

.glass-btn-sm {
  padding: 6px 13px;
  font-size: 0.78rem;
}

.bismillah {
  font-family: "Amiri", serif;
  font-size: 2.05rem;
  color: var(--gold-300);
  text-align: center;
  margin: 0 0 14px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}

.hero-title-block {
  text-align: center;
  padding-bottom: 26px;
}

.site-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 0%, var(--gold-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-subtitle {
  margin: 8px auto 0;
  max-width: 540px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

/* Desktop Tabs */
.desktop-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 13px 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.tab-btn.active {
  background: var(--ivory);
  color: var(--emerald-950);
  border-color: var(--ivory);
}

.tab-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.tab-btn.active .tab-pill {
  background: var(--emerald-900);
  color: var(--gold-300);
}

/* Main Content */
.main-content {
  padding: 30px 20px 72px;
}

.tab-panel[hidden] {
  display: none;
}

/* Controls */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.search-wrap {
  position: relative;
  flex: 1 1 260px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  outline: none;
  box-shadow: 0 4px 16px rgba(6, 21, 16, 0.04);
}

.search-wrap input:focus {
  border-color: var(--gold-500);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--emerald-900);
  color: var(--gold-300);
  border-color: var(--emerald-900);
}

/* Dua Cards */
.dua-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dua-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 40px;
  position: relative;
  overflow: hidden;
}

.dua-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--emerald-900), var(--gold-500), var(--emerald-900));
}

.dua-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.dua-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold-100);
  color: var(--gold-600);
  letter-spacing: 0.02em;
}

.badge-status {
  background: #e7f4ee;
  color: var(--emerald-800);
}

.dua-date {
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.dua-title {
  font-family: "Cormorant Garamond", "Amiri", serif;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--emerald-950);
  margin: 0 0 18px;
}

.dua-invocation {
  font-family: "Amiri", serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--emerald-800);
  margin: 0 0 20px;
  padding: 10px 16px;
  border-left: 3px solid var(--gold-500);
  background: linear-gradient(90deg, rgba(249, 242, 227, 0.7), transparent);
  border-radius: 0 10px 10px 0;
}

.dua-body p {
  margin: 0 0 16px;
  font-size: 1.02rem;
  max-width: 68ch;
}

.dua-items {
  margin: 22px 0;
  padding: 20px 24px;
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.dua-items-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gold-600);
  margin: 0 0 12px;
  font-weight: 700;
}

.dua-items ul {
  margin: 0;
  padding-left: 18px;
}

.dua-items li {
  margin-bottom: 9px;
  font-size: 0.97rem;
}

.dua-closing {
  font-family: "Amiri", serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--emerald-900);
  margin: 22px 0 0;
}

.dua-actions {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ameen-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(11, 36, 27, 0.2);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.ameen-btn:active {
  transform: scale(0.95);
}

.ameen-count {
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--gold-300);
}

.copy-btn {
  background: var(--ivory);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  padding: 10px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--gold-500);
  color: var(--ink);
}

/* Counter Banner */
.counter-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--emerald-950);
  color: #fff;
  margin-bottom: 24px;
  border: 1px solid rgba(223, 192, 119, 0.32);
  box-shadow: var(--shadow-card);
}

.counter-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.42;
}

.counter-banner-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6, 21, 16, 0.88), rgba(11, 36, 27, 0.72));
}

.counter-banner-content {
  position: relative;
  z-index: 2;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.counter-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.stat-box {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-300);
  font-weight: 700;
}

.stat-value {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.3rem;
  line-height: 1.05;
  color: #fff;
}

.stat-divider {
  width: 1px;
  height: 38px;
  background: rgba(255, 255, 255, 0.16);
}

.target-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.target-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.target-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: auto;
}

.target-pill {
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.target-pill.active {
  background: var(--gold-400);
  color: var(--emerald-950);
  border-color: var(--gold-400);
}

/* Wird Cards */
.wird-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.wird-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.wird-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--gold-500);
}

.wird-card.target-met {
  border-color: var(--emerald-700);
  background: linear-gradient(180deg, #ffffff 0%, #f3faf6 100%);
}

.wird-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.wird-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-600);
  background: var(--gold-100);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.wird-arabic {
  font-family: "Amiri", serif;
  font-size: 1.72rem;
  line-height: 1.55;
  color: var(--emerald-950);
  text-align: right;
  margin: 0;
}

.wird-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--emerald-900);
  margin: 6px 0 2px;
}

.wird-ref {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0;
}

.wird-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--ivory);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 10px;
}

.wird-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-500), var(--emerald-700));
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.wird-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.wird-counts {
  display: flex;
  flex-direction: column;
}

.wird-today {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--emerald-950);
  line-height: 1;
}

.wird-today small {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.wird-alltime {
  font-size: 0.76rem;
  color: var(--ink-muted);
  margin-top: 3px;
}

.wird-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wird-dec {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--ivory);
  color: var(--ink-muted);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.wird-inc {
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
  color: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(11, 36, 27, 0.24);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.wird-inc:active {
  transform: scale(0.93);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 42px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.ayah-quote {
  font-family: "Amiri", serif;
  font-size: 1.18rem;
  color: var(--emerald-900);
  margin: 0 0 6px;
}

.footer-note {
  margin: 0;
  font-size: 0.82rem;
}

.loading-state,
.empty-state {
  text-align: center;
  color: var(--ink-muted);
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* Mobile Floating Dock (iPhone 15 Pro Max optimized) */
.mobile-dock {
  display: none;
}

/* Focus Mode */
body.focus-mode .controls-bar,
body.focus-mode .site-footer,
body.focus-mode .counter-banner {
  display: none;
}

@media (max-width: 768px) {
  .desktop-tabs {
    display: none;
  }

  .hero-title-block {
    padding-bottom: 24px;
  }

  .bismillah {
    font-size: 1.65rem;
  }

  .main-content {
    padding: 22px 16px calc(104px + env(safe-area-inset-bottom));
  }

  .wird-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dua-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

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

  .stat-divider {
    display: none;
  }

  .counter-banner-content {
    padding: 20px;
  }

  .wird-inc {
    height: 52px;
    padding: 0 26px;
    font-size: 0.98rem;
  }

  .wird-dec {
    width: 44px;
    height: 44px;
  }

  .site-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .mobile-dock {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
    border-radius: 24px;
    background: rgba(6, 21, 16, 0.88);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(223, 192, 119, 0.3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  }

  .dock-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
  }

  .dock-btn svg {
    width: 20px;
    height: 20px;
  }

  .dock-btn.active {
    background: rgba(223, 192, 119, 0.18);
    color: var(--gold-300);
  }

  .dock-badge {
    position: absolute;
    top: 4px;
    right: 18px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--gold-400);
    color: var(--emerald-950);
    font-size: 0.66rem;
    font-weight: 700;
    display: grid;
    place-items: center;
  }
}

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .hero-header {
    background: #fff;
    color: #000;
    border-bottom: 2px solid #000;
  }
  .hero-bg,
  .hero-scrim {
    display: none;
  }
  .site-title {
    -webkit-text-fill-color: #000;
  }
  .bismillah,
  .site-subtitle {
    color: #333;
  }
  .dua-card,
  .wird-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
