/* ==========================================================================
   TEMA MEDIS DIGITAL TWIN - LIGHT GLASSMORHPISM & COLORFUL PALETTE
   ========================================================================== */

:root {
  --primary: #0284c7;
  --primary-light: #38bdf8;
  --secondary: #059669;
  --danger: #e11d48;
  --warning: #d97706;
  --purple: #7c3aed;
  
  --bg-canvas: #f8fafc;
  --surface-card: rgba(255, 255, 255, 0.75);
  --border-glass: rgba(255, 255, 255, 0.85);
  --border-subtle: rgba(226, 232, 240, 0.8);
  
  --liquid-color: #06b6d4;
  --liquid-glow: rgba(6, 182, 212, 0.4);
}

/* Latar Belakang Terang dengan Ambient Mesh Gradients Berwarna-warni */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.18) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(52, 211, 153, 0.18) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(251, 113, 133, 0.14) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(167, 139, 250, 0.16) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(244, 244, 245, 0.8) 0px, transparent 100%);
  background-attachment: fixed;
  color: #1e293b;
  min-height: 100vh;
}

/* ==========================================================================
   GLASSMORHPISM CARDS & NAVIGATION
   ========================================================================== */
.glass-card {
  background: var(--surface-card) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: 1.25rem !important;
  box-shadow: 
    0 10px 25px -5px rgba(15, 23, 42, 0.04), 
    0 20px 30px -10px rgba(14, 165, 233, 0.05),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.9) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card:hover {
  box-shadow: 
    0 15px 30px -5px rgba(15, 23, 42, 0.06), 
    0 25px 35px -10px rgba(14, 165, 233, 0.08),
    inset 0 1px 1px 0 rgba(255, 255, 255, 1) !important;
}

.glass-nav {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85) !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03) !important;
}

/* ==========================================================================
   KARTU METRIK BERWARNA-WARNI (COLORFUL VIBRANT METRIC CARDS)
   ========================================================================== */
.metric-card-glucose {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 249, 255, 0.85) 100%) !important;
  border: 1.5px solid rgba(56, 189, 248, 0.3) !important;
}
.metric-card-glucose:hover {
  border-color: rgba(14, 165, 233, 0.6) !important;
}

.metric-card-spo2 {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(236, 253, 245, 0.85) 100%) !important;
  border: 1.5px solid rgba(52, 211, 153, 0.3) !important;
}
.metric-card-spo2:hover {
  border-color: rgba(16, 185, 129, 0.6) !important;
}

.metric-card-bpm {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 241, 242, 0.85) 100%) !important;
  border: 1.5px solid rgba(251, 113, 133, 0.3) !important;
}
.metric-card-bpm:hover {
  border-color: rgba(244, 63, 94, 0.6) !important;
}

.metric-card-pi {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 243, 255, 0.85) 100%) !important;
  border: 1.5px solid rgba(167, 139, 250, 0.3) !important;
}
.metric-card-pi:hover {
  border-color: rgba(139, 92, 246, 0.6) !important;
}

/* ==========================================================================
   ANIMASI GELAS UKUR LABORATORIUM (LAB FLASK & BUBBLING FLUID)
   ========================================================================== */
.lab-beaker-container {
  position: relative;
  width: 220px;
  height: 280px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  filter: drop-shadow(0 15px 25px rgba(2, 132, 199, 0.15));
}

/* Tabung Erlenmeyer Kristal */
.lab-flask {
  position: relative;
  width: 190px;
  height: 250px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(240, 249, 255, 0.4) 100%);
  border: 3px solid rgba(14, 165, 233, 0.45);
  border-radius: 12px 12px 35px 35px;
  clip-path: polygon(
    38% 0%, 62% 0%,       /* Bibir tabung atas */
    62% 25%, 95% 85%,     /* Leher ke badan bawah kanan */
    90% 100%, 10% 100%,   /* Dasar tabung */
    5% 85%, 38% 25%       /* Badan kiri ke leher */
  );
  overflow: hidden;
  box-shadow: 
    inset 0 0 25px rgba(255, 255, 255, 0.9), 
    inset 0 0 10px rgba(14, 165, 233, 0.2), 
    0 10px 25px rgba(2, 132, 199, 0.12);
}

/* Garis Skala Pengukuran mg/dL */
.flask-markings {
  position: absolute;
  top: 30%;
  left: 18%;
  right: 18%;
  bottom: 12%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 15;
  opacity: 0.85;
}

.mark-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #0369a1;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.mark-line::before {
  content: '';
  width: 14px;
  height: 2px;
  background: #0284c7;
  border-radius: 1px;
}

