/* ==========================================================================
   Recurr.ai — Modern Mobile-First CSS Architecture
   ========================================================================== */

:root {
  /* Color Tokens - Modern Dark OLED with Radiant Accents */
  --bg-app: #090d16;
  --bg-card: rgba(22, 30, 49, 0.72);
  --bg-card-hover: rgba(30, 41, 69, 0.85);
  --bg-card-solid: #131c31;
  --bg-glass: rgba(15, 23, 42, 0.75);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-focus: #6366f1;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Brand & Status Accents */
  --accent-primary: #8b5cf6;
  --accent-primary-hover: #7c3aed;
  --accent-glow: rgba(139, 92, 246, 0.35);
  
  --nag-warning: #f59e0b;
  --nag-warning-dark: #b45309;
  --nag-glow: rgba(245, 158, 11, 0.3);
  --nag-alert: #ef4444;
  --nag-alert-glow: rgba(239, 68, 68, 0.35);
  
  --done-success: #10b981;
  --done-success-glow: rgba(16, 185, 129, 0.3);
  
  --brand-cyan: #06b6d4;
  --brand-pink: #ec4899;

  /* Sizing & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  color-scheme: dark;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #090d16 65%);
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

/* Typography Helpers */
h1, h2, h3 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Layout Shell */
.app-container {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-inline: 1rem;
}

/* ==========================================================================
   Header Landmark
   ========================================================================== */
.app-header {
  padding-block: 1rem 0.75rem;
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px var(--accent-glow);
  color: #fff;
  position: relative;
  flex-shrink: 0;
}

.logo-icon {
  width: 24px;
  height: 24px;
}

.logo-pulse-dot {
  color: #f43f5e;
  animation: logoPulse 1.8s infinite;
}

@keyframes logoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.brand-accent {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover, .icon-btn:focus-visible {
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  outline: none;
}

.icon-btn .btn-icon {
  width: 20px;
  height: 20px;
}

.status-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #64748b;
  border: 2px solid var(--bg-app);
}

.status-indicator.allowed {
  background: var(--done-success);
  box-shadow: 0 0 8px var(--done-success);
}

.status-indicator.denied {
  background: var(--nag-alert);
}

/* ==========================================================================
   Main Content & Nag Banner
   ========================================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-block: 1rem 2rem;
}

/* Active Nag Banner */
.nag-banner-section {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(239, 68, 68, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 8px 24px var(--nag-glow);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
}

.nag-banner-section.all-done {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(6, 182, 212, 0.1));
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 8px 24px var(--done-success-glow);
}

.nag-banner-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nag-pulse-ring {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}

.pulse-core {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--nag-warning);
  box-shadow: 0 0 12px var(--nag-warning);
  animation: corePulse 1.4s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.all-done .pulse-core {
  background: var(--done-success);
  box-shadow: 0 0 12px var(--done-success);
}

.nag-text-wrap {
  flex: 1;
  min-width: 0;
}

.nag-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nag-warning);
  margin-bottom: 0.15rem;
}

.all-done .nag-badge {
  color: var(--done-success);
}

.nag-headline {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
}

.nag-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.countdown-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--nag-warning);
}

.nag-banner-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ==========================================================================
   Progress Hero Card
   ========================================================================== */
.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.progress-ring-container {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGradientApp);
  stroke: #a855f7;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-center-stat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-percent {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.progress-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-meta {
  flex: 1;
  min-width: 0;
}

.progress-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

.progress-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-block: 0.2rem 0.5rem;
}

.progress-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag-streak {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.tag-timer {
  background: rgba(99, 102, 241, 0.16);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* ==========================================================================
   Toolbar & Filter Tabs
   ========================================================================== */
.tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.filter-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 0.2rem;
}

.tab-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-card-solid);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  min-height: 42px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-glow);
}

.btn-warning-glow {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--nag-glow);
}

.btn-warning-glow:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--nag-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-secondary-subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
}

.btn-secondary-subtle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger-subtle {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
}

