:root {
  --bg-gradient: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --accent: #00d2ff;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.8s ease-out;
}

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

/* Header */
.header-card h1 { font-size: 1.4rem; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.header-card p { font-size: 2.8rem; font-weight: 300; letter-spacing: -1px; text-align: center; }

/* Binary Clock */
.binary-clock { display: flex; justify-content: center; gap: 6px; padding: 24px 16px; }
.bin-group { display: flex; gap: 8px; align-items: center; }
.bin-col { display: flex; flex-direction: column-reverse; gap: 5px; align-items: center; }
.bin-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.1); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.bin-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(0,210,255,0.3); transform: scale(1.15); }

/* Weather */
.weather-section h2 { font-size: 1.2rem; margin-bottom: 14px; border-bottom: 1px solid var(--glass-border); padding-bottom: 8px; }
#current-weather { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; font-size: 1rem; }
.temp-big { font-size: 3.2rem; font-weight: 700; line-height: 1; }
.weather-icon { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.weather-details { display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); font-size: 0.9rem; }

.forecast-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 12px; }
.day-card { text-align: center; padding: 10px 4px; background: rgba(255,255,255,0.06); border-radius: 16px; font-size: 0.8rem; transition: transform 0.2s; }
.day-card:hover { transform: translateY(-2px); background: rgba(255,255,255,0.1); }
.day-name { margin-bottom: 6px; color: var(--text-secondary); font-weight: 500; }
.day-icon { font-size: 1.4rem; margin: 4px 0; }
.day-temp { font-weight: 600; }

/* Footer */
.footer-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; }
#location-text { color: var(--text-secondary); font-size: 0.85rem; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#refresh-btn { background: var(--accent); border: none; color: #0a192f; padding: 12px 18px; border-radius: 14px; font-weight: 600; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s; min-width: 48px; min-height: 48px; }
#refresh-btn:active { transform: scale(0.95); }

/* Loading & Error States */
.loading-state { text-align: center; padding: 30px 10px; color: var(--text-secondary); font-size: 0.9rem; }
.error-msg { color: #ff6b6b; font-size: 0.85rem; margin-top: 4px; }

/* Mobile adjustments */
@media (max-width: 340px) {
  .binary-clock { gap: 3px; padding: 16px 8px; }
  .bin-dot { width: 8px; height: 8px; }
  .forecast-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .day-card { font-size: 0.7rem; padding: 8px 2px; }
}
