/* ===== CSS VARIABLES FOR THEME CONFIGURATION ===== */
:root {
  --primary-color: #0d9488; /* Modern Teal */
  --secondary-color: #115e59; /* Darker Teal */
  --accent-color: #f59e0b; /* Amber Accent */
  --success-color: #10b981; /* Emerald Success */
  --warning-color: #f59e0b; /* Amber Warning */
  --danger-color: #ef4444; /* Red Danger */
  --text-light: #ffffff;
  --text-dark: #1f2937; /* Modern Slate-Dark Text */
  --bg-light: #f3f4f6; /* Slate-Light Background */
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-light);
  overflow: hidden;
  height: 100vh;
  color: var(--text-dark);
}

/* ===== HEADER WITH LOGO AND CLOCK ===== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: var(--text-light);
  padding: 18px 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-container {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* Style for facility logo image */
.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

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

.facility-name {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.facility-subtitle {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.95;
  margin: 0;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#digital-clock {
  text-align: right;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.clock-label {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 5px;
}

.clock-time {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: "Courier New", monospace;
  letter-spacing: 2px;
}

/* ===== MAIN CONTAINER: 4 COLUMNS LAYOUT ===== */
.main-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 170px);
  background: var(--bg-light);
}

/* ===== COLUMN 1: VIDEO + CALL INFO + SLIDESHOW ===== */
.col-1 {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  height: 100%;
  max-height: 100%;
}

/* Video Section */
.video-section {
  flex: 0 0 32%;
  min-height: 160px;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}

#educational-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Call Info Section */
.call-info-section {
  flex: 1;
  background: linear-gradient(
    135deg,
    #0f2e2a 0%,
    #041a17 100%
  );
  border-radius: 16px;
  padding: 12px 14px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.call-info-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.call-info-section.calling {
  animation: callPulse 1s ease-in-out 3;
}

@keyframes callPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 193, 7, 0.5);
  }
}

.call-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-light);
  opacity: 0.95;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.call-header i {
  font-size: 1.4rem;
  animation: bounce 2s infinite;
}

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

#nama-dipanggil {
  background: rgba(255, 255, 255, 0.18);
  padding: 10px 12px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 0;
}

#nama-panggilan {
  font-size: 2.4rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4);
  line-height: 1.25;
  letter-spacing: 1px;
  word-wrap: break-word;
}

#deskPangil {
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  text-align: center;
}

/* Slideshow Section */
.slideshow-section {
  flex: 1;
  background: #2c3e50;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  position: relative;
}

.slideshow-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fade {
  animation: fadeEffect 1s;
}

@keyframes fadeEffect {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

/* Added slide counter styling */
.slide-counter {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.slide-counter span {
  font-weight: 700;
}

/* ===== COLUMNS 2-4: QUEUE DISPLAYS ===== */
.col-queue {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.col-queue:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
}

.queue-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: var(--text-light);
  padding: 22px 20px;
  text-align: center;
}

#belum_non_racikan .queue-header {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

#belum_racikan .queue-header {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

#dilayani .queue-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

#selesai .queue-header {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.queue-number {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 2px;
}

.queue-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.queue-title i {
  font-size: 1.3rem;
}

.queue-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #fafafa;
}

/* Custom Scrollbar */
.queue-content::-webkit-scrollbar {
  width: 8px;
}

.queue-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.queue-content::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 4px;
}

.queue-content::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* ===== QUEUE ITEMS ===== */
.queue-item {
  background: #ffffff;
  padding: 16px 18px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--primary-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.01);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInItem 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
}

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

.queue-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

#belum_non_racikan .queue-item {
  border-left-color: #0d9488;
  background: linear-gradient(90deg, #f0fdfa 0%, #ffffff 100%);
}

#belum_racikan .queue-item {
  border-left-color: #d97706;
  background: linear-gradient(90deg, #fffbeb 0%, #ffffff 100%);
}

#dilayani .queue-item {
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%);
}

#selesai .queue-item {
  border-left-color: #10b981;
  background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 100%);
}

.queue-item.cito {
  border-left-width: 8px;
  border-left-color: var(--danger-color) !important;
  background: linear-gradient(90deg, #ffebee 0%, #fff 100%) !important;
  animation: criticalPulse 2s ease-in-out infinite;
  position: relative;
}

.queue-item.cito::before {
  content: "CITO";
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--danger-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
}

@keyframes criticalPulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
  }
  50% {
    opacity: 0.9;
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.4);
  }
}

