﻿/* ==========================================================================
   THE NURSING DOC: 3D GLASSMORPHIC & 100% MOBILE-OPTIMIZED DESIGN SYSTEM
   Curated by Dr. Aqsa S. â€¢ High-Performance Medical Architecture
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&family=Lora:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  /* Core Theme Colors */
  --bg-dark-primary: #050811;
  --bg-dark-secondary: #0A0F1D;
  --bg-dark-surface: #0F172A;
  
  /* 3D Neon Accents */
  --neon-cyan: #06B6D4;
  --neon-cyan-glow: rgba(6, 182, 212, 0.4);
  --neon-pink: #F43F5E;
  --neon-pink-glow: rgba(244, 63, 94, 0.4);
  --neon-purple: #A855F7;
  --neon-purple-glow: rgba(168, 85, 247, 0.4);
  --neon-teal: #14B8A6;
  --neon-amber: #F59E0B;
  
  /* Text Hues */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(15, 23, 42, 0.82);
  --glass-border: rgba(51, 65, 85, 0.7);
  --glass-border-hover: rgba(56, 189, 248, 0.6);
  --glass-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   GLOBAL ROOT & VIEWPORT CONTAINMENT (STRICT ZERO-OVERFLOW ENFORCEMENT)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Ensure all direct body children occupy full container width */
body > header,
body > section,
body > main,
body > footer,
body > div,
body > nav {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Global Media Containment */
img, svg, picture, video, canvas {
  max-width: 100% !important;
  height: auto;
}

/* Ambient Radial Background Mesh Glow (Containment Fixed) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 15%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 25%, rgba(168, 85, 247, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 70%, rgba(244, 63, 94, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Clinical Serif */
.font-serif-clinical {
  font-family: 'Lora', Georgia, serif;
}

/* ==========================================================================
   3D GLASSMORPHIC CARDS & ARTICLE SURFACES
   ========================================================================== */
.glass-card-3d,
.article-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(10, 15, 29, 0.95) 100%) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.glass-card-3d:hover,
.article-card:hover {
  transform: translateY(-6px) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(6, 182, 212, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* Article Card Internal Styling */
.article-card .card-title a {
  color: #F8FAFC !important;
  transition: color 0.2s ease !important;
  text-decoration: none !important;
  word-break: break-word !important;
}

.article-card:hover .card-title a {
  color: #38BDF8 !important;
}

.article-card .card-desc {
  color: #94A3B8 !important;
  word-break: break-word !important;
}

.article-card .border-t {
  border-color: rgba(51, 65, 85, 0.6) !important;
}

.article-card .text-slate-700,
.article-card .text-slate-500 {
  color: #cbd5e1 !important;
}

.article-card .bg-sky-100 {
  background-color: rgba(2, 132, 199, 0.25) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

.article-card a.text-sky-600 {
  color: #38bdf8 !important;
  font-weight: 700 !important;
  padding: 0.35rem 0.85rem !important;
  border-radius: 9999px !important;
  background: rgba(2, 132, 199, 0.15) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  transition: all 0.25s ease !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.article-card a.text-sky-600:hover {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.5) !important;
  border-color: transparent !important;
  transform: translateY(-1px) !important;
}

/* ==========================================================================
   ARTICLES GRID SYSTEM (RESPONSIVE 1-COL MOBILE, 2-COL TABLET, 3-COL DESKTOP)
   ========================================================================== */
#articles-grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
}

@media (min-width: 768px) {
  #articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  #articles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Featured Cover Banner in Article Cards (Strict 16:9 Fluid Aspect Ratio) */
.article-card-cover-link {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  position: relative !important;
  overflow: hidden !important;
  background-color: #070D1E !important;
  border-bottom: 1px solid rgba(51, 65, 85, 0.8) !important;
}

.article-card-cover-link img {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.35s ease !important;
}

.article-card-cover-link:hover img {
  transform: scale(1.05) !important;
}

/* In-Article Featured Banner */
.article-featured-banner {
  margin: 1.5rem 0 !important;
  overflow: hidden !important;
  border-radius: 1rem !important;
  border: 1px solid #1E293B !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
  background-color: #050811 !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.article-featured-banner img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
}

/* ==========================================================================
   3D TACTILE BUTTONS & PILLS
   ========================================================================== */
.btn-3d-cyan {
  background: linear-gradient(135deg, #0284C7 0%, #06B6D4 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s ease;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-3d-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #FFFFFF;
}

.btn-3d-cyan:active {
  transform: translateY(1px);
}

.btn-3d-pink {
  background: linear-gradient(135deg, #E11D48 0%, #F43F5E 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s ease;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-3d-pink:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.6);
}

/* ==========================================================================
   3D HERO SEARCH BOX
   ========================================================================== */
.search-box-3d {
  background: rgba(11, 18, 38, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 1.25rem;
  box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.7), 0 0 30px rgba(6, 182, 212, 0.15);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.search-box-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #06B6D4, #A855F7, #F43F5E);
}

.search-box-3d:focus-within {
  border-color: rgba(6, 182, 212, 0.8);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8), 0 0 35px rgba(6, 182, 212, 0.35);
}

/* ==========================================================================
   3D CATEGORY PILLS & HORIZONTAL SCROLLBAR
   ========================================================================== */
.cat-pill-3d {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(51, 65, 85, 0.8);
  color: #94A3B8;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  flex-shrink: 0 !important;
}

@media (min-width: 640px) {
  .cat-pill-3d {
    padding: 0.55rem 1.2rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }
}

.cat-pill-3d:hover {
  color: #FFFFFF;
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.cat-pill-3d.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35) 0%, rgba(6, 182, 212, 0.25) 100%) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.4), inset 0 0 10px rgba(56, 189, 248, 0.2) !important;
  transform: translateY(-1px);
}

/* Fluid Horizontal Category Scroll Container */
.no-scrollbar,
.cat-scroll-container {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.no-scrollbar::-webkit-scrollbar,
.cat-scroll-container::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ==========================================================================
   MOBILE-FIRST BOTTOM NAVIGATION BAR (APP BAR)
   ========================================================================== */
.mobile-app-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  height: 60px !important;
  background: rgba(5, 8, 17, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-top: 1px solid rgba(51, 65, 85, 0.7) !important;
  z-index: 999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
  padding: 0 0.25rem !important;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.6) !important;
  margin: 0 !important;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  min-width: 48px;
}

.mobile-nav-item svg,
.mobile-nav-item span.icon {
  font-size: 1.15rem;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item:active,
.mobile-nav-item.active {
  color: #38BDF8;
}

.mobile-nav-item:hover svg,
.mobile-nav-item.active svg {
  transform: scale(1.15);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6));
}

