/* Maths Tutor Mobile-Optimized UI Components
   Progressive Web App Mobile Enhancement Styles */

/* ========================================
   CRITICAL MOBILE OVERFLOW PREVENTION - Cache bust: v2025-09-01-overflow-fix
   ======================================== */

/* ABSOLUTELY PREVENT horizontal scrolling on mobile - highest priority */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Force all elements to respect viewport width */
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Exception for truly fixed-size elements */
    i, 
    .btn:not(.btn-mobile),
    .badge,
    input[type="checkbox"],
    input[type="radio"],
    .nav-icon {
        max-width: none !important;
    }
    
    /* Bootstrap container fixes */
    .container,
    .container-fluid,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden !important;
    }
    
    /* Bootstrap row fixes */
    .row {
        margin-left: -0.375rem !important;
        margin-right: -0.375rem !important;
        max-width: 100% !important;
    }
    
    /* Bootstrap column fixes */
    .row > * {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
    }
    
    /* Layout component fixes */
    .page,
    main,
    .content,
    .sidebar {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Specific top bar fixes */
    .top-row {
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Hero section fixes */
    .hero-section,
    .hero-section .container {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Card and component fixes */
    .card,
    .key-stage-card,
    .assessment-card,
    .mobile-card {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ========================================
   MOBILE-FIRST PWA FUNDAMENTALS
   ======================================== */

/* Enhanced touch targets for mobile accessibility */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile-optimized button system */
.btn-mobile {
  padding: 12px 20px;
  font-size: 16px; /* Prevents zoom on iOS */
  border-radius: 12px;
  font-weight: 600;
  min-height: 44px;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-mobile:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Enhanced input fields for mobile */
.input-mobile {
  font-size: 16px; /* Prevents zoom on iOS */
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid hsl(var(--border));
  background: white;
  transition: all 0.2s ease;
  min-height: 44px;
}

.input-mobile:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
  outline: none;
}

/* ========================================
   MOBILE NAVIGATION SYSTEM
   ======================================== */

/* Bottom navigation bar for mobile */
.mobile-nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid hsl(var(--border));
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.2s ease;
  min-width: 60px;
  touch-action: manipulation;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  text-decoration: none;
}

.mobile-nav-item i {
  font-size: 20px;
  margin-bottom: 4px;
}

.mobile-nav-item span {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

/* Hamburger menu for collapsed navigation */
.mobile-hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  touch-action: manipulation;
}

.mobile-hamburger span {
  width: 24px;
  height: 3px;
  background: white;
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.mobile-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   TOUCH GESTURES AND INTERACTIONS
   ======================================== */

/* Swipeable cards for lesson navigation */
.swipeable-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
  touch-action: pan-y;
}

.swipeable-card.swiping {
  transition: none;
}

.swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: hsl(var(--primary));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.swipe-indicator.left {
  left: 20px;
}

.swipe-indicator.right {
  right: 20px;
}

.swipeable-card.swiping .swipe-indicator {
  opacity: 1;
}

/* Pull-to-refresh indicator */
.pull-to-refresh {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: hsl(var(--primary));
  color: white;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
}

.pull-to-refresh.visible {
  opacity: 1;
  top: 20px;
}

/* ========================================
   MOBILE-OPTIMIZED COMPONENTS
   ======================================== */

/* Enhanced card system for mobile */
.mobile-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid hsl(var(--border));
  transition: all 0.2s ease;
}

.mobile-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile-optimized key stage selection */
.mobile-key-stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
}

.mobile-key-stage-card {
  background: white;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  min-height: auto;
  touch-action: manipulation;
}

.mobile-key-stage-card:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-key-stage-card.selected {
  border-color: hsl(var(--primary));
  box-shadow: 0 4px 16px hsl(var(--primary) / 0.2);
}

/* Mobile lesson progress indicator */
.mobile-progress-bar {
  width: 100%;
  height: 8px;
  background: hsl(var(--secondary));
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
}

.mobile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--primary-glow)));
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
}

