/* CSS Custom Properties for Theme Colors */
:root {
  --primary-color: #00ffff;
  --secondary-color: #ff00ff;
  --accent-color: #ffff00;
  --bg-dark: #0a0a0f;
  --bg-darker: #050508;
  --text-light: #ffffff;
  --text-dim: #aaaaaa;
  --glow-color: rgba(0, 255, 255, 0.8);
  --pulse-color: rgba(255, 0, 255, 0.6);
  --warning-color: #ff4444;
  --success-color: #00ff88;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Rajdhani', 'Arial', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  position: relative;
  min-height: 100vh;
}

/* Animated Star Field Background */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
}

.stars, .stars2, .stars3 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.stars {
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #eee, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: stars-move 20s linear infinite;
}

.stars2 {
  background-image: 
    radial-gradient(1px 1px at 40px 60px, #fff, transparent),
    radial-gradient(1px 1px at 120px 10px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 160px 70px, #eee, transparent);
  background-repeat: repeat;
  background-size: 300px 150px;
  animation: stars-move 25s linear infinite;
}

.stars3 {
  background-image: 
    radial-gradient(1px 1px at 80px 20px, rgba(0,255,255,0.8), transparent),
    radial-gradient(1px 1px at 180px 90px, rgba(255,0,255,0.6), transparent),
    radial-gradient(1px 1px at 50px 100px, rgba(255,255,0,0.4), transparent);
  background-repeat: repeat;
  background-size: 400px 200px;
  animation: stars-move 30s linear infinite;
}

@keyframes stars-move {
  from { transform: translateY(0); }
  to { transform: translateY(-200px); }
}

/* Nebula Background */
.nebula-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 0, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 0, 0.08) 0%, transparent 60%);
  z-index: -2;
  animation: nebula-shift 40s ease-in-out infinite;
}

@keyframes nebula-shift {
  0%, 100% { 
    background: 
      radial-gradient(ellipse at 20% 30%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 70%, rgba(255, 0, 255, 0.12) 0%, transparent 50%),
      radial-gradient(ellipse at 50% 50%, rgba(255, 255, 0, 0.08) 0%, transparent 60%);
  }
  50% { 
    background: 
      radial-gradient(ellipse at 60% 80%, rgba(0, 255, 255, 0.18) 0%, transparent 50%),
      radial-gradient(ellipse at 30% 20%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
      radial-gradient(ellipse at 70% 40%, rgba(255, 255, 0, 0.1) 0%, transparent 60%);
  }
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

/* Header and Title */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.title-main {
  font-family: 'Orbitron', monospace;
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px var(--glow-color);
  animation: title-pulse 3s ease-in-out infinite;
  letter-spacing: 0.1em;
}

.title-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.8;
}

@keyframes title-pulse {
  0%, 100% { 
    text-shadow: 0 0 30px var(--glow-color);
    transform: scale(1);
  }
  50% { 
    text-shadow: 0 0 50px var(--glow-color), 0 0 80px var(--pulse-color);
    transform: scale(1.02);
  }
}

/* Countdown Section */
.countdown-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-display {
  display: flex;
  align-items: center;
  gap: 2rem;
  z-index: 2;
  position: relative;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  background: rgba(10, 10, 15, 0.8);
  padding: 2rem 1.5rem;
  border-radius: 20px;
  border: 2px solid rgba(0, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 0 30px rgba(0, 255, 255, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  animation: unit-glow 2s ease-in-out infinite alternate;
}

@keyframes unit-glow {
  0% { 
    border-color: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2), inset 0 0 20px rgba(0, 0, 0, 0.5);
  }
  100% { 
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.5);
  }
}

.time-value {
  font-family: 'Orbitron', monospace;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: 0 0 20px var(--glow-color);
  min-width: 3ch;
  text-align: center;
  position: relative;
}

.time-value.flash {
  animation: value-flash 0.3s ease-out;
}

@keyframes value-flash {
  0% { color: var(--primary-color); }
  50% { color: var(--accent-color); text-shadow: 0 0 30px var(--accent-color); }
  100% { color: var(--primary-color); }
}

.time-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
}

