/* Mobile Responsiveness Fixes for Wildernest Website */

/* Base Mobile Styles */
@media (max-width: 767px) {
  /* Navbar Mobile Fixes */
  #main-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    width: 100vw !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #contact-ribbon {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    padding: 0.25rem 1rem !important;
    margin: 0 !important;
    border-bottom: none !important;
  }

  /* Contact ribbon content spacing */
  #contact-ribbon .flex {
    gap: 0.75rem !important;
  }

  #contact-ribbon a {
    font-size: 0.75rem !important;
  }

  #contact-ribbon .w-6.h-6 {
    width: 1.25rem !important;
    height: 1.25rem !important;
  }

  /* Background Typography Mobile Fixes - Hide on Mobile */
  .text-\\[120px\\] {
    display: none !important;
  }

  /* Hide all large background text elements on mobile */
  span[class*='text-[120px]'] {
    display: none !important;
  }

  /* Specific background text hiding */
  .absolute.text-\\[120px\\] {
    display: none !important;
  }

  /* Hide background text by content - targeting specific words */
  span:contains('Journey'),
  span:contains('Retreats'),
  span:contains('Travel'),
  span:contains('Adventure'),
  span:contains('Location'),
  span:contains('Experience'),
  span:contains('Commitment') {
    display: none !important;
  }

  /* Alternative approach - hide by positioning and size */
  .absolute[class*='text-[120px]'] {
    display: none !important;
  }

  /* Main navbar section mobile spacing */
  #main-header > div:last-child {
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
  }

  /* Logo section mobile */
  #main-header .flex.items-center.gap-2 {
    gap: 0.5rem !important;
  }

  /* Logo text mobile */
  #logo-text {
    font-size: 1.5rem !important;
  }

  /* Mobile menu button */
  #mobile-menu-btn {
    padding: 0.5rem !important;
  }

  /* Mobile navigation link text - make all black */
  #mobile-sidebar nav a {
    color: #1f2937 !important; /* gray-800 */
  }

  #mobile-sidebar nav a:hover {
    color: #ea580c !important; /* orange-600 */
  }

  #mobile-sidebar nav button {
    color: #1f2937 !important; /* gray-800 */
  }

  #mobile-sidebar nav button:hover {
    color: #ea580c !important; /* orange-600 */
  }

  /* Override any existing text colors in mobile nav */
  #mobile-sidebar .text-gray-700,
  #mobile-sidebar .text-gray-900 {
    color: #1f2937 !important;
  }

  /* Mobile sidebar close button */
  #mobile-sidebar button[aria-label='Close menu'] {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background-color: transparent !important;
    transition: background-color 0.2s ease !important;
    z-index: 51 !important;
  }

  #mobile-sidebar button[aria-label='Close menu']:hover {
    background-color: #f3f4f6 !important; /* gray-100 */
  }

  #mobile-sidebar button[aria-label='Close menu']:active {
    background-color: #e5e7eb !important; /* gray-200 */
  }

  /* Background Typography Mobile Fixes - Hide on Mobile */
  .text-\\[120px\\] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  /* Hide all large background text elements on mobile */
  span[class*='text-[120px]'] {
    display: none !important;
    visibility: hidden !important;
  }

  /* Specific background text hiding */
  .absolute.text-\\[120px\\] {
    display: none !important;
    visibility: hidden !important;
  }

  /* Target specific background text elements */
  span.absolute[class*='text-[120px]'][class*='top-[-60px]'] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  /* Background Typography Mobile Fixes - Hide on Mobile */
  .text-\\[120px\\] {
    display: none !important;
  }

  /* Typography Fixes */
  .hero-title h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }

  .hero-subtitle {
    font-size: 1rem !important;
    padding: 0 1rem !important;
  }

  /* Hero Section Mobile Fixes */
  .min-h-screen {
    min-height: 100vh !important;
    padding-top: 0 !important;
    padding-bottom: 60px !important;
    margin-top: 0 !important;
  }

  /* Container Padding */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Remove excessive navbar padding on mobile */
  .px-10 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .sm\\:px-8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Remove space under navbar - make it overlay hero */
  main {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Ensure hero section starts from top */
  main > div:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Scroll to top button mobile fixes */
  #scroll-to-top {
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    width: 48px !important;
    height: 48px !important;
    z-index: 40 !important;
    position: fixed !important;
    margin: 0 !important;
  }

  /* Prevent horizontal overflow and fix footer spacing */
  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Fix footer white space on mobile */
  footer {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Ensure main content container doesn't have extra spacing */
  .flex.bg-transparent.flex-col.min-h-screen {
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Remove any extra spacing from body wrapper */
  body > div {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Button Mobile Optimization */
  .hero-buttons a {
    min-height: 48px !important;
    font-size: 0.9rem !important;
    padding: 12px 20px !important;
  }

  /* Grid Mobile Stacking */
  .grid-cols-1.md\\:grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }

  .grid-cols-1.lg\\:grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
  }

  /* Feature Cards Mobile */
  .feature-card {
    padding: 1rem !important;
    text-align: center !important;
  }

  .feature-card h3 {
    font-size: 1.125rem !important;
  }

  .feature-card p {
    font-size: 0.875rem !important;
  }

  /* Section Padding Mobile */
  .py-20 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  .py-16 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Adventure section mobile fixes */
  section.bg-white.py-20 {
    overflow: hidden !important;
    max-width: 100vw !important;
  }

  section.bg-white.py-20 .container {
    max-width: 100% !important;
    overflow: hidden !important;
  }

  /* Text Size Adjustments */
  .text-5xl {
    font-size: 2rem !important;
  }

  .text-4xl {
    font-size: 1.75rem !important;
  }

  .text-3xl {
    font-size: 1.5rem !important;
  }

  .text-2xl {
    font-size: 1.25rem !important;
  }

  /* Background Typography Mobile Fixes - Hide on Mobile */
  .text-\\[120px\\] {
    display: none !important;
  }

  /* Section Title Mobile Adjustments */
  .relative h2 {
    position: relative !important;
    z-index: 2 !important;
  }

  /* Image Responsive */
  .aspect-\\[4\\/3\\] {
    aspect-ratio: 16/9 !important;
  }

  .h-\\[430px\\] {
    height: 250px !important;
  }

  .h-\\[500px\\] {
    height: 300px !important;
  }

  /* Form Mobile Optimization */
  .grid-cols-1.md\\:grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }

  /* Gallery Mobile */
  .grid-cols-1.sm\\:grid-cols-2.md\\:grid-cols-3.lg\\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .h-64 {
    height: 200px !important;
  }

  /* Activity Cards Mobile */
  .activity-card {
    padding: 1rem !important;
  }

  .activity-card h2 {
    font-size: 1.5rem !important;
  }

  .grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  /* Contact Page Mobile */
  .contact-info {
    margin-bottom: 2rem !important;
  }

  /* Room Page Mobile */
  .room-hero {
    height: 300px !important;
    padding-top: 100px !important;
  }

  .room-hero h1 {
    font-size: 2rem !important;
  }

  .room-hero p {
    font-size: 1rem !important;
  }

  /* Highlights Ribbon Mobile */
  .highlights-ribbon {
    padding: 1rem 0 !important;
  }

  .highlights-ribbon .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .highlights-ribbon span {
    font-size: 0.75rem !important;
  }

  /* Booking Form Mobile */
  .booking-form {
    padding: 1rem !important;
  }

  .booking-form input,
  .booking-form select {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }

  /* Adventure Cards Mobile */
  .adventure-cards {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 2rem !important;
  }

  .adventure-card {
    text-align: center !important;
  }

  .adventure-card .w-60.h-60 {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto 1rem auto !important;
  }

  /* Adventure Swiper Mobile */
  .adventure-swiper {
    padding-bottom: 60px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: visible !important;
    position: relative !important;
  }

  .adventure-swiper .swiper-wrapper {
    width: 100% !important;
    height: auto !important;
  }

  .adventure-swiper .swiper-slide {
    height: auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .adventure-swiper .swiper-pagination {
    bottom: 20px !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .adventure-swiper .swiper-pagination-bullet {
    background: #ea580c !important;
    opacity: 0.3 !important;
  }

  .adventure-swiper .swiper-pagination-bullet-active {
    opacity: 1 !important;
  }

  .adventure-swiper .swiper-button-next,
  .adventure-swiper .swiper-button-prev {
    display: none !important;
  }

  /* Fix Adventure section container */
  .adventure-swiper .swiper-slide > div {
    max-width: 100% !important;
    padding: 0 1rem !important;
    width: 100% !important;
  }

  /* Ensure swiper is enabled on mobile */
  @media (max-width: 1023px) {
    .adventure-swiper {
      touch-action: pan-y pinch-zoom !important;
    }
  }

  /* Remove focus outline from navbar links */
  #main-header a:focus,
  #main-header button:focus,
  #mobile-sidebar a:focus,
  #mobile-sidebar button:focus {
    outline: none !important;
    box-shadow: none !important;
  }

  /* Remove tap highlight on mobile */
  #main-header a,
  #main-header button,
  #mobile-sidebar a,
  #mobile-sidebar button {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
  }

  /* Timeline Mobile - Center Aligned */
  .timeline-item {
    width: 100% !important;
    margin-bottom: 2rem !important;
  }

  .timeline-item img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
  }

  /* Journey Timeline Section Mobile */
  section .flex.flex-wrap.justify-between {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2rem !important;
  }

  /* Timeline items mobile center alignment */
  section .flex.flex-wrap.justify-between > div {
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
  }

  /* Timeline item content */
  .w-\\[230px\\] {
    width: 100% !important;
    max-width: 280px !important;
    margin: 0 auto 2rem auto !important;
  }

  /* Accommodation Cards Mobile */
  .accommodation-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
  }

  /* Map Mobile */
  .map-container {
    height: 250px !important;
    margin-top: 2rem !important;
  }

  /* Lightbox Mobile */
  .lightbox-content {
    padding: 1rem !important;
  }

  .lightbox-image {
    max-height: 70vh !important;
  }

  /* Footer Mobile */
  .footer-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 2rem !important;
    text-align: center !important;
  }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-title h1 {
    font-size: 3rem !important;
  }

  .grid-cols-1.md\\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .grid-cols-1.sm\\:grid-cols-2.md\\:grid-cols-3.lg\\:grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .adventure-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .accommodation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .hover\\:scale-105:hover {
    transform: none !important;
  }

  .hover\\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
  }

  /* Ensure buttons are touch-friendly */
  button,
  .btn,
  a[role='button'] {
    min-height: 44px !important;
    min-width: 44px !important;
  }
}

