/* ========================================
   MOBILE EXPERIENCE FIXES
   ======================================== */

/* 1. SNAP SCROLLING - Enable on mobile for slide-by-slide navigation */
@media (max-width: 768px) {
  html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
  }
  
  .fullscreen-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

/* 2. CONTENT FITTING - Ensure all content fits in one screen height */
@media (max-width: 768px) {
  /* Make all sections exactly viewport height */
  .fullscreen-section {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
  }
  
  /* Adjust section content to fit within screen with proper padding */
  .section-content {
    max-height: calc(100vh - 120px) !important; /* Account for navbar + padding */
    overflow-y: auto !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Reduce font sizes for better content fitting */
  .section-content h2 {
    font-size: 1.5rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .section-content h3 {
    font-size: 1.2rem !important;
    margin-bottom: 0.5rem !important;
  }
  
  .section-content p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0.75rem !important;
  }
  
  .section-content ul, .section-content ol {
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Compact buttons */
  .section-content .btn {
    padding: 0.5rem 0.9rem !important;
    font-size: 0.85rem !important;
    margin: 0.25rem !important;
  }
  
  /* Hero section specific adjustments */
  .hero-split {
    padding: 70px 1rem 1rem 1rem !important;
    gap: 0.5rem !important;
  }
  
  .hero-image img {
    width: 140px !important;
    height: 140px !important;
    max-width: 140px !important;
    max-height: 140px !important;
  }
  
  .hero-text h1 {
    font-size: 1.25rem !important;
    margin-bottom: 0.3rem !important;
  }
  
  .hero-text h2 {
    font-size: 0.95rem !important;
    margin-bottom: 0.4rem !important;
  }
  
  .hero-text p {
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0.6rem !important;
  }
}

/* 3. HAMBURGER MENU FIX - Proper overlay and z-index */
@media (max-width: 991.98px) {
  /* Make navbar collapse overlay the page content with backdrop */
  .navbar-collapse {
    position: fixed !important;
    top: 56px !important; /* Height of collapsed navbar */
    left: 0 !important;
    right: 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    z-index: 1040 !important;
    max-height: calc(100vh - 56px) !important;
    overflow-y: auto !important;
    padding: 1rem !important;
    border-bottom: 2px solid var(--vibrant-teal);
  }
  
  /* Ensure navbar itself has proper z-index */
  .navbar {
    z-index: 1050 !important;
    position: fixed !important;
    top: 0 !important;
    width: 100% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }
  
  /* Style menu items for better mobile experience */
  .navbar-collapse .nav-link {
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 0 !important;
    font-size: 1.1rem !important;
    border-radius: 8px !important;
    background: rgba(243, 244, 246, 0.5) !important;
  }
  
  .navbar-collapse .nav-link:hover,
  .navbar-collapse .nav-link:active {
    background: rgba(20, 184, 166, 0.15) !important;
    color: var(--vibrant-teal) !important;
  }
  
  /* Icon links styling */
  .navbar-collapse .nav-item a[href*="github"],
  .navbar-collapse .nav-item a[href*="linkedin"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    padding: 0.75rem 1.5rem !important;
  }
}

/* 4. HIDE "Gary Beane" BRAND ON MOBILE */
@media (max-width: 768px) {
  .navbar-brand {
    display: none !important;
  }
  
  /* Adjust navbar layout - hamburger on left side */
  .navbar > .container-fluid {
    justify-content: flex-start !important;
    padding-left: 1rem !important;
  }
  
  /* Keep hamburger toggle on left side, vertically centered */
  .navbar-toggler {
    margin-left: 0 !important;
    margin-right: auto !important;
    order: 1 !important;
  }
}

/* Additional mobile optimizations */
@media (max-width: 768px) {
  /* Ensure body accounts for fixed navbar */
  body {
    padding-top: 56px !important;
  }
  
  /* First section should start below navbar */
  .fullscreen-section:first-of-type {
    margin-top: 0 !important;
  }
  
  /* Hide scroll arrows on mobile - snap scrolling replaces them */
  .scroll-arrow {
    display: none !important;
  }
  
  /* Adjust alternating section backgrounds for mobile */
  .fullscreen-section:nth-child(even) {
    background: linear-gradient(135deg, 
      rgba(243, 244, 246, 0.4) 0%, 
      rgba(241, 245, 249, 0.5) 100%);
  }
  
  .fullscreen-section:nth-child(odd) {
    background: linear-gradient(135deg, 
      rgba(255, 255, 255, 0.7) 0%, 
      rgba(249, 250, 251, 0.8) 100%);
  }
}

/* Very small mobile devices (< 375px width) */
@media (max-width: 374px) {
  .hero-image img {
    width: 120px !important;
    height: 120px !important;
  }
  
  .hero-text h1 {
    font-size: 1.1rem !important;
  }
  
  .hero-text h2 {
    font-size: 0.85rem !important;
  }
  
  .hero-text p {
    font-size: 0.75rem !important;
  }
  
  .section-content h2 {
    font-size: 1.3rem !important;
  }
  
  .section-content h3 {
    font-size: 1.1rem !important;
  }
  
  .section-content p,
  .section-content ul,
  .section-content ol {
    font-size: 0.85rem !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  /* Reduce vertical spacing in landscape */
  .section-content {
    max-height: calc(100vh - 80px) !important;
    padding: 0.75rem !important;
  }
  
  .hero-split {
    padding: 60px 1rem 0.5rem 1rem !important;
  }
  
  .hero-image img {
    width: 100px !important;
    height: 100px !important;
  }
  
  .hero-text h1 {
    font-size: 1.1rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .hero-text h2 {
    font-size: 0.85rem !important;
    margin-bottom: 0.3rem !important;
  }
  
  .hero-text p {
    font-size: 0.75rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.4rem !important;
  }
}
