/* ==========================================================================
   SI-BUKU TAMU (E-Tamu PTUN) — Custom Styles & Print Media
   ========================================================================== */

:root {
  --ease-ui: cubic-bezier(0.22, 1, 0.36, 1);
}

@layer base {
  html, body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
  }
  body {
    overscroll-behavior-y: contain;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  }
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  vertical-align: middle;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Sembunyikan scrollbar horizontal pada pill filter sambil tetap bisa digeser */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Animasi Skeleton Shimmer (Stitch Surface Neutral) */
.skeleton-shimmer {
  background: linear-gradient(90deg, #e9edff 25%, #f1f3ff 50%, #e9edff 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Transisi Halaman Instan */
.view-panel {
  animation: fadeSlideIn 0.22s var(--ease-ui);
}

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

/* Kartu Tiket Perforasi Kertas Thermal (Stitch Design) */
.ticket-perforated {
  position: relative;
}

.thermal-jagged-top {
  background-image: radial-gradient(ellipse at center, transparent 45%, #ffffff 50%);
  background-size: 14px 10px;
  background-repeat: repeat-x;
}

.thermal-paper-preview {
  font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
  background: #ffffff;
  color: #141b2b;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(1, 45, 29, 0.08);
}

.thermal-paper-58 {
  width: 268px;
  font-size: 11.5px;
}

.thermal-paper-80 {
  width: 360px;
  font-size: 12.5px;
}

.thermal-box-highlight {
  background: #012d1d;
  color: #ffffff;
  padding: 2px 8px;
  display: inline-block;
  font-weight: 600;
  border-radius: 4px;
}

/* Fokus Keyboard Aksesibel (Judicial Gold #D4A017) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #d4a017;
  outline-offset: 2px;
}

/* Material Symbols Filled helper */
.icon-filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================================================
   SIDEBAR (MENU KE SAMPING) UNTUK ADMIN, PETUGAS PTSP, PETUGAS SIDANG, SATPAM
   MENU PUBLIK / PENGUNJUNG TETAP SEPERTI SEMULA (NAVBAR HORIZONTAL DI ATAS)
   ========================================================================== */
#app-sidebar {
  transition: transform 0.24s var(--ease-ui);
}

header,
#main-content,
footer {
  transition: padding-left 0.24s var(--ease-ui);
}

/* 1. KONDISI DEFAULT: PENGUNJUNG PUBLIK (Menu Tetap di Atas) */
body:not(.is-staff-view) #app-sidebar {
  display: none !important;
}
body:not(.is-staff-view) #sidebar-overlay {
  display: none !important;
}
body:not(.is-staff-view) #staff-brand-wrap {
  display: none !important;
}
body:not(.is-staff-view) #public-brand-wrap {
  display: flex !important;
}
body:not(.is-staff-view) #top-main-nav {
  display: none;
}
@media (min-width: 1024px) {
  body:not(.is-staff-view) #top-main-nav {
    display: flex !important;
  }
}
@media (max-width: 1023px) {
  body:not(.is-staff-view) #top-mobile-nav {
    display: flex !important;
  }
  body:not(.is-staff-view) #main-content {
    padding-top: 6.25rem !important;
  }
}
body:not(.is-staff-view) header,
body:not(.is-staff-view) #main-content,
body:not(.is-staff-view) footer {
  padding-left: 0 !important;
}

/* 2. KONDISI STAFF: ADMIN, PETUGAS PTSP, PETUGAS SIDANG (PANITERA), SATPAM */
body.is-staff-view #public-brand-wrap {
  display: none !important;
}
body.is-staff-view #staff-brand-wrap {
  display: flex !important;
}
body.is-staff-view #top-main-nav {
  display: none !important;
}
body.is-staff-view #top-mobile-nav {
  display: none !important;
}