.mobile-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 1.5s infinite;
}

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

/* Mobile exercise interface */
.mobile-exercise-container {
  padding: 20px 16px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom)); /* Space for bottom nav */
}

.mobile-question-card {
  background: white;
  border-radius: 20px;
  padding: 30px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.mobile-question-text {
  font-size: 24px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 24px;
  line-height: 1.3;
}

.mobile-answer-input {
  font-size: 20px;
  text-align: center;
  padding: 16px;
  border: 3px solid hsl(var(--border));
  border-radius: 16px;
  width: 100%;
  max-width: 200px;
  margin: 0 auto 24px;
  transition: all 0.2s ease;
}

.mobile-answer-input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.1);
}

.mobile-submit-btn {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 16px;
  background: hsl(var(--primary));
  color: white;
  border: none;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.mobile-submit-btn:active {
  transform: scale(0.95);
  background: hsl(var(--primary) / 0.9);
}

.mobile-submit-btn:disabled {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  transform: none;
}

/* ========================================
   MOBILE GAMIFICATION ELEMENTS
   ======================================== */

/* XP gain animation for mobile */
.mobile-xp-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: hsl(var(--success));
  color: white;
  padding: 20px 30px;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 700;
  z-index: 1100;
  animation: mobileXpPop 2s ease-out forwards;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

@keyframes mobileXpPop {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
    opacity: 1;
  }
  40% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -200%) scale(0.8);
    opacity: 0;
  }
}

/* Mobile streak indicator */
.mobile-streak-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  color: white;
  border-radius: 16px;
  font-weight: 600;
  margin: 16px;
  animation: pulse 2s infinite;
}

.mobile-streak-fire {
  font-size: 20px;
  animation: flicker 1s infinite alternate;
}

@keyframes flicker {
  0% { transform: scale(1) rotate(-2deg); }
  100% { transform: scale(1.1) rotate(2deg); }
}

/* Mobile achievement badge */
.mobile-achievement-badge {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom) + 20px);
  right: 20px;
  background: hsl(var(--warning));
  color: white;
  padding: 12px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1050;
  animation: bounce 0.5s ease;
  box-shadow: 0 4px 16px hsl(var(--warning) / 0.4);
}

/* ========================================
   MOBILE MODALS AND OVERLAYS
   ======================================== */

/* Mobile-optimized modal */
.mobile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-modal.show {
  opacity: 1;
  visibility: visible;
}

.mobile-modal-content {
  width: 100%;
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.mobile-modal.show .mobile-modal-content {
  transform: translateY(0);
}

.mobile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.mobile-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.mobile-modal-close {
  background: hsl(var(--secondary));
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  font-size: 16px;
  touch-action: manipulation;
}

/* ========================================
   MOBILE LOADING STATES
   ======================================== */

/* Mobile skeleton loading */
.mobile-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.mobile-skeleton-card {
  padding: 20px;
  margin: 16px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-skeleton-line {
  height: 16px;
  margin-bottom: 12px;
}

.mobile-skeleton-line.short {
  width: 60%;
}

.mobile-skeleton-line.long {
  width: 90%;
}

.mobile-skeleton-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
}

/* Mobile spinner */
.mobile-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid hsl(var(--secondary));
  border-top: 4px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   MOBILE RESPONSIVE BREAKPOINTS
   ======================================== */

/* Portrait mobile (most phones) */
@media screen and (max-width: 480px) {
  .mobile-key-stage-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  
  .mobile-question-text {
    font-size: 20px;
  }
  
  .mobile-exercise-container {
    padding: 16px 12px;
  }
  
  .mobile-card {
    margin: 12px;
    padding: 16px;
  }
}

/* Landscape mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .mobile-modal-content {
    max-height: 80vh;
  }
  
  .mobile-question-card {
    padding: 20px 24px;
  }
  
  .mobile-nav-bottom {
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  
  .mobile-nav-item {
    padding: 6px 8px;
  }
  
  .mobile-nav-item span {
    display: none; /* Hide text labels in landscape */
  }
}

