/* ==============================================================
   RAMADAN ELITE v3.0 — NEW FEATURES CSS
   - Iftar Countdown Timer
   - Quran Verse of the Day
   - Murottal Player
   - Star Particle / Global Animations
   ============================================================== */

/* ─────────────────────────────────────────────────────────────
   SCROLL REVEAL — smooth entrance for cards
   Cards in hidden sections MUST stay visible when tab is opened
───────────────────────────────────────────────────────────── */

/* Cards in visible sections (not hidden) get entrance animation */
section:not(.hidden-section) > .glass-card:not(.revealed),
section:not(.hidden-section) .glass-card:not(.revealed) {
  animation: cardEntrance 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* Cards in hidden sections — always fully visible when shown */
.hidden-section .glass-card,
.hidden-section .iftar-countdown-card,
.hidden-section .quran-verse-card,
.hidden-section .murottal-card {
  opacity: 1 !important;
  transform: none !important;
}

/* New feature cards always visible */
.iftar-countdown-card,
.quran-verse-card,
.murottal-card {
  opacity: 1;
  transform: none;
}

/* Revealed class for IntersectionObserver (legacy) */
.glass-card.revealed,
.iftar-countdown-card.revealed,
.quran-verse-card.revealed,
.murottal-card.revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* ─────────────────────────────────────────────────────────────
   FORCE NAV & FAB TO ALWAYS BE FIXED — Never let anything override
───────────────────────────────────────────────────────────── */
.fab {
  position: fixed !important;
  bottom: 120px !important;
  right: 24px !important;
  z-index: 9999 !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg) !important;
}

/* Bottom nav: always fixed, always centred, always visible */
nav.fixed,
body > nav {
  position: fixed !important;
  bottom: 24px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 9998 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* When nav is active (pressed) only scale the item, not the nav */
nav.fixed .nav-item.active {
  transform: scale(1.05) !important;
}

/* Toast, modals - never hidden by scroll reveal */
.toast,
.modal-overlay,
/* Removed .prayer-notification-container from here to avoid conflict */
.glass-card:not(main .glass-card) {
  opacity: 1 !important;
  transform: none !important;
}

/* FIX: Ensure Notification is CENTERED (overriding potential conflicts) */
.prayer-notification-container {
  opacity: 1 !important;
  transform: translateX(-50%) !important;
  left: 50% !important;
  transition: top 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) !important;
}

@media (max-width: 480px) {
  .fab {
    bottom: 100px !important;
    right: 16px !important;
    width: 52px !important;
    height: 52px !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   NEBULA FLOAT ANIMATIONS
───────────────────────────────────────────────────────────── */
@keyframes nebulaFloat1 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(20px, -15px) scale(1.1);
  }
  66% {
    transform: translate(-10px, 10px) scale(0.95);
  }
}
@keyframes nebulaFloat2 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  40% {
    transform: translate(-25px, 12px) scale(1.07);
  }
  70% {
    transform: translate(15px, -20px) scale(1.13);
  }
}

/* ─────────────────────────────────────────────────────────────
   ⏱️ IFTAR COUNTDOWN CARD
───────────────────────────────────────────────────────────── */
.iftar-countdown-card {
  box-shadow:
    0 25px 50px rgba(124, 58, 237, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.18);
  transition:
    box-shadow 0.4s ease,
    transform 0.3s ease;
}

.iftar-countdown-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 35px 70px rgba(124, 58, 237, 0.35),
    0 12px 30px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Pulsing icon */
.iftar-icon-pulse {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  animation: iftarIconFloat 4s ease-in-out infinite;
}

@keyframes iftarIconFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.4);
  }
  50% {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 0 0 12px rgba(167, 139, 250, 0);
  }
}

/* Digit blocks */
.iftar-digit-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.iftar-digit {
  font-size: clamp(40px, 12vw, 60px);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow:
    0 0 20px rgba(167, 139, 250, 0.8),
    0 0 60px rgba(167, 139, 250, 0.4);
  transition: transform 0.3s ease;
  min-width: 68px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 8px 12px;
}

.iftar-digit.iftar-digit-flip {
  animation: digitFlip 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes digitFlip {
  0% {
    transform: translateY(0) scaleY(1);
    opacity: 1;
  }
  40% {
    transform: translateY(-6px) scaleY(0.8);
    opacity: 0.7;
  }
  60% {
    transform: translateY(6px) scaleY(0.8);
    opacity: 0.7;
  }
  100% {
    transform: translateY(0) scaleY(1);
    opacity: 1;
  }
}

.iftar-digit-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(167, 139, 250, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.iftar-separator {
  font-size: 42px;
  font-weight: 900;
  color: rgba(167, 139, 250, 0.6);
  line-height: 1;
  animation: separatorBlink 1s ease-in-out infinite;
  transform: translateY(-10px);
}

@keyframes separatorBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Progress track */
.iftar-progress-track {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: visible;
  border: 1px solid rgba(167, 139, 250, 0.15);
}

.iftar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4c1d95, #7c3aed, #a78bfa);
  border-radius: 99px;
  transition: width 0.5s ease;
  position: relative;
}

.iftar-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: inherit;
  filter: blur(4px);
  border-radius: inherit;
  opacity: 0.6;
}