/* Jeda Konten Presisi di Sebelah Sidebar */
body.is-staff-view header > div,
body.is-staff-view #view-dashboard,
body.is-staff-view #view-pantau,
body.is-staff-view #view-kiosk,
body.is-staff-view footer > div {
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

body.is-staff-view #view-form-ptsp,
body.is-staff-view #view-form-sidang,
body.is-staff-view #view-tiket {
  margin-left: 0 !important;
  margin-right: auto !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

@media (min-width: 1024px) {
  body.is-staff-view:not(.sidebar-collapsed) #app-sidebar {
    display: flex !important;
    transform: translateX(0) !important;
  }
  body.is-staff-view.sidebar-collapsed #app-sidebar {
    transform: translateX(-100%) !important;
  }
  body.is-staff-view:not(.sidebar-collapsed) header,
  body.is-staff-view:not(.sidebar-collapsed) #main-content,
  body.is-staff-view:not(.sidebar-collapsed) footer {
    padding-left: 16rem !important;
  }
  body.is-staff-view.sidebar-collapsed header,
  body.is-staff-view.sidebar-collapsed #main-content,
  body.is-staff-view.sidebar-collapsed footer {
    padding-left: 0 !important;
  }
}

@media (max-width: 1023px) {
  body.is-staff-view header,
  body.is-staff-view #main-content,
  body.is-staff-view footer {
    padding-left: 0 !important;
  }
}

/* ==========================================================================
   PRINT MEDIA: Cetak Struk Thermal (58mm/80mm) vs Cetak Laporan Rekap PDF
   ========================================================================== */
@media print {
  body.printing-thermal * {
    visibility: hidden !important;
  }
  body.printing-thermal #thermal-print-area,
  body.printing-thermal #thermal-print-area * {
    visibility: visible !important;
  }
  body.printing-thermal #thermal-print-area {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 2mm !important;
    box-shadow: none !important;
    border: none !important;
  }

  body.printing-report header,
  body.printing-report .no-print {
    display: none !important;
  }
  body.printing-report main {
    padding-top: 0 !important;
  }
}

/* ==========================================================================
   DISPLAY RUANG TUNGGU PUBLIK / DASHBOARD ANTREAN TV
   ========================================================================== */

/* Running Text (Marquee Ticker di Bawah Video) */
.marquee-wrap {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.marquee-content {
  display: inline-block;
  padding-left: 100%;
  animation: marquee-scroll 36s linear infinite;
  will-change: transform;
}

.marquee-wrap:hover .marquee-content {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Sorotan Kartu Antrean Saat Nomor Berganti */
@keyframes queue-pulse-glow {
  0%, 100% {
    border-color: rgba(27, 67, 50, 0.25);
  }
  50% {
    border-color: #ffc641;
  }
}

.queue-pulse-active {
  animation: queue-pulse-glow 0.9s var(--ease-ui) 2;
}

/* Sorotan Angka Nomor Antrean Saat Dipanggil */
@keyframes flash-number {
  0%, 100% {
    color: #012d1d;
  }
  50% {
    color: #795900;
  }
}

.anim-flash-number {
  animation: flash-number 0.75s var(--ease-ui) 2;
}

/* Mode Fullscreen TV Display (100% Layar Khusus Monitor Ruang Tunggu) */
body.is-tv-fullscreen {
  background-color: #091811 !important;
  overflow: hidden !important;
}

body.is-tv-fullscreen header,
body.is-tv-fullscreen #app-sidebar,
body.is-tv-fullscreen footer,
body.is-tv-fullscreen #demo-banner,
body.is-tv-fullscreen #sidebar-overlay,
body.is-tv-fullscreen #display-header-bar {
  display: none !important;
}

body.is-tv-fullscreen #btn-floating-exit-tv {
  display: flex !important;
}

body.is-tv-fullscreen #main-content {
  padding: 0 !important;
  margin: 0 !important;
  background: #091811 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
}

body.is-tv-fullscreen #view-display {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  padding: 1.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  overflow: hidden !important;
  gap: 0 !important;
}

body.is-tv-fullscreen #view-display > .grid {
  height: 100% !important;
  align-items: stretch !important;
}

/* Floating Exit Button */
#btn-floating-exit-tv {
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s var(--ease-ui);
}

/* Sembunyikan footer saat halaman Display TV aktif */
body.is-view-display footer {
  display: none !important;
}

/* Presisi Layout untuk Sidebar Staff saat membuka Display */
body.is-staff-view #view-display {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
  max-width: 100% !important;
}

/* Responsif Frame Video 16:9 Khusus Mobile & Desktop */
.aspect-video {
  aspect-ratio: 16 / 9;
  position: relative;
  width: 100%;
}
.aspect-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}
