/* ========================================
   RESET & VARIABLES
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-glow: #00f5ff;
  --secondary-glow: #8a2be2;
  --accent-glow: #ff6f61;
  --bg-deep: #030514;
  --bg-medium: #0f2027;
  --bg-light: #203a43;
  --text-primary: #ffffff;
  --text-secondary: #a0f0ff;
  --glass-bg: rgba(10, 20, 30, 0.65);
  --glass-border: rgba(0, 245, 255, 0.25);
  --card-bg: rgba(15, 25, 40, 0.7);
  --transition-smooth: all 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* ========================================
   GLOBAL STYLES
   ======================================== */
body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Canvas Layers */
canvas#stars,
canvas#nebula {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

canvas#stars {
  z-index: 0;
  background: radial-gradient(ellipse at 30% 40%, #1a2f3a, #0a1a25, #030a10);
}

canvas#nebula {
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: screen;
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.container {
  background: var(--glass-bg);
  padding: 45px;
  border-radius: 50px;
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.8),
    0 0 0 1px var(--glass-border) inset,
    0 0 50px rgba(0, 150, 255, 0.3);
  max-width: 1200px;
  width: 100%;
  backdrop-filter: blur(15px) saturate(200%);
  -webkit-backdrop-filter: blur(15px) saturate(200%);
  border: 1px solid var(--glass-border);
  position: relative;
  z-index: 10;
  overflow: hidden;
  animation: containerAppear 1s ease-out;
}

.container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, 
    rgba(0, 255, 255, 0.15) 0%, 
    rgba(138, 43, 226, 0.1) 30%, 
    transparent 70%);
  animation: rotateGlow 25s linear infinite;
  z-index: -1;
}

.container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--primary-glow), 
    var(--secondary-glow), 
    var(--primary-glow), 
    transparent);
  animation: scan 10s linear infinite;
  z-index: 2;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1 {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

.glitch-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 3.2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 8px;
  background: linear-gradient(135deg, 
    #fff, 
    var(--primary-glow), 
    var(--secondary-glow), 
    var(--primary-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: glitch 5s infinite;
  display: block;
  text-shadow: 
    0 0 30px rgba(0, 245, 255, 0.5),
    2px 2px 0 rgba(138, 43, 226, 0.3);
  position: relative;
}

.subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  letter-spacing: 4px;
  color: var(--text-secondary);
  text-transform: uppercase;
  opacity: 0.8;
  display: block;
  margin-top: 5px;
  animation: fadePulse 3s infinite;
}

/* ========================================
   INFO GRID
   ======================================== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 35px;
  position: relative;
  z-index: 5;
}

/* Card Styles */
.card {
  background: var(--card-bg);
  border-radius: 30px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 220, 255, 0.2) inset,
    0 0 30px rgba(0, 100, 255, 0.2);
  transition: var(--transition-smooth);
  border: 1px solid rgba(0, 245, 255, 0.15);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  animation: cardFloatIn 0.6s ease-out backwards;
}

/* Stagger animation for cards */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(9) { animation-delay: 0.9s; }
.card:nth-child(10) { animation-delay: 1s; }

/* Card Border Animation */
.card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    var(--primary-glow), 
    transparent 40%, 
    var(--secondary-glow) 60%, 
    transparent 80%, 
    var(--primary-glow));
  border-radius: 32px;
  z-index: -2;
  animation: borderRotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card:hover::before {
  opacity: 0.8;
}

.card::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--card-bg);
  border-radius: 28px;
  z-index: -1;
  backdrop-filter: blur(10px);
  transition: background 0.3s ease;
}

.card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 
    0 30px 60px rgba(0, 200, 255, 0.5),
    0 0 0 1px rgba(0, 245, 255, 0.6) inset,
    0 0 50px rgba(138, 43, 226, 0.4);
  border-color: rgba(0, 245, 255, 0.5);
}

.card:hover::after {
  background: rgba(20, 35, 55, 0.8);
}