/* Landscape Mobile Fixes */
@media (max-width: 767px) and (orientation: landscape) {
  .min-h-screen {
    min-height: 100vh !important;
    padding-top: 80px !important;
  }

  .hero-title h1 {
    font-size: 1.75rem !important;
  }

  .py-20 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

/* Small Mobile Devices (320px) */
@media (max-width: 374px) {
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .hero-title h1 {
    font-size: 1.75rem !important;
  }

  .hero-buttons a {
    font-size: 0.875rem !important;
    padding: 10px 16px !important;
  }

  .text-5xl {
    font-size: 1.75rem !important;
  }

  .text-4xl {
    font-size: 1.5rem !important;
  }

  .grid-cols-1.sm\\:grid-cols-2.md\\:grid-cols-3.lg\\:grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High DPI Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-background {
    background-size: cover !important;
    background-position: center !important;
  }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-title h1 {
    font-size: 3rem !important;
  }

  .grid-cols-1.md\\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .grid-cols-1.sm\\:grid-cols-2.md\\:grid-cols-3.lg\\:grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .adventure-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .accommodation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Background Typography Tablet */
  .text-\\[120px\\] {
    font-size: 80px !important;
    top: -40px !important;
    opacity: 0.04 !important;
  }
}

/* Small Mobile Devices (320px) - Background Typography */
@media (max-width: 374px) {
  .text-\\[120px\\] {
    font-size: 40px !important;
    top: -20px !important;
    opacity: 0.02 !important;
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  /* Hero Title Desktop Bold */
  .hero-title h1 {
    font-weight: 900 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
  }

  /* Adventure Swiper Desktop - Show swiper instead of grid */
  .adventure-swiper {
    display: block !important;
  }

  /* Hide desktop grid on all screen sizes to use swiper everywhere */
  .hidden.lg\\:grid {
    display: none !important;
  }

  /* Adventure Swiper Desktop styling */
  .adventure-swiper .swiper-button-next,
  .adventure-swiper .swiper-button-prev {
    display: flex !important;
    color: #ea580c !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    margin-top: -22px !important;
  }

  .adventure-swiper .swiper-button-next:hover,
  .adventure-swiper .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 1) !important;
  }

  .adventure-swiper .swiper-pagination {
    display: block !important;
    position: relative !important;
    margin-top: 2rem !important;
  }
}

