/* ==========================================================================
   HELIANZ DENTAL TV QUEUE DISPLAY - STYLESHEET
   Optimized for 1080p / 4K Displays, Smart TVs, and Landscape Monitors
   Multi-Theme Healthcare System: Clean Cyan (Light), Mint Emerald, Warm Pearl, Dark Navy
   ========================================================================== */

/* ==========================================================================
   THEME 1: CLEAN CLINICAL CYAN (LIGHT) - RECOMMENDED HEALTHCARE DEFAULT
   ========================================================================== */
:root, body.theme-clean-light {
  --bg-main: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #F8FAFC;
  --border-subtle: #E2E8F0;
  --border-focus: #0284C7;

  /* Accents */
  --cyan-primary: #0284C7;
  --cyan-glow: rgba(2, 132, 199, 0.22);
  --teal-accent: #0D9488;
  --emerald-success: #059669;
  --emerald-glow: rgba(5, 150, 105, 0.22);
  --amber-warning: #D97706;
  --amber-glow: rgba(217, 119, 6, 0.25);
  --indigo-accent: #4F46E5;
  --rose-accent: #E11D48;

  /* Typography */
  --font-brand: 'Outfit', sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Text Colors */
  --text-pure: #0F172A;
  --text-heading: #1E293B;
  --text-body: #334155;
  --text-muted: #64748B;

  /* Surfaces & Hero */
  --hero-bg: linear-gradient(135deg, #FFFFFF 0%, #F0FDFA 100%);
  --hero-border: #0EA5E9;
  --hero-ticket-bg: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
  --hero-ticket-border: #0284C7;
  --hero-ticket-text: #0369A1;
  --hero-detail-bg: #F8FAFC;

  --header-bg: rgba(255, 255, 255, 0.94);
  --footer-bg: #FFFFFF;
  --footer-tag-bg: linear-gradient(135deg, #0284C7, #0D9488);
  --footer-tag-text: #FFFFFF;
  --marquee-text: #0F172A;

  /* Shadows & Glass */
  --glass-blur: blur(16px);
  --shadow-lg: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 0 20px rgba(2, 132, 199, 0.06);
  --shadow-glow-cyan: 0 0 30px rgba(2, 132, 199, 0.3);
  --shadow-glow-amber: 0 0 30px rgba(217, 119, 6, 0.3);

  --modal-bg: #FFFFFF;
  --modal-header-bg: #F8FAFC;
  --input-bg: #FFFFFF;
  --input-border: #CBD5E1;
  --input-text: #0F172A;
  --ambient-1: rgba(2, 132, 199, 0.09);
  --ambient-2: rgba(79, 70, 229, 0.06);
}

/* ==========================================================================
   THEME 2: SERENE DENTAL MINT & EMERALD (CARE)
   ========================================================================== */
body.theme-mint-care {
  --bg-main: #F0FDF4;
  --bg-surface: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #F7FEE7;
  --border-subtle: #D1FAE5;
  --border-focus: #059669;

  --cyan-primary: #059669;
  --cyan-glow: rgba(5, 150, 105, 0.22);
  --teal-accent: #0D9488;
  --emerald-success: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.22);
  --amber-warning: #D97706;
  --amber-glow: rgba(217, 119, 6, 0.25);
  --indigo-accent: #047857;
  --rose-accent: #E11D48;

  --text-pure: #064E3B;
  --text-heading: #065F46;
  --text-body: #374151;
  --text-muted: #6B7280;

  --hero-bg: linear-gradient(135deg, #FFFFFF 0%, #ECFDF5 100%);
  --hero-border: #10B981;
  --hero-ticket-bg: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
  --hero-ticket-border: #059669;
  --hero-ticket-text: #065F46;
  --hero-detail-bg: #F0FDF4;

  --header-bg: rgba(255, 255, 255, 0.94);
  --footer-bg: #FFFFFF;
  --footer-tag-bg: linear-gradient(135deg, #059669, #10B981);
  --footer-tag-text: #FFFFFF;
  --marquee-text: #064E3B;

  --shadow-lg: 0 10px 30px -5px rgba(6, 78, 59, 0.08), 0 0 20px rgba(5, 150, 105, 0.06);
  --shadow-glow-cyan: 0 0 30px rgba(5, 150, 105, 0.3);
  --shadow-glow-amber: 0 0 30px rgba(217, 119, 6, 0.3);

  --modal-bg: #FFFFFF;
  --modal-header-bg: #ECFDF5;
  --input-bg: #FFFFFF;
  --input-border: #A7F3D0;
  --input-text: #064E3B;
  --ambient-1: rgba(16, 185, 129, 0.1);
  --ambient-2: rgba(13, 148, 136, 0.06);
}

/* ==========================================================================
   THEME 3: WARM SOFT PEARL & CORAL (COMFORT / FAMILY)
   ========================================================================== */
body.theme-warm-pearl {
  --bg-main: #FFFDF7;
  --bg-surface: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #FFF7ED;
  --border-subtle: #FED7AA;
  --border-focus: #EA580C;

  --cyan-primary: #EA580C;
  --cyan-glow: rgba(234, 88, 12, 0.22);
  --teal-accent: #D97706;
  --emerald-success: #16A34A;
  --emerald-glow: rgba(22, 163, 74, 0.22);
  --amber-warning: #D97706;
  --amber-glow: rgba(217, 119, 6, 0.25);
  --indigo-accent: #C2410C;
  --rose-accent: #F43F5E;

  --text-pure: #431407;
  --text-heading: #7C2D12;
  --text-body: #4B5563;
  --text-muted: #78716C;

  --hero-bg: linear-gradient(135deg, #FFFFFF 0%, #FFF7ED 100%);
  --hero-border: #F97316;
  --hero-ticket-bg: linear-gradient(135deg, #FFEDD5 0%, #FED7AA 100%);
  --hero-ticket-border: #EA580C;
  --hero-ticket-text: #7C2D12;
  --hero-detail-bg: #FFFDF7;

  --header-bg: rgba(255, 255, 255, 0.94);
  --footer-bg: #FFFFFF;
  --footer-tag-bg: linear-gradient(135deg, #EA580C, #F43F5E);
  --footer-tag-text: #FFFFFF;
  --marquee-text: #431407;

  --shadow-lg: 0 10px 30px -5px rgba(67, 20, 7, 0.08), 0 0 20px rgba(234, 88, 12, 0.06);
  --shadow-glow-cyan: 0 0 30px rgba(234, 88, 12, 0.3);
  --shadow-glow-amber: 0 0 30px rgba(217, 119, 6, 0.3);

  --modal-bg: #FFFFFF;
  --modal-header-bg: #FFF7ED;
  --input-bg: #FFFFFF;
  --input-border: #FDBA74;
  --input-text: #431407;
  --ambient-1: rgba(249, 115, 22, 0.09);
  --ambient-2: rgba(244, 63, 94, 0.05);
}

/* ==========================================================================
   THEME 4: MODERN DARK NAVY (LEGACY / NIGHT MODE)
   ========================================================================== */
body.theme-dark-navy, body.theme-dark {
  --bg-main: #070D1B;
  --bg-surface: #0E172B;
  --bg-card: rgba(18, 29, 51, 0.78);
  --bg-card-hover: rgba(28, 44, 76, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(6, 182, 212, 0.5);

  --cyan-primary: #06B6D4;
  --cyan-glow: rgba(6, 182, 212, 0.35);
  --teal-accent: #14B8A6;
  --emerald-success: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --amber-warning: #F59E0B;
  --amber-glow: rgba(245, 158, 11, 0.35);
  --indigo-accent: #6366F1;
  --rose-accent: #F43F5E;

  --text-pure: #FFFFFF;
  --text-heading: #F8FAFC;
  --text-body: #CBD5E1;
  --text-muted: #64748B;

  --hero-bg: linear-gradient(135deg, rgba(14, 31, 58, 0.9), rgba(10, 20, 39, 0.95));
  --hero-border: rgba(6, 182, 212, 0.6);
  --hero-ticket-bg: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(15, 23, 42, 0.8));
  --hero-ticket-border: rgba(6, 182, 212, 0.4);
  --hero-ticket-text: #FFFFFF;
  --hero-detail-bg: rgba(255, 255, 255, 0.03);

  --header-bg: rgba(14, 23, 43, 0.85);
  --footer-bg: rgba(10, 17, 33, 0.95);
  --footer-tag-bg: linear-gradient(135deg, #06B6D4, #14B8A6);
  --footer-tag-text: #04101A;
  --marquee-text: #E2E8F0;

  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.1);
  --shadow-glow-cyan: 0 0 35px rgba(6, 182, 212, 0.4);
  --shadow-glow-amber: 0 0 40px rgba(245, 158, 11, 0.45);

  --modal-bg: #0E172B;
  --modal-header-bg: rgba(18, 29, 51, 0.9);
  --input-bg: rgba(10, 17, 33, 0.9);
  --input-border: rgba(255, 255, 255, 0.08);
  --input-text: #FFFFFF;
  --ambient-1: rgba(6, 182, 212, 0.12);
  --ambient-2: rgba(99, 102, 241, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-body);
  font-family: var(--font-sans);
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Ambient Gradient */
body::before {
  content: '';
  position: fixed;
  top: -15%;
  left: -10%;
  width: 50vw;
  height: 50vh;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ambient-1) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 0;
  pointer-events: none;
  transition: background 0.4s ease;
}

body::after {
  content: '';
  position: fixed;
  bottom: -15%;
  right: -10%;
  width: 55vw;
  height: 55vh;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ambient-2) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 0;
  pointer-events: none;
  transition: background 0.4s ease;
}

/* TV CONTAINER */
.tv-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* ==========================================================================
   AUDIO UNLOCK BANNER (Smart TV Browsers Autoplay Handling)
   ========================================================================== */
.audio-unlock-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid var(--cyan-primary);
  border-radius: 14px;
  padding: 10px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), var(--shadow-glow-cyan);
  backdrop-filter: var(--glass-blur);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from { transform: translate(-50%, -100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.banner-icon {
  color: var(--cyan-primary);
  display: flex;
  align-items: center;
}

.banner-text {
  display: flex;
  flex-direction: column;
}

.banner-text strong {
  font-size: 0.95rem;
  color: var(--text-pure);
}

.banner-text span {
  font-size: 0.8rem;
  color: var(--text-body);
}

.btn-unlock {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--cyan-primary), var(--teal-accent));
  color: #04101A;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-unlock:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
}

/* ==========================================================================
   TOP HEADER BAR (8vh)
   ========================================================================== */
.tv-header {
  height: 8.5vh;
  min-height: 60px;
  background: var(--header-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2vw;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(13, 148, 136, 0.2));
  border: 1px solid var(--cyan-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-primary);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.brand-text h1 {
  font-family: var(--font-brand);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-pure);
  line-height: 1.1;
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.branch-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--cyan-glow);
  color: var(--cyan-primary);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--cyan-primary);
}

.clinic-select-dropdown, .theme-select-dropdown {
  background: var(--bg-card);
  color: var(--cyan-primary);
  font-family: var(--font-brand);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.clinic-select-dropdown:hover, .clinic-select-dropdown:focus,
.theme-select-dropdown:hover, .theme-select-dropdown:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.clinic-select-dropdown option, .theme-select-dropdown option {
  background: var(--bg-surface);
  color: var(--text-pure);
}

.clinic-address {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-center-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--emerald-glow);
  border: 1px solid var(--emerald-success);
  padding: 4px 14px;
  border-radius: 20px;
}

.live-pulse {
  width: 9px;
  height: 9px;
  background-color: var(--emerald-success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--emerald-success);
  animation: pulseGreen 1.6s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-text {
  font-family: var(--font-brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--emerald-success);
}

.conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.conn-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.conn-status.online .dot {
  background: var(--emerald-success);
}

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

.clock-display {
  text-align: right;
}

.time-main {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-pure);
  letter-spacing: 1px;
  line-height: 1;
}

.date-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--cyan-primary);
  margin-top: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--cyan-glow);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  transform: translateY(-2px);
}