.btn-danger-subtle:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-icon-sm {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Task Card List & Items
   ========================================================================== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  transition: transform var(--transition-bounce), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.task-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Nagging Active State for Cards */
.task-card.is-nagging {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 20px var(--nag-glow);
  animation: cardNagPulse 3s ease-in-out infinite;
}

@keyframes cardNagPulse {
  0%, 100% { border-color: rgba(245, 158, 11, 0.4); }
  50% { border-color: rgba(245, 158, 11, 0.85); box-shadow: 0 6px 26px var(--nag-glow); }
}

/* Completed State */
.task-card.is-completed {
  opacity: 0.78;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 26, 40, 0.6);
}

.task-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  justify-content: space-between;
}

.task-right-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}


/* Checkmark Action Button */
.task-check-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  color: transparent;
  flex-shrink: 0;
  transition: all var(--transition-bounce);
}

.task-check-btn:hover {
  border-color: var(--done-success);
  transform: scale(1.05);
}

.task-card.is-completed .task-check-btn {
  background: var(--done-success);
  border-color: var(--done-success);
  color: #ffffff;
  box-shadow: 0 0 16px var(--done-success-glow);
}

.task-check-icon {
  width: 24px;
  height: 24px;
  stroke-width: 3;
}

.task-details {
  flex: 1;
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.task-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.task-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.task-card.is-completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.nag-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.72rem;
}

.nag-status-pill.nagging {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.nag-status-pill.done {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.nag-status-pill.snoozed {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

.streak-pill {
  color: #fb7185;
  font-weight: 600;
}

/* Action Strip (Link, Counter) */
.task-aux-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* Full-Width Primary CTA Button */
.task-cta-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast), opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.task-cta-btn:active {
  transform: scale(0.97);
}

/* Pending (not yet due) */
.task-cta-pending {
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.task-cta-pending:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
}

/* Active / Nagging — tier-based urgency */
.task-cta-active {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #000000;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.45);
}

.task-cta-active:hover {
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.65);
  transform: translateY(-1px) scale(1.005);
}

.task-cta-active.nag-cta-tier-2 {
  background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.5);
}

.task-cta-active.nag-cta-tier-3 {
  background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
  box-shadow: 0 4px 22px rgba(239, 68, 68, 0.6);
  animation: ctaPulse 1.4s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 4px 22px rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 6px 32px rgba(239, 68, 68, 0.9); }
}

/* Completed state */
.task-cta-done {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.85rem;
}

.task-cta-done:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #ffffff;
}



.task-left-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.action-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(99, 102, 241, 0.25);
  transition: all var(--transition-fast);
}

.action-link-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
}

/* Quran & Multi-step Counter Controls */
.counter-box {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.35rem;
  gap: 0.35rem;
  border: 1px solid var(--border-subtle);
}

.counter-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #ffffff;
}

.counter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.counter-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  padding-inline: 0.2rem;
}

.task-right-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-subtle-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.icon-subtle-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.icon-subtle-btn.delete-btn:hover {
  color: #f87171;
}

/* ==========================================================================
   Inspiration Presets
   ========================================================================== */
.inspiration-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
}

.inspiration-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--text-main);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.chip-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

/* ==========================================================================
   Modal Dialog Styles (Native <dialog>)
   ========================================================================== */
.app-modal {
  margin: auto;
  border: none;
  background: transparent;
  padding: 1rem;
  max-width: 520px;
  width: 100%;
}

.app-modal::backdrop {
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-dialog-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  font-size: 1.6rem;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  color: #ffffff;
  transition: border-color var(--transition-fast);
  width: 100%;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-primary);
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

.form-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 42px;
}

.form-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.checkbox-label {
  font-size: 0.88rem;
  color: var(--text-main);
  cursor: pointer;
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Settings Modal Custom Styles */
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-subheading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.settings-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.settings-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.permission-status-text {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-dim);
}

.install-steps-list {
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ==========================================================================
   Toast Alerts Hub
   ========================================================================== */
.toast-hub {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 16px));
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 460px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  z-index: 1000;
}

.toast {
  pointer-events: auto;
  background: #1e1b4b;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.toast-nag {
  background: #451a03;
  border-color: #f59e0b;
}

