/**
 * CureNep — Responsive Design System
 * Fluid typography · Consistent spacing · Container system · All viewports
 */

/* =========================================================================
   1. RESET & BASE
   ========================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  overflow-x: clip;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================================================
   2. CONTAINER SYSTEM
   ========================================================================= */
.dn-container {
  width: min(100% - clamp(1.5rem, 4vw, 3rem), 1280px);
  margin-inline: auto;
}

.dn-container-narrow {
  width: min(100% - clamp(1.5rem, 4vw, 3rem), 800px);
  margin-inline: auto;
}

/* =========================================================================
   3. FLUID SECTION SPACING
   ========================================================================= */
.dn-section {
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.dn-section-sm {
  padding-block: clamp(1.5rem, 4vw, 3rem);
}

.dn-section-hero {
  padding-block: clamp(2rem, 5vw, 4rem);
}

/* =========================================================================
   4. FLUID TYPOGRAPHY
   ========================================================================= */
.dn-h1 {
  font-size: clamp(1.625rem, 3.5vw + 0.5rem, 3.25rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.dn-h2 {
  font-size: clamp(1.25rem, 2.5vw + 0.25rem, 2rem);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.015em;
}

.dn-h3 {
  font-size: clamp(1rem, 1.5vw + 0.25rem, 1.25rem);
  line-height: 1.3;
  font-weight: 800;
}

.dn-body {
  font-size: clamp(0.8125rem, 1vw + 0.25rem, 1rem);
  line-height: 1.7;
}

.dn-small {
  font-size: clamp(0.6875rem, 0.5vw + 0.375rem, 0.8125rem);
  line-height: 1.5;
}

/* =========================================================================
   5. RESPONSIVE GRIDS
   ========================================================================= */
.dn-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: clamp(0.875rem, 2vw, 1.5rem);
}

.dn-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.dn-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

/* =========================================================================
   6. HERO GRID — two-column on desktop, single on mobile
   ========================================================================= */
.dn-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

@media (min-width: 1024px) {
  .dn-hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }
}

/* =========================================================================
   7. NAVBAR
   ========================================================================= */
#mainHeader {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  width: 100%;
  max-width: 100%;
}

.dn-nav-inner {
  width: min(100% - clamp(1rem, 3vw, 2.5rem), 1380px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 1.5vw, 1.25rem);
  padding-block: 0.625rem;
}

/* Dock navigation pill links */
.dn-dock-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.875rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.dn-dock-link:hover {
  background: rgba(13, 148, 136, 0.08);
  color: #0d9488;
}
.dn-dock-link--active {
  background: #0d9488 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px -1px rgba(13, 148, 136, 0.35);
}

/* Hero search bar wrapper */
.dn-hero-search {
  position: relative;
  max-width: 700px;
  width: 100%;
  margin-inline: auto;
  z-index: 20;
}

/* =========================================================================
   8. MOBILE BOTTOM NAV
   ========================================================================= */
@media (max-width: 1023px) {
  body {
    padding-bottom: 80px !important;
  }
}

#mobileBottomNav {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.bottom-nav-item.active { color: #0d9488 !important; }
.bottom-nav-item.active .nav-indicator { transform: scaleX(1) !important; opacity: 1 !important; }
.bottom-nav-item .nav-indicator { transform: scaleX(0); opacity: 0; transition: all 0.2s ease-in-out; }

/* =========================================================================
   9. GLASSMORPHISM
   ========================================================================= */
.glass-nav {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-card {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* =========================================================================
   10. BACKGROUND PATTERNS
   ========================================================================= */
.bg-medical-grid {
  background-image: radial-gradient(#e2e8f0 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

.bg-dot-pattern {
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 16px 16px;
}

/* =========================================================================
   11. CARD HOVER
   ========================================================================= */
.card-hover {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.18s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -4px rgba(13, 148, 136, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  border-color: #99f6e4;
}

/* =========================================================================
   12. ANIMATIONS
   ========================================================================= */
@keyframes whatsappPulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70%  { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.whatsapp-float-btn { animation: whatsappPulse 2.5s infinite; }

@keyframes trackerPulse {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.7); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 10px rgba(13, 148, 136, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(13, 148, 136, 0); }
}
.pulse-tracker { animation: trackerPulse 2s infinite; }

/* =========================================================================
   13. SCROLLBARS
   ========================================================================= */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* =========================================================================
   14. STEPPER
   ========================================================================= */
.stepper-line {
  height: 3px;
  flex: 1;
  background-color: #e2e8f0;
  position: relative;
}
.stepper-line.completed { background-color: #0d9488; }

/* =========================================================================
   15. UTILITY BAR
   ========================================================================= */
.dn-utility-bar {
  width: min(100% - clamp(1rem, 3vw, 2rem), 1280px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* =========================================================================
   16. FOOTER GRID
   ========================================================================= */
.dn-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 768px) {
  .dn-footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* =========================================================================
   17. SECTION HEADER ROW (title + "view all" link)
   ========================================================================= */
.dn-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

/* =========================================================================
   18. OVERFLOW GUARD
   ========================================================================= */
.dn-overflow-guard {
  max-width: 100%;
  overflow-x: clip;
}

/* =========================================================================
   18b. PROFILE PAGE SPECIFIC
   ========================================================================= */
/* Hide scrollbar on tabs bar while keeping scroll functionality */
.profile-tabs-bar::-webkit-scrollbar {
  display: none;
}
.profile-tabs-bar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Profile navigation sidebar & mobile menu transitions */
.profile-nav-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-account-row {
  min-height: 52px;
  touch-action: manipulation;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.mobile-account-row:active {
  transform: scale(0.99);
}

/* Ensure no child elements of the profile cause overflow */
#tabPane-details,
#tabPane-bookings,
#tabPane-reports,
#tabPane-medical,
#tabPane-addresses,
#tabPane-homecare,
#tabPane-doctor-appointments {
  min-width: 0;
  overflow-x: hidden;
}

/* Keep all grids within container on mobile */
@media (max-width: 640px) {
  .dn-container > * {
    min-width: 0;
    max-width: 100%;
  }
  /* Profile booking filter buttons wrap on very small screens */
  #bookingFilterGroup {
    flex-wrap: wrap;
  }
}

/* =========================================================================
   19. IMAGE UTILITIES
   ========================================================================= */
.dn-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* =========================================================================
   20. FOCUS ACCESSIBLE
   ========================================================================= */
:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}

/* =========================================================================
   21. ULTRA-WIDE / HIGH-DPI GUARD
   ========================================================================= */
@media screen and (min-width: 1600px) {
  .dn-container { max-width: 1400px; }
}
@media screen and (min-width: 1920px) {
  .dn-container { max-width: 1536px; }
}

/* =========================================================================
   22. PRINT
   ========================================================================= */
@media print {
  body * { visibility: hidden; }
  #reportPrintArea, #reportPrintArea * { visibility: visible; }
  #reportPrintArea {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 20px;
    background: white;
  }
  .no-print { display: none !important; }
}