.caller-btn {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--indigo-accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.caller-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--indigo-accent);
  color: var(--indigo-accent);
}

/* ==========================================================================
   MAIN SPLIT SCREEN (84vh)
   ========================================================================== */
.tv-main {
  flex: 1;
  display: grid;
  grid-template-columns: 48% 52%;
  gap: 1.2vw;
  padding: 1.2vw;
  overflow: hidden;
}

/* ==========================================================================
   LEFT SECTION: QUEUE DISPLAY
   ========================================================================== */
.queue-section {
  display: flex;
  flex-direction: column;
  gap: 1.1vw;
  height: 100%;
  overflow: hidden;
}

/* HERO CALLING CARD */
.hero-calling-card {
  position: relative;
  background: var(--hero-bg);
  border: 2px solid var(--hero-border);
  border-radius: 20px;
  padding: 18px 24px;
  box-shadow: var(--shadow-lg), var(--cyan-glow);
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
  transition: all 0.4s ease;
}

.hero-calling-card.active-call-animation {
  border-color: var(--amber-warning);
  box-shadow: 0 0 50px var(--amber-glow);
  animation: pulseCardAmber 1.2s infinite alternate ease-in-out;
}

@keyframes pulseCardAmber {
  0% { transform: scale(1); }
  100% { transform: scale(1.012); }
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calling-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--amber-glow);
  border: 1px solid var(--amber-warning);
  padding: 4px 14px;
  border-radius: 20px;
}