.toast.toast-success {
  background: #064e3b;
  border-color: #10b981;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Confetti Canvas
   ========================================================================== */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* ==========================================================================
   Footer Landmark & Versioning
   ========================================================================== */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-block: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.footer-version {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Safeguard & Anti-Circumvention Styles
   ========================================================================== */
.modal-header-with-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.safeguard-icon-badge {
  font-size: 1.6rem;
  line-height: 1;
}

.modal-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.safeguard-notice {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.safeguard-notice-text {
  font-size: 0.82rem;
  color: #fca5a5;
  line-height: 1.4;
}

.focus-timer-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.timer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timer-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #c4b5fd;
}

.timer-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.timer-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.6rem;
  font-weight: 800;
  color: #a855f7;
  letter-spacing: -0.02em;
}

.timer-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.timer-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width 1s linear;
}

.form-hint-format {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

/* Report Textarea with Modern Web Guidance :user-invalid and :user-valid */
.report-textarea {
  min-height: 80px;
  resize: vertical;
}

.report-textarea:user-invalid {
  border-color: var(--nag-alert);
  background-color: rgba(239, 68, 68, 0.08);
}

.report-textarea:user-valid {
  border-color: var(--done-success);
  background-color: rgba(16, 185, 129, 0.05);
}

.char-count-row {
  display: flex;
  justify-content: flex-end;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pledge-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
}

.pledge-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

/* History Modal List */
.history-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.history-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-task-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.history-timestamp {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.history-reflection {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--done-success);
}

.history-meta {
  font-size: 0.74rem;
  color: #34d399;
  font-weight: 600;
}

/* Due Time Pill on Cards */
.due-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.due-pill.overdue {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.safeguard-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 480px) {
  .app-container {
    padding-inline: 0.75rem;
  }
  
  .progress-card {
    padding: 1rem;
    gap: 1rem;
  }
  
  .progress-ring-container {
    width: 76px;
    height: 76px;
  }
  
  .progress-heading {
    font-size: 1.05rem;
  }
  
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  
  .task-card-actions {
    flex-wrap: wrap;
  }

  .tasks-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    justify-content: space-between;
  }
}

/* ==========================================================================
   28-Day Consistency Matrix Heatmap
   ========================================================================== */
.heatmap-section {
  width: 100%;
}

.heatmap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.heatmap-title-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.heatmap-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.heatmap-stat {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--done-success);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

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

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 2;
}

.heatmap-cell.lvl-0 {
  background: rgba(255, 255, 255, 0.04);
}

.heatmap-cell.lvl-1 {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
}

.heatmap-cell.lvl-2 {
  background: rgba(16, 185, 129, 0.6);
  border-color: rgba(16, 185, 129, 0.7);
  color: #ffffff;
}

