/*
 * index-mobile.css - Homepage Mobile Responsive Enhancements
 * Lazzora Voyages - Mobile-First Design
 * Version: 1.0.0 - Complete Mobile Optimization
 */

/* ==================== MOBILE LOADING OVERLAY FIXES ==================== */

@media (max-width: 768px) {
  #loading-overlay {
    padding: var(--mobile-spacing-lg);
  }
  
  .loading-text {
    font-size: var(--mobile-text-lg);
    margin-bottom: var(--mobile-spacing-md);
    padding: 0 var(--mobile-spacing-md);
    text-align: center;
    line-height: 1.4;
  }
  
  .spinner {
    width: 50px;
    height: 50px;
    margin-bottom: var(--mobile-spacing-lg);
  }
  
  .progress {
    width: 280px;
    height: 4px;
    margin-top: var(--mobile-spacing-md);
  }
  
  .loading-stages {
    margin-top: var(--mobile-spacing-lg);
    gap: var(--mobile-spacing-sm);
  }
  
  .loading-stage {
    width: 10px;
    height: 10px;
  }
  
  .loading-tip {
    font-size: var(--mobile-text-sm);
    margin-top: var(--mobile-spacing-md);
    max-width: 280px;
    padding: var(--mobile-spacing-sm) var(--mobile-spacing-md);
  }
}

@media (max-width: 480px) {
  .loading-text {
    font-size: var(--mobile-text-base);
    padding: 0 var(--mobile-spacing-sm);
  }
  
  .spinner {
    width: 40px;
    height: 40px;
  }
  
  .progress {
    width: 240px;
    height: 3px;
  }
  
  .loading-tip {
    font-size: var(--mobile-text-xs);
    max-width: 240px;
  }
}

/* ==================== MOBILE MAIN CONTENT LAYOUT ==================== */

#main-content {
  min-height: 100vh;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  #main-content .section {
    padding: var(--mobile-spacing-xl) 0;
    margin-bottom: 0;
  }
  
  #main-content .inner-container {
    max-width: 100%;
    padding: 0 var(--mobile-spacing-md);
  }
}

@media (max-width: 480px) {
  #main-content .section {
    padding: var(--mobile-spacing-lg) 0;
  }
  
  #main-content .inner-container {
    padding: 0 var(--mobile-spacing-sm);
  }
}

/* ==================== HERO SLIDER MOBILE OPTIMIZATION ==================== */

#hero-slider-container {
  min-height: 70vh;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  #hero-slider-container {
    min-height: 60vh;
    max-height: 600px;
  }
  
  /* Hero content mobile optimization */
  .hero-slide {
    background-size: cover;
    background-position: center;
    background-attachment: scroll; /* Better mobile performance */
  }
  
  .hero-content {
    padding: var(--mobile-spacing-lg);
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
  }
  
  .hero-title {
    font-size: var(--mobile-text-2xl);
    margin-bottom: var(--mobile-spacing-sm);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  }
  
  .hero-subtitle {
    font-size: var(--mobile-text-base);
    margin-bottom: var(--mobile-spacing-md);
    color: rgba(255,255,255,0.9);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  }
  
  .hero-cta {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 14px 28px;
    font-size: var(--mobile-text-base);
  }
}

@media (max-width: 480px) {
  #hero-slider-container {
    min-height: 50vh;
    max-height: 500px;
  }
  
  .hero-title {
    font-size: var(--mobile-text-xl);
  }
  
  .hero-subtitle {
    font-size: var(--mobile-text-sm);
  }
  
  .hero-content {
    padding: var(--mobile-spacing-md);
  }
}

/* ==================== ABOUT SRI LANKA SECTION MOBILE ==================== */

#about-srilanka-container {
  background: var(--bg-secondary);
}

@media (max-width: 768px) {
  .about-content {
    text-align: center;
  }
  
  .about-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--mobile-spacing-lg);
    margin-top: var(--mobile-spacing-lg);
  }
  
  .about-feature {
    padding: var(--mobile-spacing-lg);
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
  }
  
  .about-feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--mobile-spacing-md);
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--mobile-text-xl);
  }
  
  .about-feature-title {
    font-size: var(--mobile-text-lg);
    margin-bottom: var(--mobile-spacing-sm);
    color: var(--text-primary);
  }
  
  .about-feature-description {
    font-size: var(--mobile-text-base);
    color: var(--text-secondary);
    line-height: 1.6;
  }
}