/* Additional Mobile Typography Hiding Rules */
@media (max-width: 767px) {
  /* Force hide all large decorative text on mobile */
  span.absolute.text-\\[120px\\].top-\\[-60px\\] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  /* Hide by exact class match */
  .absolute.text-\\[120px\\].top-\\[-60px\\].left-1\\/2 {
    display: none !important;
  }

  /* Catch-all for large decorative text */
  .relative h2 span.absolute {
    display: none !important;
  }
}

/* Additional Mobile Footer Fixes */
@media (max-width: 767px) {
  /* Ensure no white space under footer */
  body {
    min-height: 100vh !important;
    position: relative !important;
  }

  /* Footer should stick to bottom */
  footer {
    position: relative !important;
    bottom: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 20px) !important;
  }

  /* Add padding under Privacy Policy & Terms & Conditions */
  footer .flex.flex-col.md\\:flex-row.justify-between.items-center {
    padding-bottom: 2rem !important;
  }

  /* Specific padding for the links section */
  footer .flex.items-center.space-x-6 {
    padding-bottom: 1.5rem !important;
    margin-bottom: 1rem !important;
  }

  /* Privacy Policy and Terms links spacing */
  footer a[href*='privacy'],
  footer a[href*='terms'] {
    padding-bottom: 0.5rem !important;
    display: inline-block !important;
  }

  /* Remove any default margins/padding from viewport */
  * {
    box-sizing: border-box !important;
  }

  /* Ensure main wrapper takes full height */
  main {
    flex: 1 !important;
  }

  /* Fix any iOS Safari bottom spacing */
  @supports (-webkit-touch-callout: none) {
    body {
      padding-bottom: 0 !important;
      margin-bottom: 0 !important;
    }
  }
}