.patient-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.patient-origin {
  font-size: 0.9rem;
  color: #616161;
  margin-bottom: 6px;
  font-weight: 500;
}

.patient-time {
  font-size: 0.85rem;
  color: #9e9e9e;
  margin-bottom: 8px;
}

.patient-badge {
  margin-top: 8px;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.badge-racikan {
  background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
  color: white;
}

.badge-non-racikan {
  background: linear-gradient(135deg, var(--success-color) 0%, #388e3c 100%);
  color: white;
}

.badge i {
  font-size: 0.85rem;
}

/* ===== RUNNING TEXT ===== */
#running-text-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: var(--text-light);
  padding: 12px 0;
  overflow: hidden;
  height: 45px;
  display: flex;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 99;
}

#running-text {
  white-space: nowrap;
  animation: marquee 25s linear infinite;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

#running-text i {
  margin-right: 10px;
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1600px) {
  .main-container {
    grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr;
  }

  .queue-number {
    font-size: 2.5rem;
  }

  #nama-panggilan {
    font-size: 1.7rem;
  }
}

@media (max-width: 1366px) {
  .facility-name {
    font-size: 1.5rem;
  }

  .logo-container {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .main-container {
    grid-template-columns: 1.1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }

  .queue-number {
    font-size: 2rem;
  }

  .queue-title {
    font-size: 0.95rem;
    gap: 6px;
  }
}

@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    height: calc(100vh - 180px);
  }

  .col-1 {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .video-section,
  .call-info-section,
  .slideshow-section {
    flex: 1;
  }
}

@media (max-width: 768px) {
  body {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
    padding-bottom: 55px;
  }

  .main-header {
    flex-direction: column;
    gap: 10px;
    padding: 12px 15px;
    text-align: center;
  }

  .header-left {
    flex-direction: column;
    gap: 10px;
  }

  .header-right {
    align-items: center;
  }

  #digital-clock {
    text-align: center;
  }

  .main-container {
    grid-template-columns: 1fr !important;
    height: auto !important;
    gap: 15px;
    padding: 10px;
  }

  .col-1 {
    flex-direction: column;
  }

  .col-queue {
    min-height: 280px;
  }

  .queue-header {
    padding: 15px;
  }

  .queue-number {
    font-size: 2.5rem;
  }

  #running-text {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .facility-name {
    font-size: 1.4rem;
  }

  .logo-container {
    width: 55px;
    height: 55px;
  }

  .queue-number {
    font-size: 2rem;
  }

  .queue-title {
    font-size: 0.9rem;
  }

  #nama-panggilan {
    font-size: 1.6rem;
  }

  .video-section {
    min-height: 180px;
  }
}

/* ===== UTILITY ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.animate-in {
  animation: slideIn 0.5s ease-out;
}

/* Adding Print specific styles */
@media print {
  .main-header,
  .kiosk-container {
    display: none !important;
  }
  body {
    background: white;
    height: auto;
    overflow: visible;
  }
}
/* Styles for Kiosk elements that might be shared */
.kiosk-mode .main-container {
  display: none;
}

/* ===== DYNAMIC "ALIVE" ANIMATIONS ===== */
.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  box-shadow: 0 0 8px #10b981;
  animation: livePulse 1.8s infinite ease-in-out;
}

@keyframes livePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 4px #10b981;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.4;
    box-shadow: 0 0 14px #10b981;
  }
}

/* Shimmer Scanning effect for active call info */
.call-info-section::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 45%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 55%
  );
  transform: rotate(45deg);
  animation: shimmerScan 6s infinite linear;
  pointer-events: none;
}

@keyframes shimmerScan {
  0% {
    transform: translate(-30%, -30%) rotate(45deg);
  }
  100% {
    transform: translate(30%, 30%) rotate(45deg);
  }
}

/* Smooth moving gradient background for Header */
.main-header {
  background-size: 200% 200% !important;
  animation: headerGradient 15s ease infinite !important;
}

@keyframes headerGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Hover lift and glow effects for queue lists */
.queue-item:hover {
  transform: translateY(-4px) scale(1.01) !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05) !important;
}