@media (max-width: 480px) {
  .about-feature {
    padding: var(--mobile-spacing-md);
  }
  
  .about-feature-icon {
    width: 50px;
    height: 50px;
    font-size: var(--mobile-text-lg);
  }
}

/* ==================== FEATURED PACKAGES MOBILE OPTIMIZATION ==================== */

#featured-packages-container {
  background: var(--bg-primary);
}

@media (max-width: 768px) {
  .packages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--mobile-spacing-lg);
    margin-top: var(--mobile-spacing-lg);
  }
  
  .package-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    margin-bottom: var(--mobile-spacing-md);
  }
  
  .package-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  }
  
  .package-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-size: cover;
    background-position: center;
  }
  
  .package-content {
    padding: var(--mobile-spacing-lg);
  }
  
  .package-title {
    font-size: var(--mobile-text-lg);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--mobile-spacing-sm);
    color: var(--text-primary);
    line-height: 1.3;
  }
  
  .package-description {
    font-size: var(--mobile-text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--mobile-spacing-md);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .package-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mobile-spacing-xs);
    margin-bottom: var(--mobile-spacing-md);
  }
  
  .package-feature {
    background: var(--bg-orange-light);
    color: var(--primary-orange);
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-size: var(--mobile-text-xs);
    font-weight: var(--font-weight-medium);
  }
  
  .package-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--mobile-spacing-md);
    border-top: 1px solid var(--border-gray);
  }
  
  .package-price {
    font-size: var(--mobile-text-lg);
    font-weight: var(--font-weight-bold);
    color: var(--primary-orange);
  }
  
  .package-duration {
    font-size: var(--mobile-text-sm);
    color: var(--text-muted);
  }
  
  .package-cta {
    width: 100%;
    margin-top: var(--mobile-spacing-md);
    padding: 12px;
    font-size: var(--mobile-text-base);
    border-radius: var(--border-radius-lg);
  }
}

@media (max-width: 480px) {
  .package-image {
    height: 180px;
  }
  
  .package-content {
    padding: var(--mobile-spacing-md);
  }
  
  .package-title {
    font-size: var(--mobile-text-base);
  }
  
  .package-footer {
    flex-direction: column;
    gap: var(--mobile-spacing-sm);
    align-items: flex-start;
  }
}

/* ==================== DESTINATIONS SECTION MOBILE ==================== */

#destinations-container {
  background: var(--bg-tertiary);
}

@media (max-width: 768px) {
  .destinations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--mobile-spacing-md);
    margin-top: var(--mobile-spacing-lg);
  }
  
  .destination-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
  }
  
  .destination-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
  
  .destination-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-size: cover;
    background-position: center;
  }
  
  .destination-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--mobile-spacing-lg);
  }
  
  .destination-title {
    color: white;
    font-size: var(--mobile-text-lg);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--mobile-spacing-xs);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  }
  
  .destination-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: var(--mobile-text-sm);
    margin-bottom: var(--mobile-spacing-sm);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  }
  
  .destination-features {
    display: flex;
    gap: var(--mobile-spacing-xs);
    flex-wrap: wrap;
  }
  
  .destination-feature {
    background: rgba(255, 87, 34, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-size: var(--mobile-text-xs);
    font-weight: var(--font-weight-medium);
  }
}

@media (max-width: 480px) {
  .destination-image {
    height: 160px;
  }
  
  .destination-overlay {
    padding: var(--mobile-spacing-md);
  }
  
  .destination-title {
    font-size: var(--mobile-text-base);
  }
}

/* ==================== TESTIMONIALS SECTION MOBILE ==================== */

#testimonials-container {
  background: var(--bg-primary);
}

