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

:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* 60% Dominant */
  --bg-dominant: #f8fafc;
  --surface-dominant: rgba(255, 255, 255, 0.85);
  
  /* 30% Secondary */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-subtle: #e2e8f0;
  --sidebar-bg: #ffffff;
  
  /* 10% Accent */
  --accent-primary: #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #f0fdf4;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dominant);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ensure buttons & links receive pointer events directly */
a, button {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* ==========================================================================
   LIGHT PROFESSIONAL GLASSMORPHISM APPLICATION SPLASH SCREEN
   ========================================================================== */

#app-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#app-splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 2rem;
  padding: 2.5rem 3rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  text-align: center;
}

.splash-logo-pulse {
  animation: splashPulse 1.6s infinite ease-in-out;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 25px rgba(13, 148, 136, 0.3); }
  50% { transform: scale(1.06); box-shadow: 0 15px 35px rgba(13, 148, 136, 0.45); }
}

.splash-progress-track {
  width: 160px;
  height: 5px;
  background: rgba(226, 232, 240, 0.8);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin: 1.25rem auto 0 auto;
}

.splash-progress-fill {
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #10b981, #0d9488);
  background-size: 200% 100%;
  border-radius: 999px;
  animation: splashFill 1.4s infinite ease-in-out;
}

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

/* Premium Card Utilities */
.card-premium {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease-in-out;
}

.card-premium:hover {
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sidebar Navigation Styling */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.nav-link:hover {
  background-color: #f1f5f9;
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid rgba(13, 148, 136, 0.2);
}

.nav-link i {
  font-size: 1.1rem;
}

/* Mobile Drawer Backdrop */
#mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#mobile-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

#mobile-sidebar-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 17.5rem;
  background: #ffffff;
  z-index: 99999;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}

#mobile-sidebar-drawer.active {
  transform: translateX(0);
}

/* Mobile Fixed Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 9999;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  flex: 1;
  height: 100%;
}

.mobile-nav-item i {
  font-size: 1.15rem;
}

.mobile-nav-item.active {
  color: var(--accent-primary);
  font-weight: 800;
}

/* ==========================================================================
   GLOBAL MOBILE RESPONSIVE OPTIMIZATIONS ACROSS ALL PAGES
   ========================================================================== */

@media (max-width: 767px) {
  /* Prevent content clipping behind bottom navigation bar */
  main {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-bottom: 7.5rem !important;
  }

  /* Make tables horizontally touch-scrollable without clipping card containers */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }

  /* Prevent auto-zoom on iOS Safari on input focus */
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Action Bar Button Stacking */
  .flex-wrap.items-center {
    width: 100% !important;
  }

  .flex-wrap.items-center > a,
  .flex-wrap.items-center > button {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Modal Dialog Responsiveness */
  .modal-container > div {
    width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 1.25rem !important;
    margin: 0.5rem !important;
  }
}

/* Printable Views */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .printable-document {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
  }
}
