/**
 * ═══════════════════════════════════════════════════════════════════
 * NAAM ABHYAS - iOS STYLE TIMER PAGE
 * Inspired by iOS Clock timer - Beautiful, clean, minimal
 * ═══════════════════════════════════════════════════════════════════
 */

/* ═══ KEEP HEADER ON MAIN PAGE - Only hide during timer ═══ */
body.timer-active .app-header {
  display: none !important;
}

/* ═══ NEW iOS MINIMAL HEADER - Only show during timer ═══ */
.ios-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: max(env(safe-area-inset-top, 44px), 44px);
  background: rgba(28, 28, 30, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}

body.timer-active .ios-header {
  display: flex !important;
}

.ios-header-left,
.ios-header-right {
  min-width: 60px;
}

.ios-header-center {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--clay-text);
}

.ios-back-btn,
.ios-settings-btn {
  background: none;
  border: none;
  color: var(--clay-sacred);
  font-size: 17px;
  font-weight: 400;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease;
}

.ios-back-btn:active,
.ios-settings-btn:active {
  opacity: 0.4;
}

.ios-back-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--clay-sacred);
}

/* ═══ RITUAL OVERLAY - iOS STYLE TIMER ═══ */
.ritual-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, 
    rgba(18, 18, 20, 0.98) 0%,
    rgba(28, 28, 30, 0.95) 50%,
    rgba(18, 18, 20, 0.98) 100%) !important;
  backdrop-filter: blur(40px) saturate(180%) !important;
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding-top: max(env(safe-area-inset-top, 44px), 44px);
  padding-bottom: max(env(safe-area-inset-bottom, 20px), 20px);
}

/* ═══ TIMER HEADER ═══ */
.ritual-header {
  padding: 20px 20px 12px;
  text-align: center;
  border-bottom: none !important;
}

.ritual-time-range {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.5) !important;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ritual-gurmukhi-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #D4943A !important;
  margin: 0 !important;
}

/* ═══ TIMER CONTENT - iOS Clock Style ═══ */
.ritual-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 32px;
}

/* ═══ CIRCULAR TIMER - Like iOS ═══ */
.ritual-timer-circle {
  position: relative;
  width: min(320px, 85vw);
  height: min(320px, 85vw);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ritual-timer-circle svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 20px rgba(212, 148, 58, 0.4));
}

.ritual-timer-circle .timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.ritual-timer-circle .timer-progress {
  fill: none;
  stroke: url(#timerGoldGradient);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.ritual-timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ritual-countdown {
  font-size: 72px !important;
  font-weight: 200 !important;
  color: #FFFFFF !important;
  line-height: 1 !important;
  letter-spacing: -2px !important;
  font-variant-numeric: tabular-nums !important;
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.2);
}

.ritual-countdown-label {
  font-size: 15px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.5) !important;
  letter-spacing: 0.5px;
}

/* ═══ PROGRESS DOTS - iOS Style ═══ */
.ritual-progress-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.ritual-progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.ritual-progress-dots .dot.active {
  background: #D4943A;
  box-shadow: 0 0 12px rgba(212, 148, 58, 0.6);
  transform: scale(1.2);
}

/* ═══ SACRED SYMBOL ═══ */
.ritual-symbol {
  text-align: center;
  margin: 20px 0;
}

.ritual-ik-onkar {
  font-size: 64px !important;
  color: #D4943A !important;
  filter: drop-shadow(0 4px 20px rgba(212, 148, 58, 0.4));
  animation: gentleGlow 3s ease-in-out infinite;
}

.ritual-vaheguru {
  font-family: 'Noto Sans Gurmukhi', serif;
  font-size: 28px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  margin-top: 12px;
  letter-spacing: 2px;
}

.ritual-hold-text {
  font-size: 14px !important;
  color: rgba(255, 255, 255, 0.4) !important;
  font-style: italic;
  margin-top: 8px;
}

@keyframes gentleGlow {
  0%, 100% {
    filter: drop-shadow(0 4px 20px rgba(212, 148, 58, 0.4));
  }
  50% {
    filter: drop-shadow(0 4px 30px rgba(212, 148, 58, 0.7));
  }
}

/* ═══ ACTION BUTTONS - iOS Style ═══ */
.ritual-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  padding: 0 20px;
}

.ritual-btn {
  width: 100%;
  padding: 16px 24px;
  border-radius: 16px;
  border: none;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ritual-btn-primary {
  background: linear-gradient(135deg, #34C759, #30B350);
  color: white;
  box-shadow: 0 6px 20px rgba(52, 199, 89, 0.3);
}

.ritual-btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(52, 199, 89, 0.4);
}

.ritual-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
}

.ritual-btn-secondary:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.15);
}

.ritual-btn-skip {
  background: transparent;
  color: var(--clay-sacred);
  border: 2px solid rgba(212, 148, 58, 0.3);
}

.ritual-btn-skip:active {
  transform: scale(0.97);
  background: rgba(212, 148, 58, 0.1);
}

/* ═══ COMPLETION POPUP - iOS Style ═══ */
.ritual-complete-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ritual-complete-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.ritual-complete-card {
  background: linear-gradient(145deg, rgba(28, 28, 30, 0.98), rgba(44, 44, 46, 0.95));
  border-radius: 32px;
  padding: 48px 32px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ritual-complete-overlay.visible .ritual-complete-card {
  transform: scale(1);
}

.ritual-complete-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #34C759, #30B350);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: 0 8px 24px rgba(52, 199, 89, 0.4);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

.ritual-complete-gurmukhi {
  font-family: 'Noto Sans Gurmukhi', serif;
  font-size: 24px;
  font-weight: 600;
  color: #D4943A;
  margin-bottom: 8px;
}

.ritual-complete-english {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
}

.ritual-complete-message {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 32px;
}

.ritual-complete-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
}

.ritual-complete-stat {
  text-align: center;
}

.ritual-complete-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #D4943A;
  display: block;
  margin-bottom: 4px;
}

.ritual-complete-stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ritual-complete-btn {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #D4943A, #C17F2E);
  color: white;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(212, 148, 58, 0.4);
  transition: all 0.2s ease;
}

.ritual-complete-btn:active {
  transform: scale(0.97);
}

/* ═══ LIGHT MODE ADJUSTMENTS ═══ */
[data-theme="light"] .ritual-overlay {
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.98) 0%,
    rgba(250, 248, 245, 0.95) 50%,
    rgba(255, 255, 255, 0.98) 100%) !important;
}

[data-theme="light"] .ritual-countdown,
[data-theme="light"] .ritual-vaheguru {
  color: #1C1C1E !important;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .ritual-countdown-label,
[data-theme="light"] .ritual-time-range,
[data-theme="light"] .ritual-hold-text {
  color: rgba(0, 0, 0, 0.5) !important;
}

[data-theme="light"] .ritual-btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .ritual-complete-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 247, 0.95));
}

[data-theme="light"] .ritual-complete-english {
  color: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .ritual-complete-message {
  color: rgba(0, 0, 0, 0.6);
}

/* ═══ FLOWER PETALS ANIMATION ═══ */
.ritual-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ritual-petal {
  position: absolute;
  font-size: 24px;
  animation: petalFall 4s ease-in-out forwards;
  opacity: 0;
}

@keyframes petalFall {
  0% {
    opacity: 0;
    transform: translateY(-100px) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(360deg);
  }
}
