/* --- DESIGN SYSTEM: AIRPORT FIDS THEME --- */
:root {
  --bg-obsidian: #030408;
  --bg-board: #090b14;
  --bg-row-even: #0e111d;
  --bg-row-odd: #121626;
  --border-color: #dc2626;      /* Red Border */
  
  --color-red: #be123c;         /* Primary Red */
  --color-red-light: #ef4444;   /* Bright Red */
  --color-white: #ffffff;      /* White */
  --color-cyan: #e2e8f0;       /* Silver for Locations */
  --color-ongoing: #ef4444;    /* BERJALAN is RED */
  --color-upcoming: #ffffff;   /* TERJADWAL is WHITE */
  --color-muted: #64748b;
  
  --font-fids: 'Outfit', sans-serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-obsidian);
  color: var(--color-white);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- OVERALL CONTAINER --- */
.signage-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 1.5rem 2rem;
  background: radial-gradient(circle at top, #0f172a 0%, var(--bg-obsidian) 70%);
}

/* --- OFFLINE FALLBACK INDICATOR --- */
.offline-indicator {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: white;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-fids);
  font-weight: 800;
  font-size: 1rem;
  z-index: 1000;
  box-shadow: 0 0 25px rgba(220, 38, 38, 0.6);
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.offline-indicator.hidden {
  display: none;
}

.indicator-dot {
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  animation: flash 1s infinite alternate;
}

/* --- LOADING SCREEN --- */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-obsidian);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--color-red-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

.loader p {
  font-family: var(--font-fids);
  font-size: 1.2rem;
  color: var(--color-white);
  letter-spacing: 0.1em;
}

/* --- HEADER (AIRPORT INFO PANEL STYLE) --- */
.signage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.2rem;
  border-bottom: 3px double var(--border-color);
  margin-bottom: 1.2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0.4rem;
  border-radius: 6px;
  border: 2px solid var(--color-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.institution-details h1 {
  font-family: var(--font-fids);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.1;
}

.institution-details p {
  font-size: 0.95rem;
  color: var(--color-white);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

/* Widget Cuaca */
.weather-widget {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.weather-icon {
  color: var(--color-red-light);
}

.weather-svg {
  animation: float 4s ease-in-out infinite;
}

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

.weather-info .temp {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--color-white);
}

.weather-info .desc {
  font-size: 0.75rem;
  color: var(--color-white);
  font-weight: 700;
  text-transform: uppercase;
}

/* Widget Jam & Tanggal */
.datetime-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.digital-clock {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: bold;
  color: var(--color-white);
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.calendar-date {
  font-family: var(--font-fids);
  font-size: 0.95rem;
  color: var(--color-white);
  margin-top: 0.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- MAIN CONTENT & FIDS BOARD --- */
.signage-content {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.2rem;
}

.fids-board {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg-board);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Table Header */
.fids-header-row {
  display: flex;
  background: var(--color-red);
  border-bottom: 2px solid var(--border-color);
  padding: 0.8rem 1rem;
}

.fids-th {
  font-family: var(--font-fids);
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-white);
  letter-spacing: 0.05em;
}

/* Column Widths (FIDS Layout) */
.col-date { width: 12%; text-align: left; }
.col-time { width: 13%; text-align: left; }
.col-event { width: 32%; }
.col-location { width: 16%; }
.col-organizer { width: 14%; }
.col-status { width: 13%; text-align: right; }

/* Table Body */
.fids-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* FIDS Rows */
.fids-row {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-fids);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
  min-height: 0;
}

.fids-row:nth-child(even) { background-color: var(--bg-row-even); }
.fids-row:nth-child(odd) { background-color: var(--bg-row-odd); }

.fids-row .col-date, .fids-row .col-time {
  font-family: var(--font-mono);
  color: var(--color-white);
  font-size: 1.35rem;
}

.fids-row .col-event {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 1.5rem;
  overflow: hidden;
}

.fids-row .event-title {
  font-family: var(--font-fids);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fids-row .event-desc {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-white);
  opacity: 0.65;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}

.fids-row .col-location {
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1rem;
}

.fids-row .col-organizer {
  color: var(--color-white);
  font-weight: 500;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1rem;
}

/* FIDS STATUS BADGES */
.fids-status {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}

/* BOARDING (Sedang Berlangsung) - Pulsating neon green */
.fids-status.boarding {
  color: var(--color-white);
  animation: flash-fids-status 1.2s infinite alternate;
}

/* SCHEDULED (Akan Datang) - Steady cyan */
.fids-status.scheduled {
  color: var(--color-white);
}

/* DEPARTED (Selesai) - Dimmed gray */
.fids-status.departed {
  color: var(--color-muted);
}

/* Empty Signage Board */
.fids-empty-state {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--color-white);
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: 0.05em;
}

/* --- LAYOUT WELCOME (JIKA TIADA KEGIATAN AKTIF) --- */
.no-events-layout {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.no-events-layout.hidden {
  display: none;
}

.glass-card {
  background: var(--bg-board);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.welcome-box {
  max-width: 900px;
  padding: 3.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 0.8s ease-out;
}

.welcome-logo {
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3));
}

.welcome-box h2 {
  font-family: var(--font-fids);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
  color: white;
}

.welcome-time {
  font-family: var(--font-fids);
  font-size: 1.1rem;
  color: var(--color-white);
  margin-bottom: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.welcome-tips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  text-align: left;
}

.tip-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1.5rem;
}

