/* =========================================================
   ICT ROOM EXHIBIT — MODERN CLOCK WITH WEATHER
   Design: Glassmorphism + Aurora + Orbitron digital font
   ========================================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark:        #050a18;
  --glass-bg:       rgba(255, 255, 255, 0.05);
  --glass-border:   rgba(255, 255, 255, 0.12);
  --glass-shadow:   0 8px 32px rgba(0, 0, 0, 0.4);
  --accent-cyan:    #00e5ff;
  --accent-violet:  #a855f7;
  --accent-teal:    #14b8a6;
  --accent-gold:    #fbbf24;
  --text-primary:   #f0f6ff;
  --text-muted:     rgba(200, 220, 255, 0.55);
  --glow-cyan:      0 0 30px rgba(0, 229, 255, 0.35);
  --glow-violet:    0 0 40px rgba(168, 85, 247, 0.4);
  --radius-lg:      24px;
  --radius-md:      16px;
  --radius-sm:      10px;
  --transition:     cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  user-select: none;
}

/* --- Particle Canvas (background) --- */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* --- Aurora Glow Layers --- */
.aurora {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  z-index: 0;
  animation: auroraFloat 18s ease-in-out infinite alternate;
}
.aurora-1 {
  width: 60vw; height: 50vh;
  background: radial-gradient(ellipse, #7c3aed, transparent 70%);
  top: -10vh; left: -10vw;
  animation-delay: 0s;
}
.aurora-2 {
  width: 50vw; height: 45vh;
  background: radial-gradient(ellipse, #0891b2, transparent 70%);
  bottom: -5vh; right: -5vw;
  animation-delay: -7s;
}
.aurora-3 {
  width: 40vw; height: 35vh;
  background: radial-gradient(ellipse, #059669, transparent 70%);
  top: 40vh; left: 35vw;
  animation-delay: -13s;
}
@keyframes auroraFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3vw, -3vh) scale(1.08); }
  100% { transform: translate(-2vw, 4vh) scale(0.95); }
}

/* --- Glass Utility --- */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: var(--glass-shadow);
}
.glass-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* --- Main Layout --- */
.main-container {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "topbar"
    "center"
    "weather"
    "status";
  gap: 0;
  padding: 20px 30px 14px;
  align-items: center;
}

/* =========================================================
   TOP BAR
   ========================================================= */
.top-bar {
  grid-area: topbar;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  gap: 12px;
}

/* Sun info (center of top bar) */
.top-center-block {
  flex: 1;
  display: flex;
  justify-content: center;
}

.sun-info {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,200,50,0.07);
  border: 1px solid rgba(255,200,50,0.15);
  border-radius: 30px;
  padding: 6px 18px;
}

.sun-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(0.7rem, 1.1vw, 0.85rem);
}

.sun-label {
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.sun-item span:last-child {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.65rem, 1vw, 0.8rem);
  color: #fbbf24;
  font-weight: 700;
}

.sun-divider {
  color: rgba(255,255,255,0.15);
  font-size: 1rem;
}

.date-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-name {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.full-date {
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.location-block {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(0.8rem, 1.3vw, 1rem);
  color: var(--text-muted);
}

.icon-pin {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* =========================================================
   CENTER — Analog + Digital Clock
   ========================================================= */
.center-block {
  grid-area: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 5vw, 80px);
  padding: 10px 0;
}

/* --- Analog Clock --- */
.analog-wrapper {
  position: relative;
  flex-shrink: 0;
}

.clock-glow-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(0, 229, 255, 0.4),
    rgba(168, 85, 247, 0.4),
    rgba(20, 184, 166, 0.4),
    rgba(0, 229, 255, 0.4)
  );
  filter: blur(18px);
  z-index: -1;
  animation: ringRotate 8s linear infinite;
}
@keyframes ringRotate {
  to { transform: rotate(360deg); }
}

.analog-clock {
  position: relative;
  width: clamp(200px, 25vw, 320px);
  height: clamp(200px, 25vw, 320px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.07), transparent 60%),
    rgba(5, 15, 35, 0.85);
  border: 2px solid var(--glass-border);
  box-shadow:
    0 0 0 6px rgba(0, 229, 255, 0.06),
    0 0 60px rgba(0, 229, 255, 0.15),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

/* Tick marks (injected via JS) */
.tick {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0 0;
  width: 2px;
  background: rgba(200, 220, 255, 0.2);
  border-radius: 1px;
}
.tick.major {
  width: 3px;
  background: rgba(0, 229, 255, 0.7);
  box-shadow: 0 0 6px rgba(0,229,255,0.5);
}

/* Hour numbers (injected via JS) */
.hour-num {
  position: absolute;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.55rem, 1.1vw, 0.85rem);
  font-weight: 700;
  color: rgba(200, 220, 255, 0.75);
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0,229,255,0.3);
}

.clock-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 4px;
}

.hour-hand {
  width: 5px;
  height: 27%;
  margin-left: -2.5px;
  background: linear-gradient(to top, var(--accent-cyan), rgba(0,229,255,0.4));
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  border-radius: 4px 4px 0 0;
}
.minute-hand {
  width: 3px;
  height: 37%;
  margin-left: -1.5px;
  background: linear-gradient(to top, var(--accent-violet), rgba(168,85,247,0.3));
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
  border-radius: 3px 3px 0 0;
}
.second-hand {
  width: 2px;
  height: 41%;
  margin-left: -1px;
  background: linear-gradient(to top, var(--accent-gold), rgba(251,191,36,0.3));
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
  border-radius: 2px 2px 0 0;
  transition: transform 0.05s linear;
}