/* Tablet portrait */
@media screen and (min-width: 481px) and (max-width: 768px) {
  .mobile-key-stage-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .mobile-exercise-container {
    max-width: 600px;
    margin: 0 auto;
  }
  
  .mobile-question-text {
    font-size: 28px;
  }
}

/* Hide mobile navigation on larger screens */
@media screen and (min-width: 769px) {
  .mobile-nav-bottom {
    display: none;
  }
  
  .mobile-hamburger {
    display: none;
  }
  
  /* Use desktop navigation instead */
  .mobile-exercise-container {
    padding-bottom: 20px; /* Remove bottom nav space */
  }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .mobile-card {
    border: 2px solid hsl(var(--foreground));
  }
  
  .mobile-nav-item {
    border: 1px solid transparent;
  }
  
  .mobile-nav-item.active {
    border-color: hsl(var(--primary));
  }
  
  .mobile-answer-input {
    border-width: 3px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .mobile-card,
  .mobile-key-stage-card,
  .mobile-submit-btn,
  .swipeable-card {
    transition: none;
  }
  
  .mobile-xp-notification,
  .mobile-progress-fill::after,
  .mobile-spinner {
    animation: none;
  }
  
  .mobile-streak-indicator {
    animation: none;
  }
}

/* Focus visible for keyboard navigation */
.mobile-nav-item:focus-visible,
.mobile-submit-btn:focus-visible,
.mobile-answer-input:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* ========================================
   PWA SAFE AREA HANDLING
   ======================================== */

/* Handle device safe areas (notches, etc.) */
body {
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.mobile-nav-bottom {
  padding-left: calc(env(safe-area-inset-left) + 8px);
  padding-right: calc(env(safe-area-inset-right) + 8px);
}

/* PWA display mode styles */
@media all and (display-mode: standalone) {
  /* App is running as installed PWA */
  body {
    background: hsl(var(--background));
  }
  
  .pwa-only {
    display: block;
  }
  
  .browser-only {
    display: none;
  }
}

/* Browser display mode */
@media all and (display-mode: browser) {
  .pwa-only {
    display: none;
  }
  
  .browser-only {
    display: block;
  }
}

/* ========================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Hardware acceleration for smooth animations */
.mobile-card,
.mobile-key-stage-card,
.swipeable-card,
.mobile-modal-content {
  will-change: transform;
  transform: translateZ(0);
}

/* Optimize scrolling performance */
.mobile-exercise-container,
.mobile-modal-content {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Prevent text selection on interactive elements */
.mobile-nav-item,
.mobile-submit-btn,
.mobile-key-stage-card {
  -webkit-user-select: none;
  user-select: none;
}

/* Optimize tap highlighting */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Custom tap highlight for specific elements */
.mobile-submit-btn,
.mobile-nav-item {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
}

/* Final safety net: force no horizontal scroll */
@media (max-width: 768px) {
    body {
        position: relative;
        overflow-x: hidden !important;
    }
    
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 100vw;
        width: 1px;
        height: 100vh;
        z-index: -1;
        pointer-events: none;
    }
}

/* ========================================
   DARK MODE SUPPORT FOR MOBILE
   ======================================== */

@media (prefers-color-scheme: dark) {
  .mobile-card,
  .mobile-key-stage-card,
  .mobile-question-card {
    background: hsl(220 15% 15%);
    border-color: hsl(220 15% 25%);
    color: hsl(220 15% 85%);
  }
  
  .mobile-nav-bottom {
    background: rgba(30, 30, 30, 0.95);
    border-top-color: hsl(220 15% 25%);
  }
  
  .mobile-nav-item {
    color: hsl(220 15% 65%);
  }
  
  .mobile-nav-item:hover,
  .mobile-nav-item.active {
    color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.15);
  }
  
  .mobile-answer-input {
    background: hsl(220 15% 15%);
    border-color: hsl(220 15% 25%);
    color: hsl(220 15% 85%);
  }
  
  .mobile-skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
  }
}