.time-sublabel {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.time-separator {
  font-family: 'Orbitron', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-shadow: 0 0 15px var(--pulse-color);
  animation: separator-blink 1.5s ease-in-out infinite;
}

@keyframes separator-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* Progress Ring */
.progress-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.progress-ring-svg {
  transform: rotate(-90deg);
}

.progress-ring-circle-bg {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
}

.progress-ring-circle {
  fill: transparent;
  stroke: var(--primary-color);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1193;
  stroke-dashoffset: 1193;
  transition: stroke-dashoffset 0.5s ease-in-out;
  filter: drop-shadow(0 0 10px var(--glow-color));
  animation: ring-pulse 2s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { 
    stroke: var(--primary-color);
    filter: drop-shadow(0 0 10px var(--glow-color));
  }
  50% { 
    stroke: var(--secondary-color);
    filter: drop-shadow(0 0 20px var(--pulse-color));
  }
}

/* Controls Section */
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 600px;
}

.input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.input-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.datetime-input {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  padding: 1rem 1.5rem;
  background: rgba(10, 10, 15, 0.9);
  border: 2px solid rgba(0, 255, 255, 0.4);
  border-radius: 10px;
  color: var(--text-light);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  outline: none;
}

.datetime-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* Buttons */
.btn {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 1rem 2rem;
  border: 2px solid;
  border-radius: 10px;
  background: rgba(10, 10, 15, 0.8);
  color: var(--text-light);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

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

.btn-primary:hover {
  background: var(--primary-color);
  color: var(--bg-dark);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  border-color: var(--text-dim);
  color: var(--text-dim);
}

.btn-secondary:hover {
  border-color: var(--text-light);
  color: var(--text-light);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-preset {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

.btn-preset:hover {
  background: var(--secondary-color);
  color: var(--bg-dark);
  box-shadow: 0 0 25px rgba(255, 0, 255, 0.4);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.control-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Event Message */
.event-message {
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-dim);
  padding: 1.5rem;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  max-width: 500px;
  margin: 0 auto;
}

.event-message.active {
  color: var(--primary-color);
  border-color: var(--primary-color);
  animation: message-glow 2s ease-in-out infinite;
}

@keyframes message-glow {
  0%, 100% { 
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
  }
  50% { 
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
  }
}

/* Completion Alert */
.completion-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  border: 3px solid var(--success-color);
  box-shadow: 0 0 50px rgba(0, 255, 136, 0.5);
  animation: alert-appear 0.5s ease-out;
}

@keyframes alert-appear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.alert-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.alert-icon {
  font-size: 4rem;
  animation: icon-bounce 1s ease-in-out infinite;
}

@keyframes icon-bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.alert-text {
  font-family: 'Orbitron', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--success-color);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
}

.alert-close {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
  padding: 1rem 2rem;
  background: var(--success-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.alert-close:hover {
  background: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Particles Effect */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--glow-color);
  animation: particle-float 6s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 1.5rem;
    gap: 2rem;
  }
  
  .countdown-display {
    gap: 1rem;
  }
  
  .progress-ring-svg {
    width: 350px;
    height: 350px;
  }
  
  .progress-ring-circle,
  .progress-ring-circle-bg {
    r: 165;
  }
}

@media (max-width: 768px) {
  .title-main {
    font-size: 2.5rem;
  }
  
  .countdown-display {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }
  
  .time-unit {
    padding: 1.5rem 1rem;
    min-width: 120px;
  }
  
  .time-value {
    font-size: 2.5rem;
  }
  
  .progress-ring-svg {
    width: 280px;
    height: 280px;
  }
  
  .progress-ring-circle,
  .progress-ring-circle-bg {
    r: 130;
  }
  
  .preset-buttons {
    gap: 0.5rem;
  }
  
  .btn-preset {
    font-size: 0.9rem;
    padding: 0.7rem 1.2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }
  
  .title-main {
    font-size: 2rem;
  }
  
  .time-unit {
    padding: 1rem 0.8rem;
    min-width: 100px;
  }
  
  .time-value {
    font-size: 2rem;
  }
  
  .time-label {
    font-size: 1.1rem;
  }
  
  .progress-ring {
    display: none;
  }
  
  .datetime-input {
    width: 100%;
    font-size: 1rem;
  }
  
  .control-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #ffffff;
    --secondary-color: #ffffff;
    --text-dim: #cccccc;
  }
  
  .nebula-bg {
    display: none;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .stars, .stars2, .stars3 {
    animation: none;
  }
  
  .nebula-bg {
    animation: none;
  }
}