/* ==========================================================================
   SALAM — Reusable Pure CSS3 Component Library
   ========================================================================== */

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.grid-prayers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-prayers { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-prayers { grid-template-columns: repeat(6, 1fr); }
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--emerald-600);
  box-shadow: var(--shadow-elevated);
}

.hero-card {
  background: var(--bg-hero);
  color: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.65rem;
  box-shadow: var(--shadow-elevated);
  position: relative;
  overflow: hidden;
}

/* Section Headers */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-gold);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.section-eyebrow svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.1rem;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--emerald-900);
  color: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  background: var(--emerald-800);
}

[data-theme="dark"] .btn-primary {
  background: var(--gold-400);
  color: var(--emerald-950);
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--gold-300);
}

.btn-gold {
  background: var(--gold-400);
  color: var(--emerald-950);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: var(--gold-300);
}

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

.btn-secondary:hover {
  border-color: var(--emerald-600);
  background: var(--bg-surface-alt);
}

.btn-ghost {
  background: rgba(6, 95, 70, 0.08);
  color: var(--text-accent);
}

.btn-ghost:hover {
  background: rgba(6, 95, 70, 0.16);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.76rem;
  border-radius: 10px;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.14);
  color: var(--text-accent);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-gold {
  background: rgba(212, 175, 55, 0.16);
  color: var(--text-gold);
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.badge-dark {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Form Controls */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-field, .select-field {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast);
}

.input-field:focus, .select-field:focus {
  outline: none;
  border-color: var(--emerald-600);
}

.search-bar-wrap {
  position: relative;
  width: 100%;
}

.search-bar-wrap svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.72rem 1rem 0.72rem 2.65rem;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* Filter Chip Strip */
.chip-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.chip-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.chip-btn:hover {
  border-color: var(--emerald-600);
}

.chip-btn.active {
  background: var(--emerald-900);
  color: var(--gold-300);
  border-color: var(--gold-400);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(100, 116, 139, 0.35);
  transition: var(--transition-fast);
  border-radius: 34px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: var(--transition-fast);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--emerald-600);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Prayer Time Box */
.prayer-slot {
  border-radius: 16px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.prayer-slot.next-active {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--gold-400);
  box-shadow: var(--shadow-gold);
}

.prayer-slot-surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.prayer-slot-surface.next-active {
  background: var(--emerald-900);
  color: #ffffff;
  border-color: var(--gold-400);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(6, 95, 70, 0.14);
  overflow: hidden;
}

[data-theme="dark"] .progress-track {
  background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--emerald-600), var(--gold-400));
  transition: width 300ms ease;
}

/* Quran Ayah Card */
.ayah-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color var(--transition-fast);
}

.ayah-card.playing {
  border-color: var(--gold-400);
  box-shadow: var(--shadow-gold);
  background: linear-gradient(to bottom, var(--bg-surface), rgba(212, 175, 55, 0.06));
}

.ayah-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.ayah-number-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(6, 95, 70, 0.1);
  border: 1px solid var(--border-Gold);
  color: var(--text-accent);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ayah-end-ornament {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--gold-500);
  margin: 0 0.35rem;
  font-family: var(--font-sans);
}

/* Hifz Self-Test Blur */
.hifz-hidden-text {
  filter: blur(8px);
  user-select: none;
  cursor: pointer;
  transition: filter 200ms ease;
}

.hifz-hidden-text.revealed, .hifz-hidden-text:hover {
  filter: blur(0);
}

/* Qibla Compass Dial */
.compass-wrap {
  width: 280px;
  height: 280px;
  margin: 1rem auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compass-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--emerald-900) 0%, var(--emerald-950) 100%);
  border: 4px solid var(--gold-400);
  box-shadow: var(--shadow-elevated), inset 0 0 28px rgba(0, 0, 0, 0.55);
  position: relative;
  transition: transform 150ms ease-out;
}

.compass-cardinal {
  position: absolute;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold-300);
}

.compass-n { top: 10px; left: 50%; transform: translateX(-50%); color: #f87171; }
.compass-e { right: 12px; top: 50%; transform: translateY(-50%); }
.compass-s { bottom: 10px; left: 50%; transform: translateX(-50%); }
.compass-w { left: 12px; top: 50%; transform: translateY(-50%); }

.qibla-pointer {
  position: absolute;
  inset: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: transform 200ms ease-out;
  pointer-events: none;
}

.kaaba-marker {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #111827;
  border: 2px solid var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-gold);
  position: relative;
}

