/* ==========================================================================
   LUNGSUKH Global Design System — Enterprise Pulmonology Platform
   Light Mode (Untouched) + Ultra-Premium True-Black Dark Mode
   ========================================================================== */

:root {
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-main: #0F172A;
  --color-muted: #64748B;
  --color-border: #E2E8F0;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(226, 232, 240, 0.8);
  --glass-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   ULTRA-PREMIUM TRUE-BLACK DARK MODE (OLED Zinc-950 & Charcoal Surfaces)
   ========================================================================== */
.dark,
[data-theme="dark"] {
  --color-bg: #08080a; /* True OLED deep black canvas */
  --color-surface: #121215; /* Refined charcoal primary card surface */
  --color-surface-subtle: #17171c; /* Elevated sub-panels & nested elements */
  --color-surface-elevated: #1c1c22; /* High-elevation dropdowns, modaled popovers */
  --color-main: #f8fafc; /* Crisp, high-contrast headings */
  --color-body: #d4d4d8; /* Soft readable off-white body text */
  --color-muted: #94a3b8; /* Refined muted text */
  --color-border: rgba(255, 255, 255, 0.08); /* Hairline micro-border */
  --glass-bg: rgba(18, 18, 22, 0.88);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.95);
}

/* Base Body Styles */
body {
  background-color: var(--color-bg);
  color: var(--color-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

.dark body {
  background-color: #08080a;
  color: #d4d4d8;
}

/* ==========================================================================
   DARK MODE CARDS, PANELS & INNER SHEEN MICRO-HIGHLIGHTS
   ========================================================================== */
.dark .glass-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 12px 32px -8px rgba(0, 0, 0, 0.75);
}

.dark .glass-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.12), 0 20px 45px -10px rgba(0, 0, 0, 0.85);
}

.dark .card-3d-glow:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15), 0 24px 50px -10px rgba(0, 0, 0, 0.9), 0 0 30px -5px rgba(2, 132, 199, 0.25);
  border-color: rgba(56, 189, 248, 0.45);
}

/* Dark Mode Logo Badges */
.dark .splash-logo-card,
.dark .logo-sidebar-card,
.dark .logo-auth-card,
.dark .logo-footer-card {
  background: #141418 !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.8) !important;
}

/* ==========================================================================
   DARK MODE FORM CONTROLS (INPUTS, SELECTS, TEXTAREAS)
   ========================================================================== */
.dark input,
.dark select,
.dark textarea {
  background-color: #131317 !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.11) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: #71717a !important;
  opacity: 1 !important;
}

.dark input:focus,
.dark select:focus,
.dark textarea:focus {
  border-color: #0284C7 !important;
  background-color: #16161c !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.28), inset 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   HEADER, NAVBAR & OVERLAYS IN DARK MODE
   ========================================================================== */
.dark header {
  background: rgba(8, 8, 10, 0.85) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.dark .nav-drawer {
  background: rgba(10, 10, 13, 0.98) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.dark .overlay-menu {
  background: rgba(8, 8, 10, 0.97) !important;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

/* ==========================================================================
   TABLES & ADMIN DATA ROWS IN DARK MODE
   ========================================================================== */
.dark table {
  border-color: rgba(255, 255, 255, 0.08);
}

.dark tr {
  border-color: rgba(255, 255, 255, 0.06);
  transition: background-color 0.15s ease;
}

.dark tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.025);
}

/* ==========================================================================
   CUSTOM DARK SCROLLBARS
   ========================================================================== */
.dark ::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.dark ::-webkit-scrollbar-track {
  background: #08080a;
}

.dark ::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 9999px;
  border: 2px solid #08080a;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* ==========================================================================
   SPLASH INTRO SCREEN LOADER
   ========================================================================== */
#splashScreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #08080a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#splashScreen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-logo-card {
  background: #FFFFFF;
  padding: 1rem 1.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px rgba(2, 132, 199, 0.3);
}

.progress-bar-fill {
  transition: width 0.1s linear;
}

/* ==========================================================================
   GLASSMORPHISM & 3D SURFACE CARDS (SHARED LIGHT/DARK FRAMEWORK)
   ========================================================================== */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--glass-border);
}