/* Card Label */
.card .label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #a0f0ff, #c07bff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
  font-weight: 600;
  position: relative;
  z-index: 3;
}

/* Card Value */
.card .value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
  letter-spacing: 0.5px;
  line-height: 1.4;
  background: linear-gradient(135deg, #ffffff, #e0f0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gentlePulse 4s infinite ease-in-out;
  position: relative;
  z-index: 3;
}

/* Special Card (Moon Phase) */
.card.special .value {
  background: linear-gradient(135deg, 
    #ffd700, 
    #ffaa00, 
    #ff6f61, 
    #ff3b3b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.9rem;
  text-shadow: 0 0 30px rgba(255, 111, 97, 0.8);
  animation: intensePulse 2s infinite;
}

/* ========================================
   TIME MACHINE SECTION
   ======================================== */
.time-machine {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 60px;
  border: 1px solid rgba(0, 245, 255, 0.2);
  backdrop-filter: blur(10px);
}

.time-btn {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid var(--primary-glow);
  color: var(--text-primary);
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  padding: 15px 30px;
  border-radius: 40px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.time-btn:hover {
  background: var(--primary-glow);
  color: var(--bg-deep);
  box-shadow: 0 0 40px var(--primary-glow);
  transform: scale(1.05);
}

.date-picker {
  display: flex;
  gap: 15px;
  align-items: center;
}

#datePicker {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--secondary-glow);
  color: var(--text-primary);
  font-family: 'Orbitron', sans-serif;
  padding: 15px 20px;
  border-radius: 40px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

#datePicker:hover {
  border-color: var(--primary-glow);
  box-shadow: 0 0 25px rgba(138, 43, 226, 0.5);
}

#datePicker::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes containerAppear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

@keyframes glitch {
  0%, 100% { transform: skew(0deg, 0deg); opacity: 1; }
  95% { transform: skew(0deg, 0deg); opacity: 1; }
  96% { transform: skew(5deg, 2deg) scale(1.02); opacity: 0.9; }
  97% { transform: skew(-5deg, -2deg) scale(0.98); opacity: 0.9; }
  98% { transform: skew(3deg, 1deg) scale(1.01); opacity: 0.95; }
  99% { transform: skew(0deg, 0deg) scale(1); opacity: 1; }
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@keyframes borderRotate {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes gentlePulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 20px rgba(0, 245, 255, 0.5); }
  50% { opacity: 0.9; text-shadow: 0 0 40px rgba(0, 245, 255, 0.8); }
}

@keyframes intensePulse {
  0%, 100% { 
    text-shadow: 0 0 30px rgba(255, 111, 97, 0.8), 0 0 60px rgba(255, 111, 97, 0.4);
    transform: scale(1);
  }
  50% { 
    text-shadow: 0 0 60px rgba(255, 111, 97, 1), 0 0 90px rgba(255, 111, 97, 0.8);
    transform: scale(1.02);
  }
}

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

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyfloat shootingStar {
  0% {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-500px) translateY(500px);
    opacity: 0;
  }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1000px) {
  .container {
    padding: 35px;
  }
  
  .glitch-text {
    font-size: 2.5rem;
    letter-spacing: 6px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 25px;
    border-radius: 35px;
  }
  
  .glitch-text {
    font-size: 2rem;
    letter-spacing: 4px;
  }
  
  .subtitle {
    font-size: 0.85rem;
    letter-spacing: 3px;
  }
  
  .info-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
  }
  
  .card {
    padding: 22px 18px;
  }
  
  .card .value {
    font-size: 1.4rem;
  }
  
  .card.special .value {
    font-size: 1.6rem;
  }
  
  .time-machine {
    flex-direction: column;
    padding: 20px;
    border-radius: 40px;
  }
  
  .time-btn, #datePicker {
    width: 100%;
    text-align: center;
  }
  
  .date-picker {
    width: 100%;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 20px;
    border-radius: 25px;
  }
  
  .glitch-text {
    font-size: 1.5rem;
    letter-spacing: 3px;
  }
  
  .subtitle {
    font-size: 0.7rem;
    letter-spacing: 2px;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .card .label {
    font-size: 0.8rem;
    letter-spacing: 2px;
  }
  
  .card .value {
    font-size: 1.2rem;
  }
  
  .card.special .value {
    font-size: 1.4rem;
  }
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  border-radius: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.loading::before {
  content: '🔭';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  z-index: 101;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   ADDITIONAL STYLES FOR NEW FEATURES
   ======================================== */

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50px;
  padding: 10px 20px;
  margin-bottom: 25px;
  border: 1px solid rgba(0, 245, 255, 0.2);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  gap: 10px;
}

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

.status-item i {
  color: var(--primary-glow);
  font-size: 1rem;
}

/* Quick Stats */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  padding: 15px;
  border: 1px solid rgba(0, 245, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(5px);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-glow);
  box-shadow: 0 5px 20px rgba(0, 245, 255, 0.2);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #fff, var(--primary-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Moon Visualization */
.moon-visualization {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 30px;
  padding: 25px;
  margin: 25px 0;
  border: 1px solid rgba(0, 245, 255, 0.2);
  backdrop-filter: blur(10px);
}

.moon-visualization h3 {
  font-family: 'Orbitron', sans-serif;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.live-badge {
  background: linear-gradient(135deg, #ff3366, #ff0066);
  color: white;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.moon-container {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

#moonCanvas {
  background: radial-gradient(circle at 30% 30%, #1a2a3a, #0a1a2a);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.moon-details {
  flex: 1;
  min-width: 200px;
}

.moon-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.moon-detail-item span:first-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.moon-detail-item span:last-child {
  font-weight: 600;
  color: white;
}

/* Enhanced Time Machine */
.time-presets {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 15px;
}

.preset {
  padding: 10px 20px;
  font-size: 0.9rem;
}

.date-picker-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 15px;
}

.time-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

#timePicker {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--secondary-glow);
  color: var(--text-primary);
  font-family: 'Orbitron', sans-serif;
  padding: 12px 20px;
  border-radius: 40px;
  font-size: 1rem;
}

.timezone {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.location-override {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

#citySelect {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--primary-glow);
  color: var(--text-primary);
  font-family: 'Roboto', sans-serif;
  padding: 12px 25px;
  border-radius: 40px;
  min-width: 250px;
  cursor: pointer;
}

#citySelect option {
  background: var(--bg-deep);
  color: var(--text-primary);
}

/* Verification Panel */
.verification-panel {
  margin-top: 30px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0, 245, 255, 0.2);
}

.verification-header {
  padding: 15px 20px;
  background: rgba(0, 245, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.verification-header:hover {
  background: rgba(0, 245, 255, 0.15);
}

.verification-header i:first-child {
  color: var(--primary-glow);
}

.verification-header i:last-child {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.verification-header.active i:last-child {
  transform: rotate(180deg);
}

.verification-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  padding: 0 20px;
}

.verification-content.active {
  max-height: 500px;
  padding: 20px;
}

.verification-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.verification-item:last-child {
  border-bottom: none;
}

.verification-status {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verification-status.verified {
  background: rgba(0, 255, 0, 0.2);
  color: #00ff00;
}

.verification-status.warning {
  background: rgba(255, 255, 0, 0.2);
  color: #ffff00;
}

.verification-status.error {
  background: rgba(255, 0, 0, 0.2);
  color: #ff0000;
}

.verification-detail {
  flex: 1;
}

.verification-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.verification-value {
  font-weight: 600;
}

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

/* Responsive */
@media (max-width: 768px) {
  .status-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .moon-container {
    flex-direction: column;
  }
  
  .time-presets {
    flex-direction: column;
  }
  
  .preset {
    width: 100%;
  }
  
  .date-picker-container {
    flex-direction: column;
  }
  
  .time-picker {
    flex-direction: column;
  }
  
  #timePicker {
    width: 100%;
  }
  
  .location-override {
    flex-direction: column;
  }
  
  #citySelect {
    width: 100%;
  }
}