.iftar-progress-glow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow:
    0 0 0 4px rgba(167, 139, 250, 0.3),
    0 0 16px rgba(167, 139, 250, 0.6);
  transition: left 0.5s ease;
  pointer-events: none;
}

/* Badge */
.iftar-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 4px 12px;
}

.iftar-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 8px #a78bfa;
  animation: dotRipple 1.5s ease-in-out infinite;
}

/* Celebration state */
.iftar-celebrate .iftar-digit {
  color: #fbbf24;
  text-shadow:
    0 0 20px rgba(251, 191, 36, 0.8),
    0 0 60px rgba(251, 191, 36, 0.4);
  animation: celebrate 0.6s ease-in-out infinite alternate;
}

@keyframes celebrate {
  from {
    transform: scale(1) rotate(-2deg);
  }
  to {
    transform: scale(1.05) rotate(2deg);
  }
}

/* ─────────────────────────────────────────────────────────────
   📖 QURAN VERSE OF THE DAY
───────────────────────────────────────────────────────────── */
.quran-verse-card {
  box-shadow:
    0 25px 50px rgba(4, 120, 87, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.2);
  transition:
    box-shadow 0.4s ease,
    transform 0.3s ease;
}

.quran-verse-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 35px 70px rgba(4, 120, 87, 0.4),
    0 12px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Refresh button */
.quran-refresh-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.quran-refresh-btn:hover {
  background: rgba(52, 211, 153, 0.2);
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.3);
}

/* Flip container */
.quran-flip-container {
  perspective: 800px;
}

.quran-flip-inner {
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
  transform-origin: center top;
}

.quran-flip-inner.quran-flipping {
  transform: scaleY(0) translateY(-20px);
  opacity: 0;
}

.quran-flip-inner.quran-flip-in {
  animation: flipIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes flipIn {
  0% {
    transform: scaleY(0.6) translateY(-16px);
    opacity: 0.4;
  }
  100% {
    transform: scaleY(1) translateY(0);
    opacity: 1;
  }
}

/* Translation box */
.quran-translation-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(4px);
}

/* Navigation dots */
.quran-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.quran-dot.active {
  width: 18px;
  border-radius: 4px;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

/* @keyframes spin for refresh icon */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─────────────────────────────────────────────────────────────
   🎵 MUROTTAL PLAYER
───────────────────────────────────────────────────────────── */
.murottal-card {
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 6px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.15);
  transition:
    box-shadow 0.4s ease,
    transform 0.3s ease;
}

.murottal-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.5),
    0 10px 25px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ---- Visualizer bars ---- */
.murottal-visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 48px;
}

.viz-bar {
  flex: 1;
  border-radius: 3px;
  background: linear-gradient(to top, #d97706, #fbbf24);
  min-height: 4px;
  max-height: 100%;
  height: var(--h, 50%);
  opacity: 0.35;
  transition:
    height 0.15s ease,
    opacity 0.3s ease;
}

.murottal-visualizer.active .viz-bar {
  opacity: 1;
  animation: vizDance var(--speed, 0.8s) ease-in-out var(--delay, 0s) infinite
    alternate;
}

@keyframes vizDance {
  0% {
    height: 20%;
  }
  50% {
    height: var(--h, 60%);
  }
  100% {
    height: calc(var(--h, 60%) * 0.5);
  }
}

/* Each bar gets varied speed */
.viz-bar:nth-child(1) {
  --speed: 0.7s;
}
.viz-bar:nth-child(2) {
  --speed: 0.9s;
}
.viz-bar:nth-child(3) {
  --speed: 0.65s;
}
.viz-bar:nth-child(4) {
  --speed: 0.85s;
}
.viz-bar:nth-child(5) {
  --speed: 0.75s;
}
.viz-bar:nth-child(6) {
  --speed: 1s;
}
.viz-bar:nth-child(7) {
  --speed: 0.72s;
}
.viz-bar:nth-child(8) {
  --speed: 0.88s;
}
.viz-bar:nth-child(9) {
  --speed: 0.68s;
}
.viz-bar:nth-child(10) {
  --speed: 0.95s;
}
.viz-bar:nth-child(11) {
  --speed: 0.78s;
}
.viz-bar:nth-child(12) {
  --speed: 0.82s;
}
.viz-bar:nth-child(13) {
  --speed: 0.7s;
}
.viz-bar:nth-child(14) {
  --speed: 0.92s;
}
.viz-bar:nth-child(15) {
  --speed: 0.76s;
}
.viz-bar:nth-child(16) {
  --speed: 0.88s;
}

/* ---- Track pills ---- */
.murottal-track-btn {
  font-size: 11px;
  font-weight: 700;
  color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.12);
  border-radius: 20px;
  padding: 5px 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.murottal-track-btn:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
}