.kaaba-marker::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 3px;
  right: 3px;
  height: 3px;
  background: var(--gold-400);
}

/* Digital Tasbih Tap Circle */
.tasbih-tap-button {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  margin: 0.75rem auto;
  background: var(--bg-hero);
  border: 4px solid var(--gold-400);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-elevated), 0 0 0 8px rgba(212, 175, 55, 0.12);
  transition: transform 90ms ease, box-shadow 150ms ease;
  user-select: none;
}

.tasbih-tap-button:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-gold), 0 0 0 12px rgba(212, 175, 55, 0.25);
}

.tasbih-count-num {
  font-family: var(--font-mono);
  font-size: 3.3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-300);
}

/* Islamic Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.4rem 0;
}

.calendar-day-cell {
  min-height: 68px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition-fast);
}

.calendar-day-cell.today {
  background: var(--emerald-900);
  color: #ffffff;
  border-color: var(--gold-400);
  box-shadow: var(--shadow-gold);
}

.calendar-day-cell.has-event {
  border-color: var(--gold-400);
  background: rgba(212, 175, 55, 0.08);
}

/* Toast Notification Alert */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 0.75rem);
  right: 1rem;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.toast-msg {
  background: var(--emerald-900);
  color: #ffffff;
  border: 1px solid var(--gold-400);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: fadeIn 200ms ease forwards;
}


/* ==========================================================================
   CREATOR SIGNATURE ("Mabifa Hussein") & APPLICATION FOOTER
   ========================================================================== */
@keyframes sigFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sigFlourishDraw {
  from {
    stroke-dashoffset: 320;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.creator-sig-wrap {
  display: inline-flex;
  flex-direction: column;
  animation: sigFadeIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.creator-sig-wrap--welcome {
  align-items: flex-start;
  margin-top: 0.65rem;
}

.creator-sig-wrap--about {
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

.creator-sig-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 239, 201, 0.78);
}

.creator-sig-script-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

.creator-sig-name {
  font-family: 'Great Vibes', 'Brush Script MT', 'Segoe Script', cursive;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-block;
  transform: rotate(-3deg);
  transform-origin: left center;
  background: linear-gradient(135deg, #fbf8eb 0%, #f3df8a 38%, #d4af37 68%, #9a741b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 6px rgba(212, 175, 55, 0.24));
  user-select: none;
}

.creator-sig-name--welcome {
  font-size: clamp(1.45rem, 3.2vw, 1.85rem);
  padding-right: 0.25rem;
}

.creator-sig-name--about {
  font-size: clamp(2.15rem, 5vw, 2.95rem);
  transform-origin: center center;
  padding: 0.15rem 0.4rem 0;
}

.creator-sig-name--footer {
  font-size: 1.15rem;
  transform: rotate(-2deg);
  background: linear-gradient(135deg, #d4af37 0%, #9a741b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .creator-sig-name--footer {
  background: linear-gradient(135deg, #f6efc9 0%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.creator-sig-flourish {
  width: 100%;
  max-width: 185px;
  height: auto;
  margin-top: -2px;
  display: block;
}

.creator-sig-wrap--about .creator-sig-flourish {
  max-width: 260px;
}

.creator-sig-flourish-path {
  stroke-dasharray: 320;
  stroke-dashoffset: 0;
  animation: sigFlourishDraw 1.1s ease-out both;
}

.creator-sig-caption {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-200, #f3df8a);
  margin-top: 0.25rem;
}

.creator-about-card {
  background: linear-gradient(145deg, #022c22 0%, #064e3b 65%, #0b3b2e 100%);
  color: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 20px;
  padding: 1.65rem 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  box-shadow: 0 14px 34px rgba(2, 44, 34, 0.22);
}

.salam-app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.65rem;
  padding: 1rem 1.25rem 1.35rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.creator-sig-footer {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.creator-sig-label-inline {
  font-size: 0.74rem;
  color: var(--text-muted);
}

@media (max-width: 1023px) {
  .salam-app-footer {
    padding: 0.85rem 1rem 1.1rem;
  }
}
