/* 
 * Additional Mobile Touch Enhancements
 * Better touch interactions and mobile-specific features
 */

/* ===========================================
 * Touch-Friendly Interactions
 * =========================================== */

@media (max-width: 768px) {
  /* Better button hover states for touch */
  .btn[data-v-760ee808]:active,
  .btn:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }
  
  /* Touch ripple effect */
  .btn[data-v-760ee808],
  .schedule-mobile-class,
  .class-item[data-v-760ee808] {
    position: relative !important;
    overflow: hidden !important;
  }
  
  .btn[data-v-760ee808]:before,
  .schedule-mobile-class:before,
  .class-item[data-v-760ee808]:before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.3s ease, height 0.3s ease !important;
    pointer-events: none !important;
    z-index: 1 !important;
  }
  
  .btn[data-v-760ee808]:active:before,
  .schedule-mobile-class:active:before,
  .class-item[data-v-760ee808]:active:before {
    width: 100px !important;
    height: 100px !important;
  }
}

/* ===========================================
 * iOS Safari Specific Fixes
 * =========================================== */

@supports (-webkit-touch-callout: none) {
  /* Fix for iOS Safari viewport */
  .modal-overlay[data-v-760ee808] {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
  }
  
  .hero[data-v-c5e0ba04],
  .hero[data-v-2b0d8be0] {
    min-height: 50vh !important;
    min-height: 50dvh !important;
  }
  
  /* Fix for iOS input zoom */
  input[type="text"],
  input[type="email"], 
  input[type="password"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
    transform: scale(1) !important;
    -webkit-text-size-adjust: 100% !important;
  }
  
  /* Prevent iOS Safari bounce */
  body {
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ===========================================
 * Android Chrome Specific Fixes
 * =========================================== */

@media (max-width: 768px) {
  /* Fix for Android Chrome address bar */
  .schedule[data-v-760ee808] {
    min-height: calc(100vh - env(keyboard-inset-height, 0px)) !important;
    min-height: calc(100dvh - env(keyboard-inset-height, 0px)) !important;
  }
  
  /* Better scrolling on Android */
  .modal-content[data-v-760ee808],
  .beautiful-modal-content[data-v-760ee808] {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
}

/* ===========================================
 * Progressive Web App Enhancements
 * =========================================== */

@media (display-mode: standalone) {
  /* PWA specific styles */
  .navbar[data-v-57792a44] {
    padding-top: calc(8px + env(safe-area-inset-top)) !important;
  }
  
  .schedule-container[data-v-760ee808] {
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  }
}

/* ===========================================
 * Dark Mode Support (if needed)
 * =========================================== */

@media (prefers-color-scheme: dark) and (max-width: 768px) {
  .schedule-mobile-day {
    background: rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
  }
  
  .schedule-mobile-day-header {
    background: linear-gradient(135deg, #5a4a37, #7a6a57) !important;
  }
  
  .schedule-mobile-time {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }
  
  .schedule-mobile-empty {
    border-color: #7a6a57 !important;
    color: #7a6a57 !important;
  }
}

/* ===========================================
 * Reduced Motion Support
 * =========================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .schedule-mobile-class:hover,
  .class-item[data-v-760ee808]:hover {
    transform: none !important;
  }
}

/* ===========================================
 * High Contrast Mode Support
 * =========================================== */

@media (prefers-contrast: high) and (max-width: 768px) {
  .schedule-mobile-class,
  .btn[data-v-760ee808] {
    border: 2px solid currentColor !important;
  }
  
  .schedule-mobile-day {
    border: 3px solid #000 !important;
  }
  
  .schedule-mobile-day-header {
    background: #000 !important;
    color: #fff !important;
  }
}

/* ===========================================
 * Loading States
 * =========================================== */

@media (max-width: 768px) {
  .loading-calendar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 300px !important;
    color: #8b6f47 !important;
  }
  
  .loading-spinner-mobile {
    width: 40px !important;
    height: 40px !important;
    border: 3px solid rgba(139, 111, 71, 0.3) !important;
    border-top: 3px solid #8b6f47 !important;
    border-radius: 50% !important;
    animation: spin-mobile 1s linear infinite !important;
    margin-bottom: 16px !important;
  }
  
  @keyframes spin-mobile {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  .loading-text-mobile {
    font-size: 16px !important;
    font-weight: 500 !important;
  }
}

/* ===========================================
 * Error States
 * =========================================== */

@media (max-width: 768px) {
  .error-calendar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 300px !important;
    padding: 20px !important;
    text-align: center !important;
    color: #dc3545 !important;
  }
  
  .error-icon-mobile {
    font-size: 48px !important;
    margin-bottom: 16px !important;
    opacity: 0.7 !important;
  }
  
  .error-text-mobile {
    font-size: 16px !important;
    margin-bottom: 16px !important;
    line-height: 1.5 !important;
  }
  
  .error-retry-mobile {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    cursor: pointer !important;
  }
  
  .error-retry-mobile:active {
    background: #c82333 !important;
  }
}

/* ===========================================
 * Offline Support
 * =========================================== */

@media (max-width: 768px) {
  .offline-banner {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffc107 !important;
    color: #000 !important;
    padding: 8px 16px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    z-index: 9999 !important;
    transform: translateY(-100%) !important;
    transition: transform 0.3s ease !important;
  }
  
  .offline-banner.show {
    transform: translateY(0) !important;
  }
  
  .offline-banner + .navbar[data-v-57792a44] {
    margin-top: 36px !important;
  }
}

/* ===========================================
 * Better Focus Management
 * =========================================== */

@media (max-width: 768px) {
  /* Skip link for accessibility */
  .skip-link {
    position: absolute !important;
    top: -40px !important;
    left: 6px !important;
    background: #8b6f47 !important;
    color: white !important;
    padding: 8px !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    z-index: 10000 !important;
  }
  
  .skip-link:focus {
    top: 6px !important;
  }
  
  /* Better focus management for mobile */
  /* Focus trap would be implemented in JavaScript */
  .modal-overlay[data-v-760ee808][aria-hidden="false"] {
    /* Focus management handled by JS */
    position: fixed !important;
  }
  
  .modal-content[data-v-760ee808]:focus,
  .beautiful-modal-content[data-v-760ee808]:focus {
    outline: none !important;
  }
  
  /* Focus indicators for touch */
  .schedule-mobile-class:focus,
  .schedule-mobile-empty:focus {
    outline: 3px solid rgba(139, 111, 71, 0.7) !important;
    outline-offset: 2px !important;
  }
}

/* ===========================================
 * Print Styles (mobile-friendly)
 * =========================================== */

@media print and (max-width: 768px) {
  .schedule-mobile-container {
    background: white !important;
  }
  
  .schedule-mobile-day {
    page-break-inside: avoid !important;
    border: 1px solid #000 !important;
    margin-bottom: 10px !important;
  }
  
  .schedule-mobile-day-header {
    background: #f0f0f0 !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  .schedule-mobile-class {
    background: #f9f9f9 !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
  }
}

/* ===========================================
 * Performance Optimizations
 * =========================================== */

@media (max-width: 768px) {
  /* Enable hardware acceleration */
  .schedule-mobile-class,
  .modal-overlay[data-v-760ee808],
  .modal-content[data-v-760ee808] {
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-font-smoothing: antialiased !important;
  }
  
  /* Optimize repaints */
  .schedule-mobile-container {
    contain: layout style !important;
  }
  
  .schedule-mobile-day {
    contain: layout !important;
  }
}
