/* ========================================
   INDEX PAGE OPTIMIZED CSS
   ========================================
   This file contains all styles for the index page
   for better performance and maintainability
   ======================================== */

/* ========================================
   RESPONSIVE HERO CAROUSEL STYLES
   ======================================== */

/* Base styles for hero carousel container */
.hero-carousel-container {
    margin: 2rem 0 !important;
    align-items: stretch;
}

/* Responsive image styles */
.img-brahim,
.img-brahim_ye {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.img-brahim:hover,
.img-brahim_ye:hover {
    transform: scale(1.02);
}

/* ========================================
   DESKTOP STYLES (992px and up)
   ======================================== */
@media (min-width: 992px) {
    .carousel-wrapper {
        padding-right: 1rem;
    }
    
    .best-selling-carousel-section {
        padding-left: 1rem;
    }
    
    .hero-carousel-container {
        align-items: stretch;
    }
    
    .best-selling-carousel-section .tour-card {
        margin: 1rem;
    }
    
    .best-selling-carousel-section .tour-image {
        height: 250px;
    }
}

/* ========================================
   TABLET STYLES (768px to 991px)
   ======================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .carousel-wrapper {
        padding-right: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .best-selling-carousel-section {
        padding-left: 0.5rem;
    }
    
    .best-selling-carousel-section .tour-card {
        margin: 0.8rem;
    }
    
    .best-selling-carousel-section .tour-image {
        height: 252px;
    }
}

/* ========================================
   MOBILE STYLES (up to 767px)
   ======================================== */
@media (max-width: 767.98px) {
    .hero-carousel-container {
        margin: 1rem 0 !important;
    }
    
    .carousel-wrapper {
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }
    
    .best-selling-carousel-section {
        padding: 0 0.5rem;
    }
    
    .best-selling-carousel-section .section-header {
        padding: 1rem;
    }
    
    .best-selling-carousel-section .section-title {
        font-size: 1.5rem !important;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .best-selling-carousel-section .section-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .best-selling-carousel-section .tour-card {
        margin: 0.5rem;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .best-selling-carousel-section .tour-image {
        height: 252px;
        object-fit: cover;
    }
    
    .best-selling-carousel-section .tour-title {
        font-size: 16px;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }
    
    .best-selling-carousel-section .book-now-btn {
        padding: 0.6rem 1.2rem;
        font-size: 16px;
        border-radius: 8px;
    }
    
    .best-selling-carousel-section .best-seller-badge,
    .best-selling-carousel-section .discount-badge,
    .best-selling-carousel-section .tour-type-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .best-selling-carousel-section .carousel-navigation {
        margin-top: 1.5rem;
        display: flex;
        justify-content: center;
        gap: 1rem;
    }
    
    .best-selling-carousel-section .carousel-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: none;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .best-selling-carousel-section .carousel-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
}

/* ========================================
   ENHANCED GALLERY CAROUSEL STYLES
   ======================================== */

/* Base carousel styles */
#image-carousel {
    margin: 66px auto 0;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px;
}

#image-carousel .splide__track {
    border-radius: 15px;
    overflow: hidden;
}

#image-carousel .splide__list {
    align-items: center;
}

#image-carousel .splide__slide {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* Dual Image Container */
#image-carousel .dual-image-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

#image-carousel .image-wrapper {
    flex: 1;
    max-width: 48%;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    border: 3px solid transparent;
}

#image-carousel .image-wrapper:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

#image-carousel .img-brahim {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: all 0.4s ease;
    object-fit: cover;
    min-height: 200px;
    max-height: 400px;
}

#image-carousel .image-wrapper:hover .img-brahim {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.1);
}

/* Image Overlay Effect */
#image-carousel .image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    z-index: 1;
}

#image-carousel .image-wrapper:hover::before {
    opacity: 1;
}

/* Loading Animation */
#image-carousel .img-brahim {
    opacity: 0;
    animation: fadeInImage 0.6s ease forwards;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Custom Navigation Arrows */
#image-carousel .splide__arrows {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: none;
}

#image-carousel .splide__arrow {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

#image-carousel .splide__arrow:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#image-carousel .splide__arrow--prev {
    left: -25px;
}

#image-carousel .splide__arrow--next {
    right: -25px;
}

/* Pagination Dots */
#image-carousel .splide__pagination {
    bottom: -40px;
    padding: 0;
}

#image-carousel .splide__pagination__page {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e0;
    border: none;
    margin: 0 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

#image-carousel .splide__pagination__page.is-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.3);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* ========================================
   RESPONSIVE GALLERY CAROUSEL STYLES
   ======================================== */

/* Large Desktop (1400px and up) */
@media (min-width: 1400px) {
    #image-carousel .dual-image-container {
        gap: 40px;
    }
    
    #image-carousel .img-brahim {
        max-height: 500px;
    }
}

/* Desktop (1200px and up) */
@media (min-width: 1200px) {
    #image-carousel {
        margin: 0px auto 0;
        padding: 30px;
        border-radius: 25px;
    }
    
    #image-carousel .dual-image-container {
        gap: 30px;
        max-width: 1400px;
    }
    
    #image-carousel .image-wrapper {
        border-radius: 20px;
    }
    
    #image-carousel .img-brahim {
        border-radius: 17px;
        min-height: 250px;
        max-height: 450px;
    }
    
    #image-carousel .splide__arrow {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }
    
    #image-carousel .splide__arrow--prev {
        left: -30px;
    }
    
    #image-carousel .splide__arrow--next {
        right: -30px;
    }
}