.tip-card h3 {
  font-family: var(--font-fids);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--color-white);
  letter-spacing: 0.05em;
}

.tip-card p {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--color-white);
  opacity: 0.8;
}

/* --- FOOTER & TICKER (RUNNING TEXT) --- */
.signage-footer {
  height: 50px;
  background: #000;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  align-items: center;
}

.ticker-title {
  background: var(--color-red);
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  font-family: var(--font-fids);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: white;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
  z-index: 10;
  white-space: nowrap;
}

.ticker-wrap {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  position: absolute;
  will-change: transform;
  animation: ticker-animation 30s linear infinite;
  font-family: var(--font-mono);
  font-size: 1.0rem;
  font-weight: bold;
  color: var(--color-white);
}

.ticker-item {
  display: inline-block;
  padding-right: 4rem;
  text-transform: uppercase;
}

.ticker-divider {
  margin: 0 1.5rem;
  color: var(--color-white);
}

/* --- FLOATING FULLSCREEN BUTTON --- */
.fullscreen-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 4px;
  background: #000;
  border: 1px solid var(--border-color);
  color: var(--color-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 9999;
  transition: all 0.3s ease;
  opacity: 0.3;
}

.fullscreen-btn:hover {
  opacity: 1;
  transform: scale(1.05);
  color: var(--color-red-light);
  border-color: var(--color-red-light);
}

.hidden {
  display: none !important;
}

/* --- ANIMATIONS & KEYFRAMES --- */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes flash {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}

@keyframes flash-fids-status {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes ticker-animation {
  0% { transform: translate3d(100%, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

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

/* --- SPLIT FLAP FLIP EFFECT FOR FIDS ROWS --- */
@keyframes splitFlapFlip {
  0% {
    transform: perspective(600px) rotateX(-90deg);
    opacity: 0;
    background-color: #ffb000;
  }
  50% {
    background-color: #1e1e1e;
  }
  100% {
    transform: perspective(600px) rotateX(0deg);
    opacity: 1;
  }
}

.fids-row {
  transform-origin: top center;
  animation: splitFlapFlip 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Staggered Row Animation Delays */
.fids-row:nth-child(1) { animation-delay: 0.05s; }
.fids-row:nth-child(2) { animation-delay: 0.10s; }
.fids-row:nth-child(3) { animation-delay: 0.15s; }
.fids-row:nth-child(4) { animation-delay: 0.20s; }
.fids-row:nth-child(5) { animation-delay: 0.25s; }
.fids-row:nth-child(6) { animation-delay: 0.30s; }
.fids-row:nth-child(7) { animation-delay: 0.35s; }
.fids-row:nth-child(8) { animation-delay: 0.40s; }
.fids-row:nth-child(9) { animation-delay: 0.45s; }
.fids-row:nth-child(10) { animation-delay: 0.50s; }


/* --- SIGNAGE SLIDE ROTATION SYSTEM --- */
.signage-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease-in-out, visibility 1.2s ease-in-out;
  pointer-events: none;
}

.signage-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* --- STATS DASHBOARD GRID SYSTEM --- */
.stats-dashboard {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 0 0.5rem;
}

.stats-dashboard-title {
  display: flex;
  align-items: center;
  font-family: var(--font-fids);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: var(--color-white);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.stats-grid-container {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  flex: 1;
  min-height: 0;
}

.stats-row-half {
  display: flex;
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
}

.stats-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.stats-card-header {
  font-family: var(--font-fids);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--color-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  opacity: 0.9;
}

.chart-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
}

.chart-row-flex {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.big-number-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  padding: 1.2rem 0.8rem;
  width: 140px;
  min-width: 140px;
  text-align: center;
}

.big-num-label {
  font-family: var(--font-fids);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--color-white);
  opacity: 0.7;
  letter-spacing: 0.05em;
}

.big-num {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-white);
  margin-top: 0.4rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.chart-flex-fill {
  flex: 1;
  height: 100%;
  min-height: 0;
  position: relative;
}

.chart-flex-fill-split {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  gap: 1.2rem;
}

.mini-chart {
  width: 33%;
  height: 100%;
  position: relative;
}

.mini-chart-wide {
  width: 67%;
  height: 100%;
  position: relative;
}

.chart-flex-fill-split-three {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  gap: 1rem;
}

.mini-chart-third {
  flex: 1;
  height: 100%;
  position: relative;
  min-width: 0;
}


