/* ============================================================
   public.css — Maulakali Cable Car — Advanced Public View v3
   Aesthetic: Mountain Industrial · Dark Cinematic
   Fonts: Teko (display) + Rajdhani (body) + IBM Plex Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Teko:wght@300;400;500;600;700&family=Rajdhani:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:           #05080f;
  --bg-card:      #0b1220;
  --bg-panel:     #080e1c;
  --bg-glass:     rgba(11,18,32,0.85);
  --border:       rgba(255,255,255,0.06);
  --border-glow:  rgba(255,255,255,0.12);
  --text:         #dde5f5;
  --text-dim:     #6a7a9a;
  --text-xs:      #3a4868;
  --accent:       #2563ff;
  --accent-dim:   rgba(37,99,255,0.15);

  --green:  #00e676; --green-dim:  rgba(0,230,118,0.12);
  --red:    #ff3535; --red-dim:    rgba(255,53,53,0.12);
  --amber:  #ffb300; --amber-dim:  rgba(255,179,0,0.12);
  --orange: #ff6d00; --orange-dim: rgba(255,109,0,0.12);

  --status-color: var(--green);
  --status-bg:    #071a10;

  --font-disp: 'Teko', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-sm:  10px;
  --radius:     18px;
  --radius-lg:  26px;
  --gutter:     18px;
  --max-w:      500px;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.8s ease;
}

/* Subtle grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

/* Mountain silhouette at bottom */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='rgba(37,99,255,0.04)' d='M0,120 L0,80 L200,20 L400,70 L600,0 L800,50 L1000,10 L1200,55 L1440,25 L1440,120 Z'/%3E%3C/svg%3E") center bottom / cover no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(5,8,15,0.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 10px var(--gutter);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 34px; height: 34px;
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(37,99,255,0.5));
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-title {
  font-family: var(--font-disp);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #fff;
}
.logo-sub {
  font-family: var(--font-disp);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 2.5px;
  color: var(--accent);
  margin-top: 1px;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.server-clock {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  background: rgba(37,99,255,0.07);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(37,99,255,0.12);
}

.header-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-disp);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--green);
  font-weight: 600;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.3; transform:scale(0.6); }
}

/* ── MAIN ────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 18px var(--gutter) 60px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

/* ── STATUS CARD ─────────────────────────────────────────────── */
.status-stage { display: flex; justify-content: center; }

.status-card {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 32px 24px 28px;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.6s ease, background 0.6s ease;
}

.status-card.status-running     { border-color: rgba(0,230,118,0.28); background: #061510; }
.status-card.status-stopped     { border-color: rgba(255,53,53,0.28);  background: #120505; }
.status-card.status-maintenance { border-color: rgba(255,179,0,0.28);  background: #100d02; }
.status-card.status-break       { border-color: rgba(255,109,0,0.28);  background: #110a02; }

/* Animated corner accents */
.status-card::before,
.status-card::after {
  content: '';
  position: absolute;
  width: 28px; height: 28px;
  border: 2px solid var(--status-color);
  opacity: 0.3;
  transition: border-color 0.6s ease;
}
.status-card::before { top: 12px; left: 12px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.status-card::after  { bottom: 12px; right: 12px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.status-glow {
  position: absolute;
  inset: -80px;
  opacity: 0.18;
  filter: blur(70px);
  pointer-events: none;
  border-radius: 50%;
  transition: background 0.6s ease;
}

/* Status ring animation */
.status-ring-wrap {
  position: relative;
  width: 90px; height: 90px;
  margin: 0 auto 16px;
}
.status-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--status-color);
  opacity: 0.4;
  animation: spin 3s linear infinite;
}
.status-ring-inner {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-bottom-color: var(--status-color);
  opacity: 0.25;
  animation: spin 2s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-icon-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.status-icon-inner svg { width: 52px; height: 52px; }

.status-label {
  font-family: var(--font-disp);
  font-size: 56px;
  font-weight: 600;
  letter-spacing: 5px;
  line-height: 1;
  color: var(--status-color);
  text-shadow: 0 0 30px currentColor;
  transition: color 0.5s ease;
}

.status-sublabel {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.4;
}

/* Pulse animation for running */
@keyframes pulse-glow {
  0%,100% { text-shadow: 0 0 20px currentColor; }
  50%      { text-shadow: 0 0 50px currentColor, 0 0 80px currentColor; }
}
.status-running .status-label { animation: pulse-glow 2.5s ease-in-out infinite; }
.status-stopped .status-label { animation: none; }

.status-transition { animation: flash-in 0.45s cubic-bezier(0.4,0,0.2,1); }
@keyframes flash-in {
  0%  { opacity:0.2; transform: scale(0.96); }
  100%{ opacity:1;   transform: scale(1); }
}

/* ── BADGES ROW ──────────────────────────────────────────────── */
.badges-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-disp);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1px solid;
}
.badge-override {
  background: var(--amber-dim);
  border-color: rgba(255,179,0,0.3);
  color: var(--amber);
}
.badge-auto {
  background: rgba(37,99,255,0.1);
  border-color: rgba(37,99,255,0.25);
  color: #6699ff;
}
.badge-subs {
  background: rgba(0,230,118,0.08);
  border-color: rgba(0,230,118,0.2);
  color: var(--green);
  margin-left: auto;
}

/* ── MESSAGE BANNER ──────────────────────────────────────────── */
.message-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(37,99,255,0.07);
  border: 1px solid rgba(37,99,255,0.18);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.msg-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.message-banner p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
}

/* ── COUNTDOWN ───────────────────────────────────────────────── */
.countdown-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}
.countdown-label {
  font-family: var(--font-disp);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.countdown-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}
.time-digits {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 600;
  color: var(--status-color);
  line-height: 1;
  text-shadow: 0 0 16px currentColor;
}
.time-unit {
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-xs);
  margin-top: 2px;
}
.time-sep {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--border-glow);
  margin-bottom: 14px;
  animation: blink 1s step-end infinite;
}