.heatmap-cell.lvl-3 {
  background: #10b981;
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.heatmap-cell.is-today {
  border: 2px solid var(--nag-warning);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-dot.lvl-0 { background: rgba(255, 255, 255, 0.06); }
.legend-dot.lvl-1 { background: rgba(16, 185, 129, 0.3); }
.legend-dot.lvl-2 { background: rgba(16, 185, 129, 0.6); }
.legend-dot.lvl-3 { background: #10b981; }

/* ==========================================================================
   Install Prompt Card Banner
   ========================================================================== */
.install-card-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.install-banner-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.install-banner-icon {
  font-size: 1.5rem;
}

.install-banner-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.install-banner-sub {
  font-size: 0.76rem;
  color: #c7d2fe;
}

.btn-dismiss-install {
  font-size: 1.4rem;
  color: var(--text-dim);
  padding: 0 4px;
}

.btn-dismiss-install:hover {
  color: #fff;
}

/* ==========================================================================
   Photo Upload & Preview
   ========================================================================== */
.photo-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-file-input {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.photo-preview-box {
  position: relative;
  width: 100%;
  max-height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-card);
}

.photo-preview-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.btn-remove-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 1.2rem;
  display: grid;
  place-items: center;
}

/* ==========================================================================
   Quran In-App Reader Modal & Wake Lock
   ========================================================================== */
.reader-modal-content {
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.reader-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.wake-lock-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.page-count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.16);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.reader-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.reader-select {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

.font-size-btns {
  display: flex;
  gap: 0.25rem;
}

.btn-reader-tool {
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.btn-reader-tool:hover {
  background: rgba(255, 255, 255, 0.15);
}

.quran-pages-container {
  overflow-y: auto;
  max-height: 48vh;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quran-verse-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.arabic-text {
  font-family: "Amiri", "Scheherazade New", "Traditional Arabic", serif;
  font-size: 1.45rem;
  line-height: 2;
  text-align: right;
  direction: rtl;
  color: #fef08a;
}

.trans-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.verse-num-badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
}

.reader-page-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.page-step-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   Snooze Duration Grid
   ========================================================================== */
.snooze-duration-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.btn-duration-chip {
  padding: 0.6rem 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--transition-fast);
}

.btn-duration-chip.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ==========================================================================
   Escalating Nag Tiers (Visual Urgency)
   ========================================================================== */
.task-card.nag-tier-1 {
  border-color: rgba(245, 158, 11, 0.4);
}

.task-card.nag-tier-2 {
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: 0 4px 24px rgba(249, 115, 22, 0.35);
  animation: tierTwoPulse 2s ease-in-out infinite;
}

@keyframes tierTwoPulse {
  0%, 100% { border-color: rgba(249, 115, 22, 0.6); }
  50% { border-color: rgba(249, 115, 22, 1); box-shadow: 0 6px 30px rgba(249, 115, 22, 0.5); }
}

.task-card.nag-tier-3 {
  border-color: #ef4444;
  background: rgba(69, 10, 10, 0.4);
  box-shadow: 0 6px 30px rgba(239, 68, 68, 0.5);
  animation: tierThreeAlert 1.2s ease-in-out infinite;
}

@keyframes tierThreeAlert {
  0%, 100% { transform: scale(1); border-color: #ef4444; }
  50% { transform: scale(1.015); border-color: #f43f5e; box-shadow: 0 8px 36px rgba(244, 63, 94, 0.6); }
}

/* ==========================================================================
   Master Audio Controls & Shortcuts
   ========================================================================== */
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-xs-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: #c4b5fd;
  font-weight: 700;
}

.range-slider {
  width: 100%;
  accent-color: var(--accent-primary);
  margin-top: 0.35rem;
}

.sound-test-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.shortcuts-list {
  padding-left: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Quranic Ayah Floating Alarm Banner & Audio Equalizer
   ========================================================================== */
.quran-alarm-card {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.92) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.25rem;
  box-shadow: 0 12px 35px rgba(5, 150, 105, 0.25), 0 0 20px rgba(16, 185, 129, 0.15);
  animation: quranBannerPulse 3s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
}

@keyframes quranBannerPulse {
  0%, 100% {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 12px 35px rgba(5, 150, 105, 0.2);
  }
  50% {
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 14px 40px rgba(245, 158, 11, 0.35);
  }
}

.quran-alarm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quran-alarm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6, 78, 59, 0.8);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: #a7f3d0;
}

.quran-sound-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.quran-sound-wave span {
  width: 3px;
  background: #34d399;
  border-radius: 2px;
  animation: soundWaveAnim 1.2s ease-in-out infinite;
}

.quran-sound-wave span:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.quran-sound-wave span:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.quran-sound-wave span:nth-child(3) { height: 9px; animation-delay: 0.2s; }
.quran-sound-wave span:nth-child(4) { height: 12px; animation-delay: 0.4s; }

@keyframes soundWaveAnim {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

.btn-stop-recitation {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-stop-recitation:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
  transform: scale(1.04);
}

.quran-alarm-arabic {
  font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade', serif;
  font-size: 1.55rem;
  line-height: 1.8;
  direction: rtl;
  text-align: center;
  color: #fef08a;
  text-shadow: 0 0 12px rgba(253, 224, 71, 0.3);
  padding: 0.35rem 0.5rem;
}

.quran-alarm-english {
  font-size: 0.92rem;
  font-style: italic;
  text-align: center;
  color: #e2e8f0;
  line-height: 1.5;
}

.quran-alarm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.reciter-tag {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 500;
}


