/* ==========================================================================
   Digital Signage — layar.briskigroup.com
   Ultra-modern, high performance TV display stylesheet
   ========================================================================== */

:root {
  --bg-primary: #070b14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --color-primary: #0284c7;
  --color-primary-glow: rgba(2, 132, 199, 0.45);
  --color-text: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-muted: rgba(255, 255, 255, 0.45);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-duration: 0.8s;
  --transition-timing: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-primary);
  font-family: var(--font-family);
  color: var(--color-text);
  cursor: default;
}

/* Hide cursor when idle on TV */
body.idle {
  cursor: none;
}

/* ==========================================================================
   Main Viewport & Slide Container
   ========================================================================== */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.slides-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.slide-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.slide-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(100%);
  transition: transform var(--transition-duration) var(--transition-timing),
              opacity var(--transition-duration) ease;
  will-change: transform, opacity;
  pointer-events: none;
}

.slide-item.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}

.slide-item.prev {
  opacity: 0;
  transform: translateX(-100%);
  z-index: 1;
}

/* Ambient glow backdrop for non-16:9 media */
.ambient-backdrop {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.4);
  transform: scale(1.1);
  z-index: 1;
}

.slide-content-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-media {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Optional title badge on slide */
.slide-caption {
  position: absolute;
  bottom: 2.5rem;
  left: 3rem;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(12px);
  padding: 0.875rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 5;
  animation: slideUpFade 0.6s ease;
}

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

/* ==========================================================================
   Header HUD Overlay (Auto-fades on idle)
   ========================================================================== */
.hud-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  padding: 1.25rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  z-index: 20;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  pointer-events: auto;
}

.hud-logo {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.7));
}

.hud-branch-badge {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.02em;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  pointer-events: auto;
}

.hud-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-time {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.hud-date {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.hud-status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDot 2s infinite;
}

.status-dot.polling {
  background: #eab308;
  box-shadow: 0 0 8px #eab308;
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hud-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* ==========================================================================
   Bottom HUD / Progress Bar
   ========================================================================== */
.hud-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
  z-index: 20;
  pointer-events: none;
}

.progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  box-shadow: 0 0 10px #38bdf8;
  transition: width 0.1s linear;
}

.slide-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s;
}

.dot.active {
  width: 24px;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.slide-count-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

/* ==========================================================================
   Standby / Fallback Screen (When no slides active)
   ========================================================================== */
.standby-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #111e38 0%, #060a12 100%);
  z-index: 10;
  text-align: center;
  padding: 2rem;
}

.standby-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 680px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3.5rem 4rem;
  border-radius: 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  animation: floatCard 6s ease-in-out infinite;
}

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

.standby-logo {
  height: 88px;
  width: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 4px 16px rgba(2, 132, 199, 0.5));
}

.standby-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 0.75rem;
}

.standby-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.standby-branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.35);
  color: #38bdf8;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.standby-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Branch Picker Modal (If no ?branch= param)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 580px;
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  color: #fff;
}

.modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.modal-logo {
  height: 52px;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.branch-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1.75rem;
}

.branch-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.25rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.branch-card:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: #0284c7;
  transform: translateY(-2px);
}

.branch-card-code {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.branch-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