.calling-badge .beacon {
  width: 10px;
  height: 10px;
  background: var(--amber-warning);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--amber-warning);
  animation: beaconPulse 1s infinite alternate;
}

@keyframes beaconPulse {
  0% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

.calling-label-text {
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--amber-warning);
}

/* Audio wave visualizer */
.audio-wave-anim {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.audio-wave-anim span {
  width: 4px;
  background: var(--amber-warning);
  border-radius: 2px;
  animation: waveBar 0.8s infinite ease-in-out;
}

.audio-wave-anim span:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.audio-wave-anim span:nth-child(2) { height: 16px; animation-delay: 0.2s; }
.audio-wave-anim span:nth-child(3) { height: 22px; animation-delay: 0.3s; }
.audio-wave-anim span:nth-child(4) { height: 12px; animation-delay: 0.4s; }
.audio-wave-anim span:nth-child(5) { height: 8px; animation-delay: 0.5s; }

@keyframes waveBar {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1.2); }
}

.hero-body {
  display: grid;
  grid-template-columns: 40% 60%;
  align-items: center;
  gap: 20px;
}

.ticket-wrapper {
  background: var(--hero-ticket-bg);
  border: 2px solid var(--hero-ticket-border);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.04);
}

.ticket-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--cyan-primary);
  margin-bottom: 4px;
}