/* Touch Friendly Utilities */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   PROGRESS BAR & ARTICLE CLINICAL BOXES
   ========================================================================== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #06B6D4, #3B82F6, #A855F7, #F43F5E);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

/* Clinical Callout Boxes */
.clinical-pearl {
  border-left: 4px solid #0284C7;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
  border-radius: 0 0.75rem 0.75rem 0;
  width: 100%;
  max-width: 100%;
}

.warning-callout {
  border-left: 4px solid #EF4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(244, 63, 94, 0.05) 100%);
  border-radius: 0 0.75rem 0.75rem 0;
  width: 100%;
  max-width: 100%;
}

.exam-tip {
  border-left: 4px solid #F59E0B;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(251, 191, 36, 0.05) 100%);
  border-radius: 0 0.75rem 0.75rem 0;
  width: 100%;
  max-width: 100%;
}

.high-yield {
  border-left: 4px solid #10B981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(52, 211, 153, 0.05) 100%);
  border-radius: 0 0.75rem 0.75rem 0;
  width: 100%;
  max-width: 100%;
}

/* Responsive Table & Container Helpers */
.overflow-x-auto,
.table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

table {
  max-width: 100%;
}

figure {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

figure svg {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
}

/* Custom Scrollbar for Desktop */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: #050811;
  }
  ::-webkit-scrollbar-thumb {
    background: #1E293B;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #0284C7;
  }
}

/* Print Optimization */
@media print {
  header, footer, .no-print, #reading-progress, .mobile-app-bar {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
}