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

:root {
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --accent: #7dd3fc;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29, #1a1a3e, #24243e);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Background orbs */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: #6366f1;
  top: -50px;
  left: -80px;
}

.orb-2 {
  width: 250px;
  height: 250px;
  background: #ec4899;
  bottom: 10%;
  right: -60px;
  animation-delay: -7s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: #06b6d4;
  top: 50%;
  left: 30%;
  animation-delay: -14s;
}

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

/* Container */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.glass-card:active {
  transform: scale(0.98);
}

/* Clock Card */
.clock-card {
  text-align: center;
  padding: 36px 24px;
}

.date-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: fadeInDown 0.6s ease;
}

.time-display {
  font-size: 3.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.6s ease;
}

/* Binary Section */
.binary-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.binary-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.binary-grid {
  display: flex;
  gap: 4px;
}

.binary-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.binary-bit {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.binary-bit.active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(125, 211, 252, 0.3);
  transform: scale(1.1);
}

.binary-sep {
  width: 4px;
  height: 10px;
  background: transparent;
}

/* Weather Card */
.weather-card {
  padding: 24px 20px;
}

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

.location-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.refresh-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

/* Today Weather */
.today-weather {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 20px;
}

.today-weather .loading-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.weather-icon {
  font-size: 3rem;
  line-height: 1;
}

.weather-info {
  flex: 1;
}

.temp-big {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}

.temp-unit {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.weather-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.weather-extra {
  text-align: right;
}

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

/* Forecast Scroll */
.forecast-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.forecast-scroll::-webkit-scrollbar {
  height: 4px;
}

.forecast-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.forecast-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.forecast-day {
  min-width: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  scroll-snap-align: start;
  transition: transform 0.2s ease;
}

.forecast-day:active {
  transform: scale(0.95);
}

.forecast-day .day-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.forecast-day .forecast-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.forecast-day .forecast-temp {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive */
@media (min-width: 480px) {
  .time-display {
    font-size: 4rem;
  }
  .container {
    padding: 32px 24px;
  }
}
