/* ========================================
   CHROMATIC CLOCK - Premium CSS
   ======================================== */

/* Theme Variables */
:root {
  --accent-1: #a78bfa;
  --accent-2: #60a5fa;
  --accent-3: #f472b6;
  --bg-1: #0d0015;
  --bg-2: #060018;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-primary: #f0e9ff;
  --text-secondary: rgba(240, 233, 255, 0.55);
  --glow-color: rgba(167, 139, 250, 0.4);
}

[data-theme="ocean"] {
  --accent-1: #22d3ee;
  --accent-2: #34d399;
  --accent-3: #60a5fa;
  --bg-1: #00121e;
  --bg-2: #000e18;
  --glow-color: rgba(34, 211, 238, 0.4);
  --text-primary: #e0f8ff;
}

[data-theme="sunset"] {
  --accent-1: #fb923c;
  --accent-2: #f43f5e;
  --accent-3: #fbbf24;
  --bg-1: #1a0505;
  --bg-2: #120303;
  --glow-color: rgba(251, 146, 60, 0.4);
  --text-primary: #fff1ec;
}

[data-theme="aurora"] {
  --accent-1: #4ade80;
  --accent-2: #818cf8;
  --accent-3: #a78bfa;
  --bg-1: #030c12;
  --bg-2: #020a0f;
  --glow-color: rgba(74, 222, 128, 0.4);
  --text-primary: #edfff4;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-1);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.6s ease, color 0.3s ease;
}

/* ========================================
   Animated Background Orbs
   ======================================== */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: orbFloat 15s ease-in-out infinite;
}

.orb-1 {
  width: 500px; height: 500px;
  background: var(--accent-1);
  top: -150px; left: -100px;
  animation-delay: 0s;
  animation-duration: 18s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: var(--accent-2);
  bottom: -150px; right: -100px;
  animation-delay: -5s;
  animation-duration: 22s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: var(--accent-3);
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
  animation-duration: 14s;
  opacity: 0.2;
}
.orb-4 {
  width: 250px; height: 250px;
  background: var(--accent-1);
  top: 60%; right: 10%;
  animation-delay: -7s;
  animation-duration: 20s;
  opacity: 0.15;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.02); }
}

/* Particle canvas */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
}

/* ========================================
   App Container
   ======================================== */
.app-container {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ========================================
   Glass Card
   ======================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  transition: border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

/* ========================================
   Header
   ======================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px var(--glow-color));
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 10px var(--glow-color)); }
  50% { filter: drop-shadow(0 0 20px var(--glow-color)); }
}

.logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-switcher {
  display: flex;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 5px 10px;
}

.theme-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
  opacity: 0.5;
  line-height: 1;
}

.theme-btn:hover,
.theme-btn.active {
  opacity: 1;
  transform: scale(1.25);
  background: rgba(255,255,255,0.12);
}

/* ========================================
   Analog Clock
   ======================================== */
.analog-section {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.analog-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glow-ring {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-1));
  opacity: 0.25;
  filter: blur(18px);
  animation: rotateSlow 8s linear infinite;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.analog-clock {
  width: 260px;
  height: 260px;
  filter: drop-shadow(0 0 30px var(--glow-color));
  transition: filter 0.6s ease;
}

/* ========================================
   Digital Clock
   ======================================== */
.digital-section {
  padding: 0;
}

.digital-card {
  padding: 28px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.digital-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-1), var(--accent-2), transparent);
  opacity: 0.6;
}

.digital-time-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.time-display {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(42px, 12vw, 72px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

.time-hours {
  background: linear-gradient(180deg, var(--text-primary), rgba(255,255,255,0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 20px var(--glow-color));
}

.time-minutes {
  background: linear-gradient(180deg, var(--accent-1), rgba(167,139,250,0.5));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px var(--glow-color));
}

.time-seconds {
  font-size: 0.5em;
  vertical-align: middle;
  background: linear-gradient(180deg, var(--accent-2), rgba(96,165,250,0.5));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 15px var(--glow-color));
  animation: secondsPulse 1s ease-in-out infinite;
}

@keyframes secondsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.time-colon {
  color: var(--text-secondary);
  font-size: 0.8em;
  animation: colonBlink 1s step-end infinite;
  padding: 0 4px;
  font-family: 'Orbitron', sans-serif;
}

@keyframes colonBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.ampm-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border: 1px solid var(--glass-border);
  padding: 4px 8px;
  border-radius: 6px;
  align-self: flex-start;
  margin-top: 8px;
}

.time-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 16px 0;
}

.date-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.date-day {
  font-weight: 600;
  color: var(--text-primary);
}

.date-dot {
  color: var(--accent-1);
}

/* ========================================
   Info Cards
   ======================================== */
.info-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.info-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.info-icon {
  font-size: 22px;
  line-height: 1;
  animation: iconFloat 3s ease-in-out infinite;
}

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

.info-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ========================================
   Progress Section
   ======================================== */
.progress-section {}

.progress-card {
  padding: 20px 24px;
}

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

.progress-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-pct {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-1);
}

.progress-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.progress-bar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--glow-color);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 20px;
  background: white;
  opacity: 0.4;
  filter: blur(4px);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 480px) {
  .info-section {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .info-card {
    padding: 12px 8px;
  }

  .info-value {
    font-size: 11px;
  }

  .digital-card {
    padding: 20px 16px;
  }

  .analog-wrapper {
    width: 220px;
    height: 220px;
  }

  .analog-clock {
    width: 220px;
    height: 220px;
  }
}

/* ========================================
   Transition animations
   ======================================== */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

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

.app-container > * {
  animation: fadeIn 0.6s ease forwards;
}
.app-container > *:nth-child(1) { animation-delay: 0s; }
.app-container > *:nth-child(2) { animation-delay: 0.1s; }
.app-container > *:nth-child(3) { animation-delay: 0.2s; }
.app-container > *:nth-child(4) { animation-delay: 0.3s; }
.app-container > *:nth-child(5) { animation-delay: 0.4s; }
