/* ==========================================================================
   CounterNaamJapa.com — Japa & Mala Counter Component Styles
   Circular Ring, 108 Beads, Large Tap Action, Timer & Devotional Stats
   ========================================================================== */

/* Hero Counter Section */
.counter-hero-section {
  padding: 24px 0 36px;
  background: radial-gradient(circle at 50% 20%, rgba(249, 123, 20, 0.05) 0%, transparent 70%);
}

.counter-intro-header {
  text-align: center;
  max-width: 740px;
  margin: 0 auto 20px;
}

.counter-hero-title {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.18;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.counter-hero-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.12rem);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 auto;
}

/* Main Spiritual Counter Card */
.counter-card {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  max-width: 660px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

@media (max-width: 480px) {
  .counter-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
}

/* Subtle Devotional Card Border Accent */
.counter-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F97B14, #FFA352, #D49A32, #F97B14);
}

/* Mantra Selector Toolbar */
.mantra-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.mantra-select-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mantra-select {
  flex: 1;
  padding: 11px 16px;
  font-size: 1.05rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-main);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2382786D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.mantra-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.custom-mantra-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.custom-mantra-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-tint);
}

/* Custom Mantra Input Drawer */
.custom-mantra-drawer {
  display: none;
  background: var(--bg-accent-subtle);
  border: 1px dashed var(--primary-light);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 4px;
}

.custom-mantra-drawer.open {
  display: block;
}

.custom-mantra-input-group {
  display: flex;
  gap: 8px;
}

.custom-mantra-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 0.95rem;
}

.save-mantra-btn {
  padding: 10px 18px;
  background: var(--primary);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background var(--transition-fast);
}

.save-mantra-btn:hover {
  background: var(--primary-hover);
}

/* Active Mantra Display Pill */
.active-mantra-banner {
  text-align: center;
  padding: 8px 14px;
  background: var(--bg-accent-subtle);
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.active-mantra-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}

[data-theme="dark"] .active-mantra-text {
  color: var(--primary-light);
}

/* Statistics Grid Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

@media (min-width: 540px) {
  .stats-strip {
    grid-template-columns: repeat(6, 1fr);
  }
}

.stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  transition: transform var(--transition-fast);
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-box.highlight {
  background: var(--primary-tint);
  border-color: rgba(249, 123, 20, 0.3);
}

.stat-box.highlight .stat-value {
  color: var(--primary);
}

/* Central Circular Counter Display */
.central-counter-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 12px 0 20px;
}

.progress-ring-container {
  position: relative;
  width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 380px) {
  .progress-ring-container {
    width: 210px;
    height: 210px;
  }
}

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

.progress-ring-track {
  stroke: var(--border-light);
  stroke-width: 10;
  fill: transparent;
}

.progress-ring-fill {
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  fill: transparent;
  stroke-dasharray: 691.15;
  stroke-dashoffset: 691.15;
  transition: stroke-dashoffset 0.25s ease-out;
}

.counter-center-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.count-number {
  font-size: clamp(3rem, 7vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -0.03em;
  transition: transform 0.1s ease-out;
}

.count-denominator {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.mala-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  color: var(--primary);
  margin-top: 6px;
}

/* 108 Bead Ring Visualization (Toggleable) */
.beads-visualization-wrapper {
  margin: 10px auto 20px;
  width: 100%;
  max-width: 380px;
  display: none; /* revealed when bead view enabled */
}

.beads-visualization-wrapper.visible {
  display: block;
}

.beads-ring-svg {
  width: 100%;
  height: auto;
  max-height: 280px;
}

.bead-dot {
  fill: var(--border-light);
  transition: fill 0.15s ease, r 0.15s ease;
}

.bead-dot.active {
  fill: var(--primary);
  r: 4;
}

.bead-dot.completed {
  fill: var(--gold);
}

.bead-dot.meru {
  fill: #E53935;
  r: 5.5;
}

/* Mala Completion Celebration Banner */
.mala-complete-banner {
  display: none;
  text-align: center;
  padding: 12px 18px;
  background: linear-gradient(135deg, #1E8E3E, #2E7D32);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 4px 14px rgba(30, 142, 62, 0.25);
}

.mala-complete-banner.show {
  display: block;
}

.mala-complete-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.mala-complete-desc {
  font-size: 0.86rem;
  opacity: 0.95;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Giant Devotional Tap Button */
.tap-button-container {
  margin-bottom: 20px;
}

.main-tap-button {
  width: 100%;
  min-height: 84px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #F97B14 0%, #FF9640 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  font-size: clamp(1.28rem, 3.2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-tap);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}

.main-tap-button:hover {
  filter: brightness(1.04);
}

.main-tap-button:active, .main-tap-button.tapped {
  transform: scale(0.972);
  box-shadow: 0 3px 12px rgba(249, 123, 20, 0.3);
}

.tap-icon-namaste {
  font-size: 1.6em;
  line-height: 1;
  display: inline-block;
  animation: subtleFloat 3s ease-in-out infinite alternate;
}

@keyframes subtleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-2px); }
}

.tap-hint-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Secondary Action Bar (Undo, Reset, Sound, Vibrate) */
.counter-actions-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.action-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.action-btn:hover {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary);
}

.action-btn.active {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary);
}

/* Daily Target Goal Box */
.daily-goal-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.goal-title {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.goal-numbers {
  font-weight: 600;
  color: var(--text-secondary);
}

.goal-progress-bar-bg {
  width: 100%;
  height: 9px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.goal-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #F97B14, #D49A32);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.goal-target-presets {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.preset-chip {
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
}

.preset-chip:hover, .preset-chip.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* Integrated Meditation & Session Timer */
.timer-component-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.timer-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-clock-display {
  font-family: monospace;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.05em;
  text-align: center;
  margin: 6px 0 12px;
}

[data-theme="dark"] .timer-clock-display {
  color: var(--primary-light);
}

.timer-controls-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.timer-control-btn {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.timer-control-btn.primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.timer-control-btn.primary:hover {
  background: var(--primary-hover);
}

.quick-timer-chips {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-timer-chip {
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.quick-timer-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Save & Safety Status Badge */
.device-save-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.save-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-weight: 600;
}

.save-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-bg);
}

.share-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.share-btn-inline:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* Modals (Reset Confirmation & Detailed Statistics) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.modal-body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.modal-btn.danger {
  background: #E53935;
  color: #FFFFFF;
  border-color: #E53935;
}

.modal-btn.danger:hover {
  background: #C62828;
}

/* Statistics Table Grid inside modal */
.stats-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-detail-card {
  background: var(--bg-subtle);
  padding: 12px;
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-detail-card .num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-detail-card .lbl {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}