/* Tablet (768px to 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    #image-carousel {
        margin: 50px auto 0;
        padding: 20px;
        border-radius: 20px;
    }
    
    #image-carousel .dual-image-container {
        gap: 20px;
    }
    
    #image-carousel .image-wrapper {
        border-radius: 15px;
    }
    
    #image-carousel .img-brahim {
        border-radius: 12px;
        min-height: 180px;
        max-height: 350px;
    }
    
    #image-carousel .splide__arrow {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    #image-carousel .splide__arrow--prev {
        left: -22px;
    }
    
    #image-carousel .splide__arrow--next {
        right: -22px;
    }
}

/* Mobile Landscape (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    #image-carousel {
        margin: 30px 8px 0;
        padding: 12px;
        border-radius: 15px;
    }
    
    #image-carousel .dual-image-container {
        gap: 12px;
    }
    
    #image-carousel .image-wrapper {
        border-radius: 10px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    }
    
    #image-carousel .img-brahim {
        border-radius: 8px;
        min-height: 160px;
        max-height: 260px;
        object-fit: cover;
    }
    
    #image-carousel .splide__arrow {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    #image-carousel .splide__arrow--prev {
        left: -17px;
    }
    
    #image-carousel .splide__arrow--next {
        right: -17px;
    }
    
    #image-carousel .splide__pagination {
        bottom: -25px;
    }
}

/* Mobile Portrait (up to 575px) */
@media (max-width: 575px) {
    #image-carousel {
        margin: 20px 5px 0;
        padding: 10px;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    
    #image-carousel .dual-image-container {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    #image-carousel .image-wrapper {
        max-width: 100%;
        width: 100%;
        border-radius: 10px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    #image-carousel .img-brahim {
        border-radius: 8px;
        min-height: 220px;
        max-height: 280px;
        width: 100%;
        object-fit: cover;
    }
    
    /* Hide arrows on very small screens and use swipe */
    #image-carousel .splide__arrow {
        display: none;
    }
    
    /* Style pagination for mobile */
    #image-carousel .splide__pagination {
        bottom: -25px;
        text-align: center;
    }
    
    #image-carousel .splide__pagination__page {
        width: 8px;
        height: 8px;
        margin: 0 3px;
        background: #cbd5e0;
        border-radius: 50%;
        transition: all 0.3s ease;
    }
    
    #image-carousel .splide__pagination__page.is-active {
        background: #667eea;
        transform: scale(1.2);
    }
    
    /* Add swipe indicator */
    #image-carousel::after {
        content: "← Swipe →";
        position: absolute;
        bottom: -50px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 12px;
        color: #64748b;
        font-weight: 500;
    }
}

/* Extra Small Mobile (up to 400px) */
@media (max-width: 400px) {
    #image-carousel {
        margin: 15px 3px 0;
        padding: 8px;
        border-radius: 10px;
    }
    
    #image-carousel .dual-image-container {
        gap: 8px;
        padding: 5px;
    }
    
    #image-carousel .image-wrapper {
        width: 100%;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    }
    
    #image-carousel .img-brahim {
        min-height: 200px;
        max-height: 250px;
        border-radius: 6px;
        object-fit: cover;
    }
    
    #image-carousel .splide__pagination {
        bottom: -20px;
    }
    
    #image-carousel .splide__pagination__page {
        width: 6px;
        height: 6px;
        margin: 0 2px;
    }
    
    #image-carousel::after {
        bottom: -40px;
        font-size: 11px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* No Images State */
#image-carousel .no-images {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

#image-carousel .no-images h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #475569;
}

/* Loading State */
#image-carousel .loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   ACCESSIBILITY & SPECIAL CASES
   ======================================== */

/* Accessibility Improvements */
#image-carousel .splide__arrow:focus,
#image-carousel .splide__pagination__page:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Smooth Transitions */
#image-carousel * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #image-carousel .img-brahim {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    
    
    #image-carousel .image-wrapper {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    #image-carousel .no-images h3 {
        color: #e2e8f0;
    }
}

/* Print Styles */
@media print {
    #image-carousel .splide__arrow,
    #image-carousel .splide__pagination {
        display: none !important;
    }
    
    #image-carousel {
        box-shadow: none;
        margin: 20px 0;
    }
}

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

/* Optimize animations for performance */
#image-carousel .image-wrapper,
#image-carousel .img-brahim {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    #image-carousel *,
    .hero-carousel-container *,
    .best-selling-carousel-section * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   MOBILE SPECIFIC OPTIMIZATIONS
   ======================================== */

/* Mobile specific styles for main content */
@media (max-width: 768px) {
    main.site-main.page-spacing {
        margin-top: 0rem !important;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .best-selling-carousel-section .carousel-btn {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .best-selling-carousel-section .book-now-btn {
        min-height: 44px;
        padding: 12px 16px;
    }
}