.ticket-number {
  font-family: var(--font-brand);
  font-size: 3.6rem;
  font-weight: 900;
  color: var(--hero-ticket-text);
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px var(--cyan-glow);
}

.hero-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--hero-detail-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 14px;
}

.icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--cyan-glow);
  color: var(--cyan-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box.room-icon {
  background: var(--emerald-glow);
  color: var(--emerald-success);
}

.icon-box.doctor-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--indigo-accent);
}

.detail-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-info .label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.detail-info .value {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-pure);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.highlight-name {
  color: var(--cyan-primary) !important;
  font-weight: 800 !important;
}

.highlight-room {
  color: var(--emerald-success) !important;
  font-weight: 800 !important;
}

/* ==========================================================================
   DOCTOR ROOMS MATRIX
   ========================================================================== */
.rooms-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.section-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan-primary);
}

.title-with-icon h2 {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-heading);
}

.count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  padding: 2px 10px;
  border-radius: 12px;
}

.queue-badge {
  background: var(--cyan-glow);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: all 0.25s ease;
}

.room-card.is-serving {
  border-color: var(--emerald-success);
  background: linear-gradient(135deg, var(--emerald-glow), var(--bg-card));
  box-shadow: 0 4px 18px var(--emerald-glow);
}

.room-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-name {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-pure);
}

