@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  --primary: #0E7C7B;       /* Muted clinical teal */
  --primary-dark: #095352;
  --success: #0E7C7B;       /* Teal for success/clinical comfort */
  --warning: #B45309;       /* Warm alert amber */
  --danger: #B42318;        /* Soft crimson red */
  --bg: #F7F6F3;            /* Clean, calm clinical off-white paper background */
  --card-bg: #FFFFFF;       /* Pure clean white cards */
  --text-primary: #16213A;  /* Professional ink navy text color */
  --text-secondary: #4A5568;/* Subdued slate gray for lower priority info */
  --border: #CBD5E1;        /* Solid gray divider */
  --paused-bg: #FEF3C7;     /* Warm amber warning gold bg */
  --paused-border: #B45309;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  
  --shadow-sm: 0 1px 2px 0 rgba(22, 33, 58, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(22, 33, 58, 0.05), 0 2px 4px -2px rgba(22, 33, 58, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(22, 33, 58, 0.04), 0 4px 6px -4px rgba(22, 33, 58, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(22, 33, 58, 0.05), 0 8px 10px -6px rgba(22, 33, 58, 0.03);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg) !important;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Specific Clean Layout overrides to prevent mint-greening */
.bg-white {
  background-color: var(--card-bg) !important;
}
.bg-slate-50 {
  background-color: #F8FAFC !important;
}
.bg-slate-100 {
  background-color: #F1F5F9 !important;
}
.hover\:bg-slate-50:hover {
  background-color: #F8FAFC !important;
}
.hover\:bg-slate-100:hover {
  background-color: #F1F5F9 !important;
}
.border-slate-100 {
  border-color: #E2E8F0 !important;
}
.border-slate-200 {
  border-color: #CBD5E1 !important;
}

/* Beautiful clinical ticket structure */
.ticket-stub {
  position: relative;
  background: #ffffff !important;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ticket-stub::before, .ticket-stub::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--bg) !important;
  border-radius: 50%;
  transform: translateY(-50%);
  border: 1px solid #CBD5E1;
  z-index: 10;
}
.ticket-stub::before {
  left: -9px;
}
.ticket-stub::after {
  right: -9px;
}
.ticket-perforation {
  border-top: 1.5px dashed #CBD5E1;
  margin: 0.75rem 0;
  position: relative;
}


/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

.mono-text {
  font-family: var(--font-mono);
}

/* Interactive elements */
input, button, select, textarea {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animations */

/* Spring-like cubic bezier transition */
.transition-spring {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pulse animation for active banners */
@keyframes pulse-banner {
  0%, 100% {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 4px 12px 0 rgba(37, 99, 235, 0.04), 0 0 0 2px rgba(37, 99, 235, 0.05);
  }
  50% {
    border-color: rgba(37, 99, 235, 0.7);
    box-shadow: 0 8px 24px 6px rgba(37, 99, 235, 0.12), 0 0 0 4px rgba(37, 99, 235, 0.1);
  }
}

.pulse-primary-banner {
  animation: pulse-banner 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Soft breathing pulse for emerald/active consult rooms */
@keyframes heart-pulse-emerald {
  0%, 100% {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 12px 0 rgba(16, 185, 129, 0.04);
  }
  50% {
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 8px 20px 4px rgba(16, 185, 129, 0.14);
  }
}

.pulse-emerald-banner {
  animation: heart-pulse-emerald 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Metric update flash animation */
@keyframes metric-flash {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  25% {
    transform: scale(1.15);
    filter: brightness(1.3);
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
    text-shadow: none;
  }
}

.animate-metric-flash {
  animation: metric-flash 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Smooth fade-up for newly rendered cards */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-fade-up {
  animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Premium micro-spring interactive buttons */
.btn-premium {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.2);
}

.btn-premium:active {
  transform: translateY(1px) scale(0.98);
}

/* Shake animation for incorrect inputs */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-input {
  animation: shake 0.5s ease-in-out;
  border-color: var(--danger) !important;
}

/* Slide in animation for toast notifications */
@keyframes slide-in {
  from {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.toast-slide {
  animation: slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sleek Custom Toggle Switches */
.switch-container {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.switch-input {
  display: none;
}

.switch-rail {
  position: relative;
  width: 44px;
  height: 22px;
  background-color: #475569; /* Slate-600 */
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch-input:checked + .switch-rail {
  background-color: var(--primary);
}

.switch-input:checked + .switch-rail .switch-knob {
  transform: translateX(22px);
}

/* Sleek Status Badges */
.badge-waiting {
  background-color: #fef3c7; /* Amber bg */
  color: #b45309;            /* Amber active text */
  border: 1px solid #fde68a;
}

.badge-current {
  background-color: #dbeafe; /* Light Blue bg */
  color: #1d4ed8;            /* Blue active text */
  border: 1px solid #bfdbfe;
}

.badge-done {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-noshowed {
  background-color: #ffe4e6;
  color: #b91c1c;
  border: 1px solid #fecdd3;
  text-decoration: line-through;
}

.badge-pending-pay {
  background-color: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-paid {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* Countdown Digital Clock Display */
.countdown-clock {
  font-family: var(--font-mono);
  background: #0f172a;
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  border: 2px solid #1e293b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.05em;
  display: inline-flex;
  font-size: 2.25rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

/* Paused banner style */
.paused-banner {
  background-color: var(--paused-bg);
  border: 1px solid var(--paused-border);
  color: #92400e;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  width: calc(100vw - 3rem);
}

/* Clean, custom styling for individual toasts */
.toast {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  border: 1px solid transparent;
}

.toast-success {
  background-color: #065f46;
  border-color: #047857;
}

.toast-error {
  background-color: #991b1b;
  border-color: #b91c1c;
}

.toast-info {
  background-color: #1e3a8a;
  border-color: #1d4ed8;
}

.toast-warning {
  background-color: #92400e;
  border-color: #b45309;
}

/* Custom Scrollbar for list container */
.scroll-container::-webkit-scrollbar {
  width: 6px;
}

.scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-container::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.4);
  border-radius: 4px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.6);
}

/* Smooth custom scale transitions for action elements */
button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