/* ── QUICK STATS STRIP ───────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-tile-label {
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-xs);
}
.stat-tile-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-tile-value.ok  { color: var(--green); }
.stat-tile-value.err { color: var(--red); }
.stat-tile-value.dim { color: var(--text-dim); }

/* ── SCHEDULE CARD ───────────────────────────────────────────── */
.schedule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.schedule-header:hover { background: rgba(255,255,255,0.02); }

.schedule-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-disp);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text);
}
.schedule-toggle-icon {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform 0.3s;
}
.schedule-card.open .schedule-toggle-icon { transform: rotate(180deg); }

.schedule-body {
  display: none;
  padding: 0 16px 14px;
}
.schedule-card.open .schedule-body { display: block; }

.sched-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.sched-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.sched-row-item:last-child { border-bottom: none; }

.sched-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
}
.sched-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sched-right {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  padding: 3px 8px;
  border-radius: 5px;
}

.sched-active .sched-left { color: var(--status-color); font-weight: 600; }
.sched-active .sched-right { background: rgba(0,230,118,0.1); color: var(--green); }

.schedule-note-box {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(37,99,255,0.06);
  border: 1px solid rgba(37,99,255,0.15);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── NEXT EVENT BANNER ───────────────────────────────────────── */
.next-event-banner {
  background: linear-gradient(135deg, rgba(37,99,255,0.1), rgba(37,99,255,0.04));
  border: 1px solid rgba(37,99,255,0.22);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.neb-icon { font-size: 20px; flex-shrink: 0; }
.neb-content { flex: 1; }
.neb-label { font-family: var(--font-disp); font-size: 11px; letter-spacing: 2px; color: var(--text-dim); }
.neb-value { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--accent); margin-top: 1px; }

/* ── INFO STRIP ──────────────────────────────────────────────── */
.info-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.info-icon { font-size: 18px; flex-shrink: 0; }
.info-label {
  font-family: var(--font-disp);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-xs);
}
.info-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info-value.online { color: var(--green); }

/* ── NOTIFICATION SECTION ────────────────────────────────────── */
.notif-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.notif-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a40c8, #2563ff);
  color: #fff;
  font-family: var(--font-disp);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37,99,255,0.3);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.notif-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.notif-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(37,99,255,0.45); }
.notif-btn:hover::after { opacity: 1; }
.notif-btn:active { transform: translateY(0); }

.notif-btn.notif-active {
  background: linear-gradient(135deg, #0d5c2e, #00c853);
  box-shadow: 0 4px 20px rgba(0,200,83,0.3);
}
.notif-btn.notif-denied {
  background: rgba(255,53,53,0.15);
  box-shadow: none;
  border: 1px solid rgba(255,53,53,0.3);
  cursor: not-allowed;
}
.notif-btn-icon { font-size: 18px; }

.notif-hint {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.4;
}

.notif-sub-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-xs);
}
.notif-sub-count span { color: var(--green); }

/* ── HISTORY SECTION ─────────────────────────────────────────── */
.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.history-header:hover { background: rgba(255,255,255,0.02); }
.history-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-disp);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text);
}

.history-body { display: none; padding: 10px 16px 14px; }
.history-card.open .history-body { display: block; }
.history-card.open .schedule-toggle-icon { transform: rotate(180deg); }

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }

.hist-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hist-dot.running     { background: var(--green); }
.hist-dot.stopped     { background: var(--red); }
.hist-dot.maintenance { background: var(--amber); }
.hist-dot.break       { background: var(--orange); }

.hist-status {
  font-family: var(--font-disp);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text);
  min-width: 90px;
}
.hist-msg {
  font-size: 13px;
  color: var(--text-dim);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hist-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-xs);
  flex-shrink: 0;
}

.history-empty {
  text-align: center;
  color: var(--text-xs);
  font-size: 14px;
  padding: 16px 0;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
  padding: 16px var(--gutter);
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}
.site-footer p {
  font-size: 12px;
  color: var(--text-xs);
  line-height: 1.8;
}
.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer a:hover { color: var(--accent); }

/* ── TOAST ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a2540;
  border: 1px solid var(--border-glow);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 12px;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s;
  opacity: 0;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── SECTION DIVIDER ─────────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
}
.section-divider span {
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--text-xs);
  white-space: nowrap;
}
.divider-line { flex: 1; height: 1px; background: var(--border); }

/* ── LOADING SKELETON ────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.04) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (min-width: 480px) {
  .status-label { font-size: 64px; }
  .status-ring-wrap { width: 100px; height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