.status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.status-pill.serving {
  background: var(--emerald-glow);
  color: var(--emerald-success);
  border: 1px solid var(--emerald-success);
}

.status-pill.available {
  background: var(--cyan-glow);
  color: var(--cyan-primary);
  border: 1px solid var(--cyan-primary);
}

.room-doctor-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 4px 0;
}

.room-ticket-serving {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  padding: 4px 10px;
  margin-top: 4px;
  border: 1px solid var(--border-subtle);
}

.serving-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.serving-num {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-pure);
}

.serving-num.empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   UPCOMING TICKETS / WAITING LIST
   ========================================================================== */
.waiting-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.waiting-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.waiting-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  text-align: center;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.waiting-mini-ticket {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--cyan-primary);
}

.waiting-mini-patient {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.waiting-mini-room {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   RIGHT SECTION: MEDIA & VIDEO PLAYER (52% Width)
   ========================================================================== */
.media-section {
  display: flex;
  flex-direction: column;
  gap: 1.1vw;
  height: 100%;
  overflow: hidden;
}

.video-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  flex: 1;
  min-height: 0;
}

.video-header {
  height: 44px;
  background: var(--modal-header-bg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.video-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.video-play-icon {
  color: var(--rose-accent);
  display: flex;
  align-items: center;
}

.video-title {
  font-family: var(--font-brand);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-pure);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.meta-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: 6px;
}

.btn-video-audio {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-video-audio:hover {
  background: var(--cyan-glow);
  color: var(--cyan-primary);
  border-color: var(--cyan-primary);
}

/* Video Frame (16:9 Aspect Ratio) */
.video-player-frame {
  position: relative;
  width: 100%;
  flex: 1;
  background: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-container, .html5-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
}

.video-hover-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 23, 43, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  padding: 6px 14px;
  backdrop-filter: var(--glass-blur);
  opacity: 0;
  transition: opacity 0.3s;
}

.video-player-frame:hover .video-hover-controls {
  opacity: 1;
}

.vid-ctrl-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s;
}

.vid-ctrl-btn:hover {
  background: rgba(6, 182, 212, 0.3);
  transform: scale(1.1);
}

.vid-ctrl-btn.play-btn {
  background: var(--cyan-primary);
  color: #FFFFFF;
}

/* Playlist Bar */
.playlist-bar {
  background: var(--modal-header-bg);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.playlist-bar-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  white-space: nowrap;
}

.playlist-thumbnails {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
}

.playlist-thumbnails::-webkit-scrollbar {
  height: 4px;
}

.playlist-thumbnails::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.playlist-item-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-body);
  transition: all 0.2s;
}

.playlist-item-card:hover, .playlist-item-card.active {
  background: var(--cyan-glow);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  font-weight: 700;
}

/* ==========================================================================
   TIPS & HEALTH INFO CAROUSEL
   ========================================================================== */
.tips-carousel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 14px 18px;
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-lg);
}

.tips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tips-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-accent);
  font-family: var(--font-brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.tips-indicators {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tips-indicators .indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: all 0.3s;
}

.tips-indicators .indicator.active {
  width: 18px;
  border-radius: 10px;
  background: var(--teal-accent);
}

.tip-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tip-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.25);
  color: var(--teal-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-text-wrap h3 {
  font-family: var(--font-brand);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-pure);
  margin-bottom: 3px;
}

.tip-text-wrap p {
  font-size: 0.82rem;
  color: var(--text-body);
  line-height: 1.35;
}

/* ==========================================================================
   RUNNING TICKER / MARQUEE FOOTER (8vh)
   ========================================================================== */
