/* ========================================
   VNU Hospital Portal - Responsive Styles
   ======================================== */

/* ========================================
   Large Desktop (1440px+)
   ======================================== */
@media (min-width: 1440px) {
  .container {
    max-width: var(--container-2xl);
  }
}

/* ========================================
   Desktop (1024px - 1439px)
   ======================================== */
@media (max-width: 1439px) {
  :root {
    --text-6xl: 3rem;
    --text-5xl: 2.5rem;
  }
}

/* ========================================
   Tablet Landscape (768px - 1023px)
   ======================================== */
@media (max-width: 1023px) {
  :root {
    --text-6xl: 2.5rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
  }

  .navbar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #ffffff;
    padding: 90px var(--space-6) var(--space-6);
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--space-2);
    z-index: 990;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
  }

  .navbar-nav.active {
    display: flex;
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .navbar-nav .nav-link {
    padding: var(--space-4);
    font-size: var(--text-lg);
    border-bottom: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    width: 100%;
    text-align: left;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    background-color: var(--color-bg-soft);
    color: var(--color-primary);
    padding-left: var(--space-6);
  }

  .navbar-toggle {
    display: flex;
    position: relative;
    z-index: 1001;
  }

  .navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Grid adjustments */
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: var(--space-12) 0;
  }

  /* Footer responsive */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .footer-about {
    grid-column: span 2;
  }
}

/* ========================================
   Tablet Portrait (640px - 767px)
   ======================================== */
@media (max-width: 767px) {
  :root {
    --text-6xl: 2rem;
    --text-5xl: 1.75rem;
    --text-4xl: 1.5rem;
    --text-3xl: 1.25rem;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .section {
    padding: var(--space-10) 0;
  }

  /* Grid adjustments */
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }

  /* Hide on mobile */
  .hide-tablet {
    display: none !important;
  }

  /* Cards */
  .card-body {
    padding: var(--space-4);
  }

  /* Buttons */
  .btn {
    padding: var(--space-3) var(--space-4);
  }

  .btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
  }

  /* Modal */
  .modal {
    width: 95%;
    max-height: 85vh;
  }
}

/* ========================================
   Mobile (< 640px)
   ======================================== */
@media (max-width: 639px) {
  :root {
    --text-6xl: 1.75rem;
    --text-5xl: 1.5rem;
    --text-4xl: 1.25rem;
    --text-3xl: 1.125rem;
    --text-2xl: 1rem;
  }

  body {
    font-size: var(--text-sm);
  }

  h1 {
    font-size: var(--text-4xl);
  }

  h2 {
    font-size: var(--text-3xl);
  }

  h3 {
    font-size: var(--text-2xl);
  }

  h4 {
    font-size: var(--text-xl);
  }

  h5,
  h6 {
    font-size: var(--text-lg);
  }

  .container {
    padding: 0 var(--space-4);
  }

  .section {
    padding: var(--space-8) 0;
  }

  /* Footer mobile */
  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .footer-about {
    grid-column: span 1;
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }

  /* Navbar */
  .navbar-container {
    height: 64px;
  }

  .navbar-logo img {
    height: 32px;
  }

  .navbar-logo-text {
    font-size: var(--text-lg);
  }

  .navbar-actions .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }

  /* Hide elements on mobile */
  .hide-mobile {
    display: none !important;
  }

  /* Stack buttons */
  .btn-group-mobile {
    flex-direction: column;
    width: 100%;
  }

  .btn-group-mobile .btn {
    width: 100%;
  }

  /* Feature Cards */
  .feature-card {
    padding: var(--space-6);
  }

  .feature-card .icon {
    width: 64px;
    height: 64px;
    font-size: var(--text-2xl);
  }

  /* Tabs - horizontal scroll */
  .tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }

  /* Accordion */
  .accordion-header {
    padding: var(--space-4);
    font-size: var(--text-sm);
  }

  .accordion-content {
    padding: 0 var(--space-4) var(--space-4);
    font-size: var(--text-sm);
  }

  /* Footer stacking */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  /* Stats - 2 columns on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Quick actions - scroll horizontal */
  .quick-actions-scroll {
    display: flex;
    overflow-x: auto;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    -webkit-overflow-scrolling: touch;
  }

  .quick-actions-scroll::-webkit-scrollbar {
    height: 4px;
  }

  .quick-actions-scroll::-webkit-scrollbar-track {
    background: var(--color-bg-soft);
    border-radius: var(--radius-full);
  }

  .quick-actions-scroll::-webkit-scrollbar-thumb {
    background: var(--color-primary-light);
    border-radius: var(--radius-full);
  }

  .quick-action-card {
    min-width: 140px;
    flex-shrink: 0;
  }
}

/* ========================================
   Small Mobile (< 375px)
   ======================================== */
@media (max-width: 374px) {
  .container {
    padding: 0 var(--space-3);
  }

  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }

  .navbar-actions {
    gap: var(--space-2);
  }
}

/* ========================================
   Landscape Orientation (Mobile)
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .navbar-nav.active {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .modal {
    max-height: 80vh;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {

  .navbar,
  .footer,
  .btn,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode
    :root {
        --color-bg-primary: #1a1a1a;
        --color-bg-secondary: #242424;
        --color-text-primary: #ffffff;
        --color-text-secondary: #b0b0b0;
        --color-border: #333333;
    }
    */
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ========================================
   High Contrast Mode
   ======================================== */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #006400;
    --color-border: #000000;
  }

  .btn {
    border-width: 3px;
  }

  a:focus,
  button:focus {
    outline: 3px solid currentColor;
  }
}