:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.5);
  --bg-dark: #0f172a;
  --card-bg: rgba(15, 23, 42, 0.72);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-blur: 14px;

  --accent-color: var(--primary);
  --accent-glow: var(--primary-glow);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  min-height: 100dvh;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text-main);
  background: var(--bg-dark);
}

.bg-layer {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 1s ease;
  transform: scale(1.02);
}

#bg-active {
  opacity: 1;
  z-index: 1;
}

#bg-next {
  opacity: 0;
  z-index: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(15, 23, 42, 0.25),
      rgba(15, 23, 42, 0.75));
  z-index: 2;
}

.app-container {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.main-card {
  width: 100%;
  max-width: 580px;
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 35px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.5),
    0 0 30px var(--accent-glow);
}

.header {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 8px;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 25px;
}

.time-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 18px;
}

.flag-icon {
  width: 30px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

.time-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.time-value {
  font-size: 24px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 25px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.ss-main {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 14px !important;
  min-height: 48px !important;
  color: white !important;
}

.ss-content {
  background: #111827 !important;
  border-radius: 14px !important;
}

.ss-option {
  color: white !important;
  padding: 12px !important;
  white-space: normal !important;
}

.ss-option:hover {
  background: var(--accent-color) !important;
}

.ss-search input {
  background: #1f2937 !important;
  color: white !important;
  border: none !important;
}

.slider-section {
  margin-top: 20px;
}

.slider-info {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
}

input[type=range] {
  width: 100%;
  margin-top: 20px;
}

.status-badge {
  margin-top: 25px;
  text-align: center;
  padding: 12px;
  border-radius: 20px;
  font-weight: 600;
}

.status-good {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.status-neutral {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.status-bad {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.loader-overlay {
  position: fixed;
  inset: 0;
  background: #0f172a;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media(max-width:768px) {
  .time-grid {
    grid-template-columns: 1fr;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .main-card {
    max-width: 95%;
    padding: 25px;
  }

  h1 {
    font-size: 2rem;
  }
}