.tv-footer {
  height: 7.5vh;
  min-height: 50px;
  background: var(--footer-bg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

.marquee-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--footer-tag-bg);
  color: var(--footer-tag-text);
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 0 20px;
  height: 100%;
  flex-shrink: 0;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.tag-pulse {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  animation: pulseDark 1.2s infinite;
}

@keyframes pulseDark {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

.marquee-track {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.marquee-content {
  display: inline-block;
  white-space: nowrap;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--marquee-text);
  letter-spacing: 0.5px;
  padding-left: 100%;
  animation: marqueeScroll 35s linear infinite;
}

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

/* ==========================================================================
   MODALS (Caller Remote & Settings)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 8, 16, 0.65);
  backdrop-filter: var(--glass-blur);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-window {
  background: var(--modal-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  width: 90vw;
  max-width: 950px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 24px;
  background: var(--modal-header-bg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan-primary);
}

.modal-title h2 {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-pure);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close-modal:hover {
  color: var(--text-pure);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 14px 24px;
  background: var(--modal-header-bg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Caller Remote Specific */
.caller-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.control-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--input-text);
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.caller-action-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.btn-primary-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--cyan-primary), var(--teal-accent));
  color: #FFFFFF;
  font-family: var(--font-brand);
  font-size: 0.88rem;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--cyan-glow);
  transition: all 0.2s;
}

.btn-primary-call:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--cyan-glow);
}

.btn-secondary-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--amber-glow);
  border: 1px solid var(--amber-warning);
  color: var(--amber-warning);
  font-family: var(--font-brand);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary-call:hover {
  background: var(--amber-warning);
  color: #FFFFFF;
}

.btn-action-seat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--emerald-glow);
  border: 1px solid var(--emerald-success);
  color: var(--emerald-success);
  font-family: var(--font-brand);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-seat:hover {
  background: var(--emerald-success);
  color: #FFFFFF;
}

.btn-action-done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--indigo-accent);
  font-family: var(--font-brand);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-done:hover {
  background: var(--indigo-accent);
  color: #FFFFFF;
}

.manual-call-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 16px;
}

.manual-call-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.manual-inputs {
  display: grid;
  grid-template-columns: 140px 1fr 160px;
  gap: 10px;
}

.btn-manual-call {
  background: var(--cyan-glow);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-manual-call:hover {
  background: var(--cyan-primary);
  color: #FFFFFF;
}

.caller-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.caller-table-wrap h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
}

.caller-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.caller-table th, .caller-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.caller-table th {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.caller-table tbody tr:hover {
  background: var(--cyan-glow);
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card.full-width {
  grid-column: span 2;
}

.settings-card h3 {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--cyan-primary);
}

/* Theme Picker in Settings */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 4px;
}

.theme-choice-card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  text-align: left;
}

.theme-choice-card:hover {
  border-color: var(--cyan-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.theme-choice-card.active {
  border-color: var(--cyan-primary);
  background: var(--cyan-glow);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.theme-swatches {
  display: flex;
  gap: 4px;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
}

.theme-swatches span {
  flex: 1;
  height: 100%;
}

.theme-choice-info strong {
  display: block;
  font-size: 0.8rem;
  color: var(--text-pure);
  font-weight: 700;
}

.theme-choice-info span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.25;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-body);
}

.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-body);
}

.help-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.form-range {
  width: 100%;
  accent-color: var(--cyan-primary);
}

.settings-playlist-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.settings-playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-remove-vid {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--rose-accent);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.add-video-form h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 10px 0 6px 0;
}

.add-video-inputs {
  display: grid;
  grid-template-columns: 1fr 1.5fr 150px;
  gap: 8px;
}

/* ==========================================================================
   RESPONSIVE SCALING FOR 4K AND TABLETS
   ========================================================================== */
@media (min-width: 2560px) {
  html {
    font-size: 24px;
  }
}

@media (max-width: 1024px) {
  .tv-main {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}
