/* ========================================
   Mobile Base Bundle - Mobile-First Responsive Styles
   Generated: 2025-08-16
   Part of modular CSS architecture
   
   PHILOSOPHY: Mobile-first design approach
   Base styles are for mobile, then enhance for larger screens
   ======================================== */

/* ========================================
   MOBILE VISIBILITY UTILITIES
   ======================================== */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
}

/* ========================================
   MOBILE VIEWPORT & TOUCH OPTIMIZATION
   ======================================== */
* {
  /* Prevent iOS tap highlight */
  -webkit-tap-highlight-color: transparent;
  /* Smooth scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

html {
  /* Prevent font size adjustments on orientation change */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  /* Enable smooth scrolling */
  scroll-behavior: smooth;
}

body {
  /* Prevent horizontal scroll */
  overflow-x: hidden;
  /* Better touch scrolling */
  overscroll-behavior-y: contain;
}

/* ========================================
   MOBILE TOUCH TARGETS (WCAG 2.5.5)
   ======================================== */
button,
a,
input,
select,
textarea,
.clickable,
.touchable {
  /* Minimum 44x44px touch targets for accessibility */
  min-height: 44px;
  min-width: 44px;
  /* Add padding for better touch */
  position: relative;
}

/* Expand touch area without affecting layout */
button::before,
a.btn::before,
.touchable::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: space-around;
  padding: var(--spacing-sm) 0;
  z-index: var(--z-sticky);
  /* Safe area for iPhone notch/home indicator */
  padding-bottom: env(safe-area-inset-bottom, var(--spacing-sm));
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color var(--transition-fast);
  flex: 1;
  max-width: 80px;
}

.mobile-nav-item.active {
  color: var(--primary-color);
}

.mobile-nav-icon {
  width: 24px;
  height: 24px;
}

/* ========================================
   MOBILE HEADER
   ======================================== */
.mobile-header {
  position: sticky;
  top: 0;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-default);
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: var(--z-sticky);
  /* Safe area for iPhone notch */
  padding-top: env(safe-area-inset-top, var(--spacing-md));
}

.mobile-menu-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
}

/* ========================================
   MOBILE DRAWER/SIDEBAR
   ======================================== */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-xl);
  transition: transform var(--transition-slow);
  z-index: var(--z-modal);
  overflow-y: auto;
  /* Safe areas */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-drawer.open {
  transform: translateX(100%);
}

.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: calc(var(--z-modal) - 1);
}

.mobile-drawer-overlay.visible {
  display: block;
}

/* ========================================
   MOBILE FORMS
   ======================================== */
@media (max-width: 768px) {
  /* Larger inputs for mobile */
  input,
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: var(--spacing-md);
  }
  
  /* Stack form elements */
  .form-row {
    flex-direction: column;
  }
  
  /* Full width buttons on mobile */
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Stacked button groups */
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    border-radius: var(--radius-md);
    width: 100%;
  }
}

/* ========================================
   MOBILE CARDS & CONTENT
   ======================================== */
@media (max-width: 768px) {
  /* Remove horizontal margins */
  .container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }
  
  /* Full-width cards */
  .card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: calc(-1 * var(--spacing-md));
    margin-right: calc(-1 * var(--spacing-md));
  }
  
  /* Reduce padding on mobile */
  .card-body {
    padding: var(--spacing-md);
  }
  
  /* Stack grid layouts */
  .grid,
  .dashboard-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   MOBILE TABLES
   ======================================== */
@media (max-width: 768px) {
  /* Make tables scrollable */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Or convert to cards on mobile */
  .table-mobile-card table,
  .table-mobile-card thead,
  .table-mobile-card tbody,
  .table-mobile-card th,
  .table-mobile-card td,
  .table-mobile-card tr {
    display: block;
  }
  
  .table-mobile-card thead {
    display: none;
  }
  
  .table-mobile-card tr {
    margin-bottom: var(--spacing-md);
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
  }
  
  .table-mobile-card td {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border: none;
  }
  
  .table-mobile-card td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
  }
}