.glass-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-3d-glow:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 25px 45px -10px rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
}

/* Highlighted Homepage Appointment Booking Widget */
.highlight-appt-card {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(2, 132, 199, 0.08) 100%);
  border: 2px solid rgba(2, 132, 199, 0.35) !important;
}

/* Sidebar Navigation Drawer Highlighted Login CTAs */
.btn-patient-login-cta {
  background: linear-gradient(135deg, #0284C7 0%, #059669 100%);
  color: #FFFFFF !important;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-patient-login-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(2, 132, 199, 0.6);
}

.btn-admin-login-cta {
  background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
  color: #FFFFFF !important;
  box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-admin-login-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(217, 119, 6, 0.6);
}

/* Page Section Display Isolation (Prevents multi-page overlaps) */
.page-view {
  display: none !important;
}

.page-view.active {
  display: block !important;
}

.page-auth-centered.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 5rem);
  padding: 2rem 1rem;
}

/* Floating Badges & Animations */
.badge-3d-float {
  animation: badgeFloat 4s ease-in-out infinite;
}

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

/* 3D HERO FLOATING CARD ANIMATIONS */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes floatSlowDelayed {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(-1deg); }
}

.animate-float {
  animation: floatSlow 5s ease-in-out infinite;
}

.animate-float-delayed {
  animation: floatSlowDelayed 6s ease-in-out infinite 1.5s;
}

.perspective-1000 {
  perspective: 1000px;
}

/* INFINITE AUTO-SLIDING RIGHT-TO-LEFT MARQUEE CAROUSEL */
.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: infiniteSlideLeft 35s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

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

.slide-photo-card {
  flex-shrink: 0;
  width: 280px;
  height: 200px;
  border-radius: 1.25rem;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(2, 132, 199, 0.3);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

@media (min-width: 640px) {
  .slide-photo-card {
    width: 340px;
    height: 230px;
  }
}

.slide-photo-card:hover {
  transform: scale(1.03);
  border-color: #0284C7;
}

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

/* Sidebar Drawer */
.nav-drawer {
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  background: #FFFFFF;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 100;
}

.nav-drawer.open {
  transform: translateX(0);
}

/* Logo Cards */
.logo-sidebar-card, .logo-auth-card, .logo-footer-card {
  background: #FFFFFF;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  display: inline-block;
}

.logo-header {
  height: 2.75rem;
  object-fit: contain;
}

.logo-sidebar {
  height: 2.5rem;
  object-fit: contain;
}

.logo-auth {
  height: 3rem;
  object-fit: contain;
}

.logo-footer {
  height: 2.25rem;
  object-fit: contain;
}

/* Custom Toast & Live Process Notification Container */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
  max-width: calc(100vw - 3rem);
}

.toast {
  pointer-events: auto;
  padding: 0.85rem 1.35rem;
  border-radius: 1.15rem;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.35);
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.toast-info { background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%); color: white; }
.toast-success { background: linear-gradient(135deg, #059669 0%, #047857 100%); color: white; }
.toast-error { background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%); color: white; }
.toast-warning { background: linear-gradient(135deg, #D97706 0%, #B45309 100%); color: white; }

/* Bottom-Left Live Process & Upload Progress Card */
.live-process-card {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--color-surface);
  color: var(--color-main);
  border: 2px solid #0284c7;
  border-radius: 1.25rem;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.45);
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Lightbox Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-card, .forgot-modal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 2rem;
  padding: 1.25rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.7);
  position: relative;
}

.lightbox-card {
  max-width: 860px;
}

