@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

:root {
  --color-primary-dark: #0f172a; /* Slate 900 */
  --color-primary: #1e3a8a; /* Blue 900 */
  --color-secondary: #0ea5e9; /* Sky 500 */
  --color-accent: #38bdf8; /* Sky 400 */
  font-family: 'Sarabun', sans-serif;
}

body {
  font-family: 'Sarabun', sans-serif;
  scroll-behavior: smooth;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 1);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.8);
}

/* Glassmorphism utility */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-panel {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseWarning {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.5)); }
  50% { transform: scale(1.02); filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.9)); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.pulse-critical {
  animation: pulseWarning 1.5s infinite;
}

/* Blood Pressure meter indicators */
.bp-bar {
  height: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

/* Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt !important;
  }
  
  /* Hide interactive / web components */
  .no-print, 
  header, 
  footer, 
  nav, 
  button, 
  .toast-container,
  #db-status-bar,
  .map-container,
  .qrcode-scanner-wrapper,
  .image-uploader-wrapper,
  .action-buttons,
  #theme-toggle {
    display: none !important;
  }

  /* Make sure printing content occupies full page width */
  .print-full {
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  .print-page-break {
    page-break-after: always;
  }

  /* Title structure formatting */
  .print-title {
    text-align: center;
    font-size: 18pt !important;
    font-weight: bold;
    margin-bottom: 20px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
  }

  .print-section {
    margin-bottom: 15px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 10px;
  }

  .print-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .print-sign-area {
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
  }

  .print-sign-box {
    text-align: center;
    width: 200px;
    border-top: 1px solid #000;
    padding-top: 5px;
  }
}

/* Custom dark mode settings */
.dark-theme-toggle {
  position: relative;
  width: 48px;
  height: 24px;
  background-color: #cbd5e1;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dark .dark-theme-toggle {
  background-color: #3b82f6;
}

.dark-theme-toggle-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.2s;
}

.dark .dark-theme-toggle-dot {
  transform: translateX(24px);
}