.murottal-track-btn.active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

/* ---- Controls ---- */
.murottal-ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.murottal-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: scale(1.1);
}

/* Play/Pause main button */
.murottal-play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #d97706, #f59e0b, #fbbf24);
  color: #1c1917;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 6px 20px rgba(245, 158, 11, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.murottal-play-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
}

.murottal-play-btn:hover {
  transform: scale(1.1);
  box-shadow:
    0 10px 30px rgba(245, 158, 11, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

.murottal-play-btn.playing {
  animation: playBtnPulse 2s ease-in-out infinite;
}

@keyframes playBtnPulse {
  0%,
  100% {
    box-shadow:
      0 6px 20px rgba(245, 158, 11, 0.4),
      0 0 0 0 rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow:
      0 6px 20px rgba(245, 158, 11, 0.6),
      0 0 0 12px rgba(245, 158, 11, 0);
  }
}

/* Volume slider */
.murottal-volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.murottal-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}

.murottal-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fbbf24;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  transition: transform 0.2s ease;
}

.murottal-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Title swap animation */
.murottal-title-swap {
  animation: titleSwap 0.2s ease;
}

@keyframes titleSwap {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  50% {
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.dash-widget {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px; /* More rounded */
  padding: 18px;
  overflow: hidden;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 135px; /* Taller to fit text comfortably */
}

.dash-widget:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.8);
}

.dash-widget-icon-bg {
  position: absolute;
  right: -15px;
  bottom: -15px;
  font-size: 96px; /* Bigger icon */
  opacity: 0.12; /* Slightly more visible */
  transform: rotate(-15deg);
  pointer-events: none;
}

.dash-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-value {
  font-size: 20px; /* Responsive base */
  font-weight: 800;
  color: #1e293b;
  line-height: 1.1;
  z-index: 2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.dash-sub {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: auto;
  z-index: 2;
}

/* Specific Colors */
.widget-next {
  border-left: 4px solid #f59e0b;
}
.widget-iftar {
  border-left: 4px solid #f43f5e;
}

.widget-next .dash-value {
  background: linear-gradient(45deg, #d97706, #f59e0b);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.widget-iftar .dash-value {
  background: linear-gradient(45deg, #e11d48, #f43f5e);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Formatting for elements injected by JS into countdown */
.dash-value span {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8 !important; /* Override gradient text color for sub-label */
  -webkit-text-fill-color: #94a3b8 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.dash-value br {
  display: none;
}

/* 🧠 NEW FEATURE: DAILY INSIGHT CARD */
.insight-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fff1f2 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.1);
}

.insight-decoration {
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #f59e0b, #f43f5e);
  opacity: 0.1;
  border-bottom-left-radius: 60px;
}

.insight-content {
  position: relative;
  z-index: 2;
}

.insight-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #d97706;
  margin-bottom: 8px;
}

.insight-text {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  line-height: 1.5;
  font-style: italic;
}

.insight-source {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-align: right;
  margin-top: 6px;
}

@media (max-width: 360px) {
  .dash-value {
    font-size: 16px;
  }
  .dash-widget {
    padding: 14px;
  } /* Removed fixed height, let it grow */
}

/* ─────────────────────────────────────────────────────────────
   🌟 STAR PARTICLES (floating in header)
───────────────────────────────────────────────────────────── */
.star-particle {
  position: absolute;
  border-radius: 50%;
  background: white;
  pointer-events: none;
  animation: starFloat linear forwards;
  opacity: 0;
}

@keyframes starFloat {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1.2);
  }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .iftar-digit {
    font-size: 36px;
    min-width: 56px;
    padding: 6px 8px;
  }
  .iftar-separator {
    font-size: 32px;
  }
  .murottal-play-btn {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
  .murottal-volume-slider {
    width: 60px;
  }
}

@media (min-width: 480px) {
  .iftar-digit {
    font-size: 64px;
    min-width: 80px;
  }
  .murottal-visualizer {
    height: 60px;
  }
}