.shake-card {
  animation: cardShake 0.4s ease;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.input-error {
  border-color: #EF4444 !important;
}

.gradient-text-shifting {
  background: linear-gradient(90deg, #0284C7, #059669, #D97706, #0284C7);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite;
}

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

/* FULL-SCREEN CREATIVE OVERLAY MENU STYLING */
.overlay-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 13, 14, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.overlay-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.overlay-menu-content {
  transform: translateY(20px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay-menu.open .overlay-menu-content {
  transform: translateY(0) scale(1);
}

/* CINEMATIC 1.5-SECOND HERO INTRO ENTRANCE ANIMATION */
.hero-intro-anim {
  animation: heroIntroReveal 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroIntroReveal {
  0% { opacity: 0; transform: translateY(25px) scale(0.97); }
  60% { opacity: 0.8; transform: translateY(-3px) scale(1.005); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   HORIZONTAL EDITORIAL PHOTO SCROLLING STRIP (INFINITE MARQUEE)
   ========================================================================== */
.marquee-container {
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: 1.75rem;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.marquee-container::-webkit-scrollbar {
  display: none;
}

.marquee-track {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 0;
  width: max-content;
  animation: marqueeAutoScroll 42s linear infinite;
  will-change: transform;
}

.marquee-container:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeAutoScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.slide-photo-card {
  flex-shrink: 0;
  width: 290px;
  height: 205px;
  border-radius: 1.35rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  background-color: var(--color-surface);
}

@media (min-width: 640px) {
  .slide-photo-card {
    width: 330px;
    height: 225px;
  }
}

.slide-photo-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: #059669;
  box-shadow: 0 22px 38px -8px rgba(5, 150, 105, 0.25);
}

.slide-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.slide-photo-card:hover .slide-photo-img {
  transform: scale(1.08);
}

/* ==========================================================================
   MENU TOGGLE BUTTON (3-LINES) & RESPIRATORY CTA BANNER ADAPTIVE STYLES
   ========================================================================== */
#leftMenuBtn {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

#leftMenuBtn:hover {
  background-color: #f8fafc !important;
}

.dark #leftMenuBtn {
  background-color: #121215 !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dark #leftMenuBtn:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.respiratory-cta-card {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08) !important;
}

.dark .respiratory-cta-card {
  background-color: #070709 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.95) !important;
}

/* ==========================================================================
   CROSS-DEVICE ULTRA-RESPONSIVE SYSTEM (Mobile, Tablet, Laptop, 4K Displays)
   ========================================================================== */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Fluid responsive container scaling */
.page-view {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Mobile Screen Adjustments (<= 640px) */
@media (max-width: 640px) {
  header .max-w-7xl {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .logo-header-brand img {
    max-height: 2.5rem !important;
  }

  .glass-card {
    border-radius: 1.25rem !important;
  }

  input, select, textarea, button {
    font-size: 13px !important;
  }
}

/* Tablet Screen Adjustments (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .logo-header-brand img {
    max-height: 3rem !important;
  }

  .page-view {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Laptop & Desktop Screen Adjustments (>= 1025px) */
@media (min-width: 1025px) {
  .logo-header-brand img {
    max-height: 3.5rem !important;
  }
}

/* Smooth Touch Scrolling on iOS / Android */
.nav-drawer, .overlay-menu, #publicFeedbackGrid, #adminFeedbackList {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ==========================================================================
   MOBILE & CROSS-DEVICE AUDIT HARDENING (360px - 1024px+, iOS SAFARI)
   ========================================================================== */
html, body {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

/* Touch Targets: Minimum 44px height for all interactive buttons and inputs */
@media (max-width: 768px) {
  button, a.btn, input[type="text"], input[type="tel"], input[type="number"], input[type="date"], select {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Prevent WhatsApp button from blocking bottom form submit buttons on short mobile viewports */
  .fixed.bottom-6.right-6 {
    bottom: 1.25rem !important;
    right: 1.25rem !important;
    z-index: 45 !important;
  }
}