/* ========================================
   WEB DRAWER INFRASTRUCTURE
   Cache bust: v2026-01-30-web-drawer
   ======================================== */

/* Z-index scale for drawer components (global scope) */
:root {
    --z-drawer-backdrop: 1040;
    --z-drawer-panel: 1045;
    --z-toast: 1060;
}

/* Hamburger button (mobile only) */
@media (max-width: 767px) {
    .mobile-web-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        padding: 11px;
        border: none;
        background: transparent;
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-web-hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: white;
        margin: 3px 0;
        border-radius: 2px;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center center;
    }

    /* Hamburger to X animation (NAV-06) */
    .mobile-web-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-web-hamburger.active span:nth-child(2) {
        opacity: 0;
    }

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

/* Backdrop overlay */
.mobile-web-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-drawer-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-web-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Drawer panel */
.mobile-web-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: var(--z-drawer-panel);
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    overflow-y: auto;
    background: white;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

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

/* Hide NavMenu header bar inside drawer (branding + toggle buttons) */
.mobile-web-drawer .top-row.navbar {
    display: none;
}

/* Scale down nav icons inside drawer for mobile */
.mobile-web-drawer .nav-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    border-radius: 10px;
}

.mobile-web-drawer .nav-link i {
    font-size: 0.95rem;
}

.mobile-web-drawer .nav-link {
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: hsl(220 15% 25%) !important;
}

.mobile-web-drawer .nav-link:hover {
    background: hsl(220 15% 95%);
}

.mobile-web-drawer .nav-link.active {
    color: hsl(var(--primary)) !important;
    background: hsl(var(--primary) / 0.1);
    border-color: hsl(var(--primary) / 0.2);
}

.mobile-web-drawer .nav-link i {
    opacity: 1;
}

.mobile-web-drawer h6.text-muted {
    color: hsl(220 15% 50%) !important;
}

.mobile-web-drawer hr {
    border-color: hsl(220 15% 90%);
}

/* Hide web drawer elements on desktop */
@media (min-width: 768px) {
    .mobile-web-hamburger,
    .mobile-web-backdrop,
    .mobile-web-drawer {
        display: none !important;
    }
}

/* Dark mode support for web drawer */
@media (prefers-color-scheme: dark) {
    .mobile-web-drawer {
        background: hsl(220 15% 12%);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
    }

    .mobile-web-drawer .nav-link {
        color: hsl(220 15% 80%) !important;
    }

    .mobile-web-drawer .nav-link:hover {
        background: hsl(220 15% 18%);
    }

    .mobile-web-drawer .nav-link.active {
        color: hsl(var(--primary)) !important;
        background: hsl(var(--primary) / 0.15);
        border-color: hsl(var(--primary) / 0.25);
    }

    .mobile-web-drawer h6.text-muted {
        color: hsl(220 15% 55%) !important;
    }

    .mobile-web-drawer hr {
        border-color: hsl(220 15% 22%);
    }

    .drawer-profile-header {
        background: linear-gradient(135deg, #5568d3 0%, #63408d 100%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Drawer profile header (NAV-07) */
.drawer-profile-header {
    padding: 20px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.drawer-profile-header .drawer-profile-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    margin-bottom: 2px;
}

.drawer-profile-header .drawer-profile-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
}

.drawer-profile-header .drawer-profile-icon {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Touch target minimum 44px for child users (WCAG 2.5.5) */
.mobile-web-drawer .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
}

/* Reduced motion for web drawer */
@media (prefers-reduced-motion: reduce) {
    .mobile-web-drawer,
    .mobile-web-backdrop {
        transition: none;
    }

    .mobile-web-hamburger span {
        transition: none;
    }
}