@media (max-width: 768px) {
  .testimonials-carousel {
    margin-top: var(--mobile-spacing-lg);
  }
  
  .testimonial-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-xl);
    padding: var(--mobile-spacing-lg);
    margin: 0 var(--mobile-spacing-sm);
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
  }
  
  .testimonial-quote {
    font-size: var(--mobile-text-base);
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--mobile-spacing-lg);
    font-style: italic;
    position: relative;
  }
  
  .testimonial-quote::before {
    content: '"';
    font-size: 3rem;
    color: var(--primary-orange);
    position: absolute;
    top: -10px;
    left: -10px;
    line-height: 1;
  }
  
  .testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--mobile-spacing-md);
    justify-content: center;
  }
  
  .author-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-orange);
  }
  
  .author-details {
    text-align: left;
  }
  
  .author-name {
    font-size: var(--mobile-text-base);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 2px;
  }
  
  .author-location {
    font-size: var(--mobile-text-sm);
    color: var(--text-muted);
  }
  
  .testimonial-rating {
    margin-top: var(--mobile-spacing-sm);
    display: flex;
    justify-content: center;
    gap: 2px;
  }
  
  .testimonial-rating i {
    color: var(--primary-orange);
    font-size: var(--mobile-text-sm);
  }
  
  /* Carousel navigation for mobile */
  .carousel-control-prev,
  .carousel-control-next {
    width: 40px;
    height: 40px;
    background: var(--primary-orange);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
  }
  
  .carousel-control-prev {
    left: -20px;
  }
  
  .carousel-control-next {
    right: -20px;
  }
  
  .carousel-indicators {
    bottom: -40px;
  }
  
  .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-orange);
    opacity: 0.5;
  }
  
  .carousel-indicators .active {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .testimonial-card {
    padding: var(--mobile-spacing-md);
    margin: 0;
  }
  
  .testimonial-author {
    flex-direction: column;
    gap: var(--mobile-spacing-sm);
  }
  
  .author-details {
    text-align: center;
  }
  
  .author-image {
    width: 40px;
    height: 40px;
  }
}

/* ==================== CALL-TO-ACTION MOBILE OPTIMIZATION ==================== */

.cta-section {
  background: var(--gradient-primary);
  color: white;
  text-align: center;
  padding: var(--mobile-spacing-xl) 0;
}

@media (max-width: 768px) {
  .cta-section {
    padding: var(--mobile-spacing-lg) 0;
  }
  
  .cta-title {
    font-size: var(--mobile-text-2xl);
    margin-bottom: var(--mobile-spacing-md);
  }
  
  .cta-subtitle {
    font-size: var(--mobile-text-base);
    margin-bottom: var(--mobile-spacing-lg);
    opacity: 0.9;
  }
  
  .cta-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--mobile-spacing-md);
    align-items: center;
  }
  
  .cta-primary,
  .cta-secondary {
    width: 100%;
    max-width: 280px;
    padding: 14px 28px;
    font-size: var(--mobile-text-base);
    border-radius: var(--border-radius-lg);
  }
  
  .cta-primary {
    background: white;
    color: var(--primary-orange);
    border: 2px solid white;
  }
  
  .cta-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
  }
}

@media (max-width: 480px) {
  .cta-title {
    font-size: var(--mobile-text-xl);
  }
  
  .cta-subtitle {
    font-size: var(--mobile-text-sm);
  }
}

/* ==================== MOBILE NAVIGATION ENHANCEMENTS ==================== */

@media (max-width: 768px) {
  /* Floating action button for mobile */
  .mobile-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--mobile-text-xl);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transition: var(--transition-smooth);
    text-decoration: none;
  }
  
  .mobile-fab:hover {
    transform: scale(1.1);
    color: white;
    text-decoration: none;
  }
  
  /* Sticky mobile header adjustments */
  .mobile-header-sticky {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-gray);
  }
}

/* ==================== MOBILE SCROLL BEHAVIOR ==================== */

@media (max-width: 768px) {
  /* Smooth scrolling for mobile */
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
  }
  
  /* Better mobile scroll performance */
  #main-content {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Scroll indicators */
  .section {
    scroll-margin-top: 80px;
  }
}

/* ==================== MOBILE ERROR STATES ==================== */

