/* Enhanced Mobile Optimizations for Ambition Science Zone */

/* Mobile-First Base Styles */
@media (max-width: 768px) {
  /* Enhanced Touch Interactions */
  * {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }

  /* Allow text selection for content */
  p, span, div, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }

  /* Enhanced Viewport Units */
  .min-h-screen {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  .h-screen {
    height: 100vh;
    height: -webkit-fill-available;
  }

  /* Enhanced Button Styles */
  .btn-mobile {
    min-height: 48px;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
  }

  .btn-mobile:active {
    transform: scale(0.98);
  }

  .btn-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
  }

  .btn-mobile:hover::before {
    left: 100%;
  }

  /* Enhanced Form Elements */
  .form-mobile input,
  .form-mobile textarea,
  .form-mobile select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 16px;
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
  }

  .form-mobile input:focus,
  .form-mobile textarea:focus,
  .form-mobile select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: translateY(-2px);
  }

  /* Enhanced Card Animations */
  .card-mobile {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }

  .card-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transition: left 0.5s ease;
  }

  .card-mobile:hover::before {
    left: 100%;
  }

  /* Enhanced Typography Scale */
  .text-mobile-hero {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .text-mobile-title {
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
  }

  .text-mobile-subtitle {
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 600;
  }

  .text-mobile-body {
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 400;
    color: #6B7280;
  }

  /* Enhanced Navigation */
  .nav-mobile {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  }

  .nav-mobile-item {
    padding: 16px 20px;
    margin: 4px 12px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    position: relative;
    overflow: hidden;
  }

  .nav-mobile-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
  }

  .nav-mobile-item:hover::before {
    left: 100%;
  }

  .nav-mobile-item:hover {
    background: rgba(102, 126, 234, 0.08);
    transform: translateX(6px);
    color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
  }

  /* Enhanced Loading States */
  .loading-mobile {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    border-radius: 8px;
  }

  .loading-mobile::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer-mobile 1.5s infinite;
  }

  @keyframes shimmer-mobile {
    0% { left: -100%; }
    100% { left: 100%; }
  }

  /* Enhanced Scroll Indicators */
  .scroll-indicator-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 10000;
  }

  .scroll-progress-mobile {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradient-flow-mobile 3s ease infinite;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
  }

  @keyframes gradient-flow-mobile {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }

  /* Enhanced Image Optimization */
  .img-mobile {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }

  .img-mobile-hero {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  }

  /* Enhanced Spacing System */
  .space-mobile-xs { margin: 0.5rem; }
  .space-mobile-sm { margin: 1rem; }
  .space-mobile-md { margin: 1.5rem; }
  .space-mobile-lg { margin: 2rem; }
  .space-mobile-xl { margin: 3rem; }

  .gap-mobile-xs { gap: 0.5rem; }
  .gap-mobile-sm { gap: 1rem; }
  .gap-mobile-md { gap: 1.5rem; }
  .gap-mobile-lg { gap: 2rem; }
  .gap-mobile-xl { gap: 3rem; }

  /* Enhanced Grid System */
  .grid-mobile-1 { grid-template-columns: 1fr; }
  .grid-mobile-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-mobile-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

  /* Enhanced Utility Classes */
  .text-center-mobile { text-align: center; }
  .text-left-mobile { text-align: left; }
  .text-right-mobile { text-align: right; }

  .flex-center-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .flex-between-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .flex-column-mobile {
    display: flex;
    flex-direction: column;
  }

  /* Enhanced Accessibility */
  .sr-only-mobile {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .focus-visible-mobile:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
  }
}

/* Extra Small Screens (480px and below) */
@media (max-width: 480px) {
  .text-mobile-hero {
    font-size: 1.75rem;
  }

  .text-mobile-title {
    font-size: 1.25rem;
  }

  .btn-mobile {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 15px;
  }

  .card-mobile {
    padding: 16px;
    margin-bottom: 12px;
  }

  .space-mobile-xs { margin: 0.25rem; }
  .space-mobile-sm { margin: 0.75rem; }
  .space-mobile-md { margin: 1rem; }
  .space-mobile-lg { margin: 1.5rem; }
  .space-mobile-xl { margin: 2rem; }
}