/* Fluida Cairan Kimia Berpendar */
.flask-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55%; /* Dinamis via JS */
  background: linear-gradient(180deg, var(--liquid-color) 0%, rgba(2, 132, 199, 0.85) 100%);
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1), background 0.8s ease;
  box-shadow: 0 -4px 25px var(--liquid-glow);
}

/* Gelombang Permukaan Cairan */
.liquid-wave {
  position: absolute;
  top: -12px;
  left: 0;
  width: 200%;
  height: 24px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  animation: waveMotion 3s linear infinite;
}

@keyframes waveMotion {
  0% { transform: translateX(0); }
  50% { transform: translateX(-25%); }
  100% { transform: translateX(0); }
}

/* Kilauan Kaca Kristal Laboratorium */
.flask-reflection {
  position: absolute;
  top: 5%;
  left: 14%;
  width: 12px;
  height: 80%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-radius: 6px;
  filter: blur(1.5px);
  pointer-events: none;
  z-index: 20;
}

/* Gelembung Reaksi Laboratorium Berkilau (Iridescent Rising Bubbles) */
.bubble-chamber {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.lab-bubble {
  position: absolute;
  bottom: 0;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.6) 40%, rgba(56, 189, 248, 0.8) 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9), inset 0 0 4px rgba(255, 255, 255, 0.8);
  animation: riseUp 2.6s infinite ease-in;
}

@keyframes riseUp {
  0% {
    transform: translateY(0) scale(0.4) translateX(0);
    opacity: 0;
  }
  20% {
    opacity: 0.95;
  }
  70% {
    transform: translateY(-160px) scale(1) translateX(6px);
    opacity: 0.85;
  }
  95% {
    transform: translateY(-210px) scale(1.15) translateX(-4px);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-225px) scale(1.3);
    opacity: 0;
  }
}

.b-1 { left: 25%; width: 12px; height: 12px; animation-delay: 0.2s; animation-duration: 2.4s; }
.b-2 { left: 45%; width: 18px; height: 18px; animation-delay: 0.8s; animation-duration: 3.1s; }
.b-3 { left: 65%; width: 10px; height: 10px; animation-delay: 1.4s; animation-duration: 2.1s; }
.b-4 { left: 35%; width: 15px; height: 15px; animation-delay: 2.0s; animation-duration: 2.7s; }
.b-5 { left: 55%; width: 9px; height: 9px; animation-delay: 2.5s; animation-duration: 1.9s; }
.b-6 { left: 75%; width: 14px; height: 14px; animation-delay: 1.1s; animation-duration: 2.6s; }

/* Efek Uap / Vapor dari Leher Gelas */
.flask-vapor {
  position: absolute;
  top: 5px;
  left: 45%;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.6), transparent 70%);
  filter: blur(5px);
  border-radius: 50%;
  animation: vaporDisperse 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes vaporDisperse {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  40% { opacity: 0.7; }
  100% { transform: translateY(-45px) scale(2.2); opacity: 0; }
}

/* ==========================================================================
   ANIMASI DETAK JANTUNG (ECG PULSE WAVE & BEATING HEART)
   ========================================================================== */
.heart-beat-active {
  animation: heartPulse 0.8s ease-in-out infinite;
  transform-origin: center;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  14% { transform: scale(1.25); filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.7)); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.4)); }
  70% { transform: scale(1); }
}

/* Glow Pulsa Status Online */
.pulse-online {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   STATUS BADGE BERWARNA CERAH (VIBRANT MEDICAL BADGES)
   ========================================================================== */
.badge-normal {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #065f46 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  font-weight: 700 !important;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #92400e !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  font-weight: 700 !important;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #991b1b !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  font-weight: 700 !important;
}

.badge-info {
  background: rgba(14, 165, 233, 0.15) !important;
  color: #075985 !important;
  border: 1px solid rgba(14, 165, 233, 0.4) !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   INPUTS & FORM CONTROLS GLASSMORHPISM
   ========================================================================== */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1.5px solid rgba(203, 213, 225, 0.8) !important;
  color: #0f172a !important;
  border-radius: 0.75rem !important;
  transition: all 0.2s ease !important;
}

input:focus, select:focus, textarea:focus {
  background: #ffffff !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15) !important;
  outline: none !important;
}

/* Tabel Glassmorphism */
table thead {
  background: rgba(241, 245, 249, 0.8) !important;
  color: #475569 !important;
}

table tbody tr {
  transition: background-color 0.2s ease;
}

table tbody tr:hover {
  background: rgba(240, 249, 255, 0.7) !important;
}

/* Print Friendly */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .glass-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    color: #000000 !important;
  }
}