@media (max-width: 768px) {
  #error-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: var(--mobile-spacing-md);
    font-size: var(--mobile-text-sm);
  }
  
  .template-fallback {
    padding: var(--mobile-spacing-lg);
    margin: var(--mobile-spacing-md);
  }
  
  .template-fallback h2 {
    font-size: var(--mobile-text-xl);
  }
  
  .template-fallback p {
    font-size: var(--mobile-text-sm);
  }
}

/* ==================== MOBILE PERFORMANCE OPTIMIZATIONS ==================== */

@media (max-width: 768px) {
  /* Optimize animations for mobile */
  .animate-in,
  .fade-in,
  .slide-in-left,
  .slide-in-right {
    animation-duration: 0.3s;
    animation-timing-function: ease-out;
  }
  
  /* Reduce motion for better performance */
  @media (prefers-reduced-motion: reduce) {
    .animate-in,
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .package-card,
    .destination-card,
    .testimonial-card {
      animation: none !important;
      transition: none !important;
    }
  }
  
  /* Better mobile images */
  .package-image,
  .destination-image,
  .author-image {
    loading: lazy;
    decoding: async;
  }
}

/* ==================== MOBILE UTILITIES ==================== */

@media (max-width: 768px) {
  /* Mobile-specific utilities */
  .mobile-full-width {
    width: 100% !important;
    max-width: none !important;
  }
  
  .mobile-center {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  .mobile-stack > * {
    margin-bottom: var(--mobile-spacing-md) !important;
  }
  
  .mobile-stack > *:last-child {
    margin-bottom: 0 !important;
  }
  
  .mobile-gap-small {
    gap: var(--mobile-spacing-sm) !important;
  }
  
  .mobile-gap-medium {
    gap: var(--mobile-spacing-md) !important;
  }
  
  .mobile-gap-large {
    gap: var(--mobile-spacing-lg) !important;
  }
}

/* ==================== MOBILE ACCESSIBILITY ENHANCEMENTS ==================== */

@media (max-width: 768px) {
  /* Larger touch targets */
  button,
  .btn,
  a {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
  }
  
  /* Better focus indicators */
  *:focus-visible {
    outline: 3px solid var(--primary-orange);
    outline-offset: 2px;
  }
  
  /* Skip to content for mobile */
  .skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-orange);
    color: white;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    z-index: 10000;
    transition: top 0.3s;
  }
  
  .skip-to-content:focus {
    top: 6px;
  }
}

/* ==================== LANDSCAPE ORIENTATION OPTIMIZATIONS ==================== */

@media (max-width: 768px) and (orientation: landscape) {
  #hero-slider-container {
    min-height: 100vh;
  }
  
  .section {
    padding: var(--mobile-spacing-md) 0;
  }
  
  .hero-content {
    padding: var(--mobile-spacing-md);
  }
}

/* ==================== MOBILE DEBUGGING (REMOVE IN PRODUCTION) ==================== */

/* Uncomment for mobile debugging */
/*
@media (max-width: 768px) {
  .debug-mobile {
    position: relative;
  }
  
  .debug-mobile::before {
    content: 'MOBILE';
    position: fixed;
    top: 0;
    right: 0;
    background: red;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    z-index: 10000;
  }
}

@media (max-width: 480px) {
  .debug-mobile::before {
    content: 'MOBILE-SM';
  }
}
*/

/* ==================== END OF MOBILE CSS ==================== */

/*
 * USAGE INSTRUCTIONS:
 * 
 * 1. Add this file to your css/ folder
 * 2. Link in index.html AFTER your existing CSS:
 *    <link rel="stylesheet" href="css/index-mobile.css">
 * 
 * 3. Test on multiple devices:
 *    - iPhone SE (320px)
 *    - iPhone 12 (390px) 
 *    - iPad Mini (768px)
 *    - Android phones (360px-414px)
 * 
 * 4. Mobile-First Approach:
 *    - Base styles work on mobile
 *    - Enhanced for larger screens
 *    - Touch-friendly interactions
 *    - Performance optimized
 * 
 * 5. Key Features:
 *    ✅ Responsive hero slider
 *    ✅ Mobile-optimized cards
 *    ✅ Touch-friendly buttons
 *    ✅ Stacked layouts on mobile
 *    ✅ Optimized images
 *    ✅ Better typography
 *    ✅ Accessibility compliant
 *    ✅ Performance optimized
 */