/* Tail for second hand */
.second-hand::after {
  content: '';
  position: absolute;
  bottom: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 15%;
  background: var(--accent-gold);
  border-radius: 2px;
}

.center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan), 0 0 6px white;
  z-index: 10;
}

/* --- Digital Block --- */
.digital-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* --- Refresh Row --- */
.refresh-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 10px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 30px;
  color: var(--accent-cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s, transform 0.15s;
}
.refresh-btn:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.18);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
  transform: scale(1.04);
}
.refresh-btn:active:not(:disabled) { transform: scale(0.97); }
.refresh-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.refresh-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

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

.api-badge {
  font-size: 0.62rem;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  white-space: nowrap;
}
.api-badge.api-primary  { border-color: rgba(0,229,255,0.3); color: var(--accent-cyan); }
.api-badge.api-fallback { border-color: rgba(168,85,247,0.3); color: var(--accent-violet); }
.api-badge.api-error    { border-color: rgba(239,68,68,0.4); color: #ef4444; }

.digital-time {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-cyan) 50%, var(--accent-violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4));
  animation: timePulse 1s ease-in-out infinite alternate;
}
@keyframes timePulse {
  from { filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.3)); }
  to   { filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.6)); }
}

.ampm-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.8rem, 1.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.25em;
  padding: 5px 16px;
  border-radius: 30px;
  background: linear-gradient(90deg, rgba(0,229,255,0.15), rgba(168,85,247,0.15));
  border: 1px solid rgba(0,229,255,0.3);
  color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0,229,255,0.2);
}

/* =========================================================
   WEATHER PANEL
   ========================================================= */
.weather-panel {
  grid-area: weather;
  border-radius: var(--radius-lg);
  padding: 18px 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "main  stats"
    "fore  fore";
  gap: 14px 30px;
  margin-top: 12px;
}

/* --- Main weather --- */
.weather-main {
  grid-area: main;
  display: flex;
  align-items: center;
  gap: 18px;
}

.weather-icon-wrap {
  position: relative;
}

.weather-icon {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  animation: iconFloat 3s ease-in-out infinite alternate;
  filter: drop-shadow(0 4px 12px rgba(0, 200, 255, 0.3));
}
@keyframes iconFloat {
  from { transform: translateY(0px); }
  to   { transform: translateY(-6px); }
}

.weather-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.temp-display {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 700;
  background: linear-gradient(90deg, #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
  line-height: 1;
}

.feels-like {
  font-size: clamp(0.7rem, 1.1vw, 0.88rem);
  color: var(--text-muted);
}

.weather-condition {
  font-size: clamp(0.85rem, 1.3vw, 1.05rem);
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* --- Weather Stats --- */
.weather-stats {
  grid-area: stats;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.stat-card {
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
  transition: transform 0.3s var(--transition), box-shadow 0.3s var(--transition);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.15);
}

.stat-icon {
  font-size: 1.3rem;
}
.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  font-weight: 700;
  color: var(--accent-cyan);
}

/* --- Forecast Bar --- */
.forecast-bar {
  grid-area: fore;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}
.forecast-bar::-webkit-scrollbar { display: none; }

.forecast-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 60px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  transition: background 0.3s, transform 0.3s;
  flex-shrink: 0;
}
.forecast-item:hover {
  background: rgba(0,229,255,0.08);
  transform: translateY(-2px);
}
.forecast-item.now {
  border-color: rgba(0,229,255,0.35);
  background: rgba(0,229,255,0.08);
}
.forecast-hour {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.06em;
}
.forecast-icon {
  font-size: 1.1rem;
}
.forecast-temp {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
}
.forecast-rain {
  font-size: 0.58rem;
  color: rgba(100,200,255,0.7);
  letter-spacing: 0.04em;
}

/* Moon phase truncation */
.stat-value {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   STATUS BAR
   ========================================================= */
.status-bar {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
}
.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: blink 2s ease-in-out infinite;
}
.status-dot.error {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.powered-by {
  margin-left: auto;
  font-size: 0.62rem;
  opacity: 0.5;
  letter-spacing: 0.06em;
  max-width: 300px;
  text-align: right;
}

/* =========================================================
   LOADING ANIMATION
   ========================================================= */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.loading-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
}

/* =========================================================
   RESPONSIVE TWEAKS
   ========================================================= */
@media (max-width: 768px) {
  .main-container {
    padding: 12px 14px 10px;
  }
  .center-block {
    flex-direction: column;
    gap: 16px;
  }
  .digital-block {
    align-items: center;
  }
  .weather-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "stats"
      "fore";
  }
  .weather-stats {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .top-bar {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    padding: 10px 16px;
  }
}

/* =========================================================
   ENTRY ANIMATIONS
   ========================================================= */
.main-container > * {
  animation: fadeUp 0.7s var(--transition) both;
}
.main-container > *:nth-child(1) { animation-delay: 0.1s; }
.main-container > *:nth-child(2) { animation-delay: 0.25s; }
.main-container > *:nth-child(3) { animation-delay: 0.4s; }
.main-container > *:nth-child(4) { animation-delay: 0.55s; }

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