/* ========================================
   MOBILE MODALS
   ======================================== */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
  }
  
  .modal-content {
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  
  .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Or use bottom sheet pattern */
  .modal-bottom-sheet .modal-dialog {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 90vh;
    margin: 0;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
  }
  
  .modal-bottom-sheet.show .modal-dialog {
    transform: translateY(0);
  }
  
  .modal-bottom-sheet .modal-content {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ========================================
   MOBILE TYPOGRAPHY
   ======================================== */
@media (max-width: 768px) {
  /* Responsive font sizes */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }
  h5 { font-size: 1.125rem; }
  h6 { font-size: 1rem; }
  
  /* Better readability on mobile */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  
  p {
    margin-bottom: var(--spacing-md);
  }
}

/* ========================================
   MOBILE IMAGES & MEDIA
   ======================================== */
@media (max-width: 768px) {
  /* Full-width images */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Full-width videos */
  video,
  iframe {
    width: 100%;
    height: auto;
  }
  
  /* Maintain aspect ratio for embedded content */
  .embed-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
  }
  
  .embed-responsive iframe,
  .embed-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* ========================================
   MOBILE UTILITIES
   ======================================== */
@media (max-width: 768px) {
  /* Hide on mobile */
  .hide-mobile {
    display: none !important;
  }
  
  /* Show only on mobile */
  .show-mobile {
    display: block !important;
  }
  
  /* Full width on mobile */
  .mobile-full {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Remove margins on mobile */
  .mobile-no-margin {
    margin: 0 !important;
  }
  
  /* Stack flex items on mobile */
  .mobile-stack {
    flex-direction: column !important;
  }
}

/* ========================================
   MOBILE PERFORMANCE
   ======================================== */
@media (max-width: 768px) {
  /* Disable hover effects on mobile */
  @media (hover: none) {
    .btn:hover,
    a:hover,
    .card:hover {
      transform: none;
      box-shadow: none;
    }
  }
  
  /* Reduce animations on mobile */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ========================================
   TABLET ADJUSTMENTS
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Two column grids on tablet */
  .grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Adjust container width */
  .container {
    max-width: 768px;
  }
  
  /* Hide mobile nav on tablet */
  .mobile-nav {
    display: none;
  }
  
  /* Show desktop nav on tablet */
  .desktop-nav {
    display: flex;
  }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
  /* Reduce header height in landscape */
  .mobile-header {
    padding: var(--spacing-sm);
  }
  
  /* Adjust modal height for landscape */
  .modal-dialog {
    max-height: 90vh;
  }
  
  /* Side-by-side layout in landscape */
  .mobile-landscape-row {
    display: flex;
    gap: var(--spacing-md);
  }
}

/* ========================================
   PRINT STYLES (Mobile printing)
   ======================================== */
@media print {
  /* Hide navigation */
  .mobile-nav,
  .mobile-header,
  .mobile-drawer {
    display: none;
  }
  
  /* Full width for printing */
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  /* Remove backgrounds */
  * {
    background: white !important;
    color: black !important;
  }
}/* ========================================
   Responsive Styles - Media Queries, Mobile Optimizations
   Generated: 2025-08-16
   Part of modular CSS architecture
   ======================================== */

@media (max-width: 768px) {
  :root {
    
    --text-primary: #000000;        
    --text-secondary: #4A4A4A;      
    
    
    --text-primary-dark: #FFFFFF;   
    --text-secondary-dark: #C0C0C0; 
    --border-default-dark: #606366; 
  }
}

@media (prefers-color-scheme: dark) and (display-mode: fullscreen) {
  :root {
    --bg-surface-dark: #000000;     
    --bg-card-dark: #0A0A0A;        
    --bg-input-dark: #141414;       
  }
}

@media (prefers-contrast: high) {
  :root {
    
    --text-primary: #000000;
    --text-secondary: #000000;
    --border-default: #000000;
    
    
    --bg-surface-dark: #000000;
    --bg-card-dark: #1A1A1A;
    --text-primary-dark: #FFFFFF;
    --text-secondary-dark: #FFFFFF;
    --border-default-dark: #FFFFFF;
  }
}

@media print {
  :root {
    --bg-surface: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #000000;
    --border-default: #000000;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --mobile-bg-primary: #1a1a1a;
    --mobile-bg-secondary: #2d2d2d;
    --mobile-bg-dark: #000000;
  }
  
  body {
    background-color: var(--mobile-bg-primary);
    color: var(--text-on-accent);
  }
  
  .mobile-nav,
  .mobile-menu,
  .mobile-card,
  .mobile-bottom-nav {
    background: var(--mobile-bg-primary);
    border-color: var(--border-default-dark);
  }
  
  .mobile-form-input {
    background: var(--mobile-bg-secondary);
    border-color: var(--border-default-dark);
    color: var(--text-on-accent);
  }
}
/* ========================================
   Bundle 7 Complete: Mobile + All Responsive + Print
   ======================================== */
