/* =============================================
   STOP MET ROKEN APP – STYLES
   ============================================= */

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: #1a1a3e;
  --bg-card-hover: #222255;
  --accent: #6c63ff;
  --accent-light: #8b83ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --green: #00d4aa;
  --green-glow: rgba(0, 212, 170, 0.3);
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.2);
  --text-primary: #ffffff;
  --text-secondary: #a0a0cc;
  --text-muted: #6666aa;
  --danger: #ff4757;
  --success: #2ed573;
  --border: rgba(108, 99, 255, 0.15);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

/* =============================================
   PARTICLES BACKGROUND
   ============================================= */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0.15;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}

/* =============================================
   APP CONTAINER
   ============================================= */
.app {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* =============================================
   HEADER
   ============================================= */
.hero-section {
  text-align: center;
  padding: 20px 0 0;
}

.hero-image-container {
  position: relative;
  display: inline-block;
}

.hero-image {
  width: 220px;
  height: 220px;
  object-fit: contain;
  border-radius: 24px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 30px rgba(108, 99, 255, 0.3));
  animation: heroFloat 4s ease-in-out infinite;
}

@keyframes heroFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.hero-price-tag {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

/* =============================================
   CONTROLS
   ============================================= */
.controls-section {
  margin: 24px 0;
}

.controls-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

.controls-text {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.controls-running {
  text-align: center;
}

.btn {
  border: none;
  padding: 16px 36px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-block;
}

.btn-start {
  background: linear-gradient(135deg, var(--green), #00ff88);
  color: #0a0a1a;
  font-size: 1.15rem;
  padding: 18px 44px;
  box-shadow: 0 8px 32px var(--green-glow);
  animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
  0%,
  100% {
    box-shadow: 0 8px 32px var(--green-glow);
  }
  50% {
    box-shadow: 0 8px 48px rgba(0, 212, 170, 0.5);
  }
}

.btn-start:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 212, 170, 0.5);
}

.btn-reset {
  background: linear-gradient(
    135deg,
    rgba(255, 71, 87, 0.15),
    rgba(255, 71, 87, 0.05)
  );
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.3);
  font-size: 0.85rem;
  padding: 12px 24px;
}

.btn-reset:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 71, 87, 0.25),
    rgba(255, 71, 87, 0.1)
  );
  transform: translateY(-2px);
}

/* =============================================
   RESET POPUP
   ============================================= */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay.hidden {
  display: none !important;
}

.reset-popup {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  transform: translate(0, 0) scale(0);
  animation: resetPopIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  box-shadow: 0 0 80px rgba(255, 71, 87, 0.3);
}

@keyframes resetPopIn {
  to {
    transform: translate(0, 0) scale(1);
  }
}

.reset-emoji {
  font-size: 4rem;
  margin-bottom: 12px;
}

.reset-title {
  font-size: 1.5rem;
  color: var(--danger);
  margin-bottom: 12px;
}

.reset-text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.reset-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-cancel {
  background: linear-gradient(135deg, var(--green), #00ff88);
  color: #0a0a1a;
  font-size: 1rem;
  padding: 14px 28px;
}

.btn-cancel:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--green-glow);
}

.btn-confirm {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  padding: 10px 20px;
}

.btn-confirm:hover {
  background: rgba(255, 71, 87, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.header {
  text-align: center;
  padding: 40px 0 20px;
}

.logo {
  font-size: 64px;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* =============================================
   TIMER SECTION
   ============================================= */
.timer-section {
  margin: 24px 0;
}

.timer-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.timer-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--green), var(--gold));
}

.timer-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.timer-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.time-value {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.time-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 6px;
  font-weight: 600;
}

.time-separator {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* =============================================
   SAVINGS SECTION
   ============================================= */
.savings-section {
  margin: 24px 0;
}

.savings-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

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

.savings-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.savings-amount {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-container {
  margin-bottom: 20px;
}

.progress-bar {
  height: 28px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green), #00ff88);
  border-radius: 14px;
  width: 0%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-glow {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: 0%;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--accent-glow), var(--green-glow));
  filter: blur(8px);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.goal-label {
  color: var(--gold);
  font-weight: 600;
}

.savings-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.detail-icon {
  font-size: 1.1rem;
}

/* =============================================
   STATS GRID
   ============================================= */
.stats-section {
  margin: 24px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: rgba(108, 99, 255, 0.3);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* =============================================
   HEALTH TIMELINE
   ============================================= */
.health-section {
  margin: 32px 0;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.health-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.health-item.achieved {
  border-color: rgba(0, 212, 170, 0.3);
}

.health-item.achieved::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--green);
}

.health-item.upcoming {
  opacity: 0.5;
}

.health-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.health-check.done {
  background: rgba(0, 212, 170, 0.15);
  color: var(--green);
}

.health-check.pending {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.health-info {
  flex: 1;
}

.health-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.health-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.health-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

/* =============================================
   MOTIVATION
   ============================================= */
.motivation-section {
  margin: 32px 0;
}

.motivation-card {
  background: linear-gradient(
    145deg,
    rgba(108, 99, 255, 0.1),
    rgba(0, 212, 170, 0.05)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

.quote-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.quote-text {
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-style: italic;
}

.new-quote-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.new-quote-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.new-quote-btn:active {
  transform: translateY(0);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  text-align: center;
  padding: 32px 0 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* =============================================
   CELEBRATION ANIMATION
   ============================================= */
.confetti {
  position: fixed;
  top: -10px;
  z-index: 100;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* =============================================
   MILESTONE BADGE
   ============================================= */
.milestone-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}

.milestone-popup-inner {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  transform: scale(0);
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  box-shadow: 0 0 60px var(--gold-glow);
}

@keyframes popIn {
  to {
    transform: scale(1);
  }
}

.milestone-popup .emoji,
.milestone-popup-inner .emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

.milestone-popup h3,
.milestone-popup-inner h3 {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.milestone-popup p,
.milestone-popup-inner p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 480px) {
  .time-value {
    font-size: 2.5rem;
  }
  .time-block {
    min-width: 60px;
  }
  .time-separator {
    font-size: 1.8rem;
  }
  .savings-amount {
    font-size: 1.5rem;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-value {
    font-size: 1.3rem;
  }
  .header h1 {
    font-size: 1.7rem;
  }
}
