/* ==================== MOBILE OPTIMIZATIONS ==================== */
/* This file contains comprehensive mobile optimization styles */

/* ==================== MOBILE BREAKPOINTS ==================== */
/* Small phones: 320px - 480px */
/* Regular phones: 481px - 768px */
/* Tablets: 769px - 1024px */
/* Desktop: 1025px+ */

/* ==================== BASE MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    /* Improve touch targets - adjusted to be more proportional */
    a, button, input, select, textarea {
        min-height: 40px; /* Reduced from 44px for better proportion */
        min-width: 40px; /* Reduced from 44px for better proportion */
    }
    
    /* Better spacing for mobile */
    .container {
        padding: 0 20px;
    }
    
    /* Optimize font sizes for mobile readability */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Prevent horizontal scroll */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Improve section padding */
    section {
        padding: 60px 0 !important;
    }
}

/* ==================== VERY SMALL DEVICES (320px - 480px) ==================== */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    /* Even slower animations for small phones */
    .floating-whatsapp {
        animation-duration: 1s !important;
    }
    
    .page-hero {
        animation-duration: 15s !important;
    }
    
    section {
        padding: 40px 0 !important;
    }
    
    /* Ensure single column layout */
    .grid,
    .destinations-grid,
    .offers-slider,
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Stack flex items vertically */
    .flex,
    .hero-buttons,
    .contact-cta-actions {
        flex-direction: column !important;
        width: 100%;
    }
}

/* ==================== TOUCH-FRIENDLY ENHANCEMENTS ==================== */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects for touch devices */
    .card:hover,
    .btn:hover,
    .service-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* Add active states for better feedback */
    .btn:active,
    .card:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
    
    /* Improve tap targets - more responsive to content */
    .btn {
        padding: 12px 20px !important; /* Reduced padding for better proportion */
        font-size: 15px !important; /* Slightly smaller font for better balance */
        min-width: auto !important; /* Remove fixed min-width to fit content */
    }
    
    /* Disable complex animations */
    * {
        animation-duration: 0.3s !important;
    }
    
    /* Exception for floating WhatsApp button and hero background */
    .floating-whatsapp {
        animation-duration: 1s !important;
    }
    
    .page-hero {
        animation-duration: 15s !important;
    }
}

/* ==================== MOBILE NAVIGATION IMPROVEMENTS ==================== */
@media (max-width: 768px) {
    /* Sticky header adjustments */
    header {
        position: sticky;
        top: 0;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* Adjust body padding for mobile header */
    body {
        margin-top: 0 !important;
    }
    
    /* Mobile menu improvements - Navigation styles handled by header.css */
    
    /* iOS specific fixes */
    .is-ios .mobile-menu-toggle {
        transform: translateZ(0);
    }
    
    .is-ios nav.mobile-active {
        transform: translateZ(0);
    }
}

/* ==================== FORM OPTIMIZATIONS FOR MOBILE ==================== */
@media (max-width: 768px) {
    /* Improve form inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 16px 18px !important; /* Increased padding for better touch experience */
        border-radius: 12px !important;
        border: 2px solid #e1e5e9 !important;
        min-height: 52px !important; /* Better touch target */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    }
    
    /* Specific date input optimizations */
    input[type="date"] {
        background-color: #fff !important;
        color: #333 !important;
        text-align: right !important; /* RTL alignment */
        position: relative !important;
        cursor: pointer !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
    }
    
    /* Add calendar icon for date inputs */
    input[type="date"]::before {
        content: "📅" !important;
        position: absolute !important;
        right: 16px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        pointer-events: none !important;
        z-index: 1 !important;
    }
    
    /* Date input placeholder styling */
    input[type="date"]:invalid {
        color: #999 !important;
    }
    
    /* Focus state for date input */
    input[type="date"]:focus {
        border-color: var(--secondary-color) !important;
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
        outline: none !important;
    }
    
    /* Date input container improvements */
    .form-group:has(input[type="date"]) {
        position: relative !important;
    }
    
    /* Safari/WebKit specific date input fixes */
    input[type="date"]::-webkit-calendar-picker-indicator {
        background: transparent !important;
        bottom: 0 !important;
        color: transparent !important;
        cursor: pointer !important;
        height: auto !important;
        left: 0 !important;
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        width: auto !important;
        opacity: 0 !important;
    }
    
    /* Firefox date input improvements */
    input[type="date"]::-moz-focus-inner {
        border: 0 !important;
        padding: 0 !important;
    }
    
    /* Clean date input styling without pseudo-elements */
    input[type="date"] {
        position: relative !important;
        background: #fff !important;
        color: #333 !important;
        text-align: right !important;
        direction: rtl !important;
    }
    
    input[type="date"].empty-date {
        color: #999 !important;
    }
    
    input[type="date"].has-value {
        color: #333 !important;
        background-color: #f8f9fa !important;
    }
    
    input[type="date"][data-focused="true"] {
        border-color: var(--secondary-color) !important;
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
    }
    
    /* Clean up any browser-specific styling that might cause overlap */
    input[type="date"]::-webkit-calendar-picker-indicator {
        position: absolute !important;
        left: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        cursor: pointer !important;
        filter: opacity(0.7) !important;
    }
    
    /* Remove all conflicting pseudo-elements */
    input[type="date"]::before,
    input[type="date"]::after {
        display: none !important;
        content: none !important;
    }
    
    /* Stack form groups */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 25px !important; /* Increased spacing between form groups */
    }
    
    .form-group label {
        font-size: 16px !important;
        margin-bottom: 10px !important;
        font-weight: 600 !important;
        color: #333 !important;
    }
    
    /* Full width buttons with proportional padding */
    .form-group .btn,
    button[type="submit"],
    .contact-btn,
    .booking-btn {
        width: 100% !important;
        padding: 18px 20px !important; /* Increased padding for better touch */
        min-height: 56px !important; /* Better touch target */
        font-size: 16px !important;
        border-radius: 12px !important;
        margin-top: 15px !important;
    }
    
    /* Phone input improvements */
    .phone-group .phone-input {
        flex-direction: row !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        min-height: 52px !important;
    }
    
    .phone-group .phone-input select {
        max-width: 140px !important; /* Increased for better usability */
        min-width: 120px !important;
        font-size: 12px !important; /* Reduced to fit better */
        padding: 16px 10px !important; /* Increased padding since no arrow */
        border: none !important;
        background-color: transparent !important;
        background-image: none !important; /* Remove arrow completely */
        font-weight: 500 !important;
        line-height: 1.2 !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }
    
    .phone-group .phone-input input {
        padding: 16px 18px !important;
        border: none !important;
        background-color: transparent !important;
        flex: 1 !important;
    }
    
    /* Form container improvements */
    .contact-form-container,
    .booking-form-container {
        padding: 25px 20px !important;
        margin: 0 10px !important;
        border-radius: 16px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }
    
    .contact-form,
    .booking-form {
        padding: 0 !important;
    }
    
    /* Better textarea styling */
    textarea {
        min-height: 120px !important;
        resize: vertical !important;
        padding: 16px 18px !important;
    }
    
    /* Improve select styling */
    select {
        padding-left: 40px !important;
        background-size: 14px !important;
        background-position: left 16px center !important;
    }
    
    [dir="rtl"] select {
        padding-right: 40px !important;
        padding-left: 18px !important;
        background-position: right 16px center !important;
    }
}

/* ==================== VERY SMALL MOBILE FORM OPTIMIZATIONS ==================== */
@media (max-width: 480px) {
    .form-group {
        margin-bottom: 20px !important;
    }
    
    .contact-form-container,
    .booking-form-container {
        margin: 0 5px !important;
        padding: 20px 15px !important;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        padding: 14px 16px !important;
        min-height: 50px !important;
    }
    
    /* Enhanced date input for smaller screens */
    input[type="date"] {
        font-size: 16px !important;
        text-align: right !important;
    }
    
    input[type="date"].empty-date::after {
        font-size: 14px !important;
        right: 14px !important;
    }
    
    .phone-group .phone-input select {
        max-width: 110px !important;
        min-width: 100px !important;
        padding: 14px 8px !important; /* Increased padding since no arrow */
        font-size: 11px !important; /* Reduced font size */
        background-image: none !important; /* Remove arrow completely */
        font-weight: 500 !important;
        line-height: 1.2 !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }
    
    .phone-group .phone-input input {
        padding: 14px 16px !important;
    }
    
    .form-group .btn,
    button[type="submit"],
    .contact-btn,
    .booking-btn {
        padding: 16px 18px !important;
        min-height: 52px !important;
        font-size: 15px !important;
    }
    
    textarea {
        min-height: 100px !important;
        padding: 14px 16px !important;
    }
}

/* ==================== CONTACT AND BOOKING PAGE SPECIFIC MOBILE FIXES ==================== */
@media (max-width: 768px) {
    /* Contact page layout */
    .contact-content {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .contact-info-container {
        order: 2 !important;
        margin-top: 20px !important;
    }
    
    /* Booking page layout */
    .booking-options-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .booking-services-container {
        order: 2 !important;
    }
    
    /* Form headers */
    .form-header,
    .booking-form-header {
        padding: 20px 15px !important;
        border-radius: 16px 16px 0 0 !important;
    }
    
    .form-header h2,
    .booking-form-header h2 {
        font-size: 18px !important;
        margin: 0 !important;
    }
    
    /* Error and success states mobile */
    .field-error {
        font-size: 13px !important;
        margin-top: 8px !important;
        padding-left: 4px !important;
    }
    
    .form-status {
        padding: 15px 18px !important;
        margin: 15px 0 !important;
        border-radius: 12px !important;
        font-size: 14px !important;
    }
    
    /* Form focus states mobile */
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus,
    .phone-group .phone-input:focus-within {
        border-color: var(--secondary-color) !important;
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
        transform: none !important;
    }
}

/* ==================== CARD LAYOUT OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    /* Offer cards */
    .offer-card {
        margin-bottom: 20px;
        border-radius: 12px !important;
    }
    
    .offer-image {
        min-height: 180px !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .offer-image img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .offer-content {
        padding: 20px !important;
    }
    
    .offer-content h3 {
        font-size: 20px !important;
    }
    
    .offer-features {
        gap: 8px !important;
    }
    
    .offer-features span {
        font-size: 12px !important;
        padding: 4px 8px !important;
    }
    
    /* Badge sizing optimization */
    .offer-badge,
    .destination-badge,
    .offer-label {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    .offer-count {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }
    
    /* Destination cards */
    .destination-card {
        margin-bottom: 20px;
    }
    
    .destination-content {
        padding: 20px !important;
    }
    
    .destination-features {
        gap: 8px !important;
        flex-wrap: wrap;
    }
    
    .destination-features span {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    
    /* Card buttons optimization */
    .offer-card .btn,
    .offer-card .offer-btn,
    .destination-card .btn,
    .destination-card .destination-btn,
    .featured-offer-card .btn,
    .featured-offer-card .offer-btn {
        padding: 10px 18px !important; /* Reduced for better proportion */
        font-size: 14px !important;
        min-height: 46px !important; /* Maintain good touch target */
        min-width: auto !important; /* Allow buttons to size to content */
        white-space: nowrap !important; /* Prevent text wrapping */
    }
    
    /* Service cards */
    .service-card {
        padding: 25px 20px !important;
    }
    
    .service-card .icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .service-card h3 {
        font-size: 18px !important;
    }
    
    /* Contact cards */
    .contact-card {
        padding: 20px !important;
        flex-direction: column !important;
        text-align: center;
    }
    
    .contact-icon {
        margin-bottom: 15px;
    }
}

/* ==================== HERO SECTION MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    .page-hero {
        min-height: 500px !important;
        height: auto !important;
        padding: 80px 0 60px !important;
    }
    
    .page-hero h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 15px !important;
    }
    
    .page-hero p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 25px !important;
    }
    
    .page-hero .hero-badge {
        font-size: 12px !important;
        padding: 8px 16px !important; /* Proportional padding for badge */
        margin-bottom: 20px !important;
    }
    
    .page-hero .hero-buttons {
        gap: 12px !important;
    }
    
    .page-hero .hero-buttons .btn {
        width: auto !important; /* Allow buttons to size to content */
        min-width: 120px !important; /* Reasonable minimum for readability */
        max-width: 280px !important; /* Prevent buttons from being too wide */
        padding: 12px 18px !important; /* Proportional padding */
        font-size: 14px !important;
        white-space: nowrap; /* Prevent text wrapping */
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-hero {
        min-height: 450px !important;
        padding: 60px 0 40px !important;
    }
    
    .page-hero h1 {
        font-size: 1.75rem !important;
    }
    
    .page-hero p {
        font-size: 0.95rem !important;
    }
    
    /* Even more compact buttons for very small screens */
    .page-hero .hero-buttons .btn {
        min-width: 100px !important; /* Smaller minimum for very small screens */
        padding: 10px 16px !important; /* More compact padding */
        font-size: 13px !important;
    }
    
    /* Even more compact card buttons for very small screens */
    .offer-card .btn,
    .offer-card .offer-btn,
    .destination-card .btn,
    .destination-card .destination-btn,
    .featured-offer-card .btn,
    .featured-offer-card .offer-btn {
        padding: 9px 16px !important; /* Further reduced for very small screens */
        font-size: 13px !important;
        min-height: 44px !important; /* Reduced minimum height */
    }
    
    /* Hero badge for very small screens */
    .page-hero .hero-badge {
        font-size: 11px !important;
        padding: 6px 14px !important; /* Further reduced for very small screens */
    }
    
    /* Even smaller badges for very small screens */
    .offer-badge,
    .destination-badge,
    .offer-label {
        font-size: 11px !important;
        padding: 5px 10px !important;
    }
    
    .offer-count {
        font-size: 10px !important;
        padding: 2px 5px !important;
    }
}

/* ==================== ABOUT SECTION MOBILE ==================== */
@media (max-width: 768px) {
    .about-intro h3 {
        font-size: 1.75rem !important;
    }
    
    .about-highlights {
        gap: 15px !important;
    }
    
    .highlight-item {
        padding: 15px !important;
        gap: 15px !important;
    }
    
    .highlight-item i {
        font-size: 1.5rem !important;
        min-width: 30px !important;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .stat-item {
        padding: 20px 10px !important;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
    
    .mission-points {
        gap: 10px !important;
    }
}

/* ==================== CONTACT CTA MOBILE ==================== */
@media (max-width: 768px) {
    .contact-cta {
        padding: 60px 0 !important;
    }
    
    .contact-cta-text h2 {
        font-size: 1.75rem !important;
        margin-bottom: 15px !important;
    }
    
    .contact-cta-text p {
        font-size: 1rem !important;
        margin-bottom: 25px !important;
    }
    
    .contact-cta-actions {
        flex-wrap: wrap !important;
        gap: 12px !important;
        justify-content: center !important;
    }
    
    .contact-cta .btn {
        flex: 0 1 auto !important; /* Allow buttons to size to content */
        min-width: 120px !important; /* Reasonable minimum for readability */
        max-width: 200px !important; /* Prevent buttons from being too wide */
        padding: 10px 16px !important; /* Proportional padding */
        font-size: 14px !important;
        white-space: nowrap; /* Prevent text wrapping */
    }
}

@media (max-width: 480px) {
    .contact-cta .btn {
        min-width: 100px !important; /* Smaller minimum for very small screens */
        padding: 10px 14px !important; /* More compact padding */
        font-size: 13px !important;
    }
}

/* ==================== MODAL AND OVERLAY OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    .modal,
    .overlay {
        padding: 20px !important;
    }
    
    .modal-content {
        margin: 20px auto !important;
        max-height: calc(100vh - 40px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Disable parallax effects on mobile */
    .parallax {
        background-attachment: scroll !important;
    }
    
    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* ==================== ACCESSIBILITY IMPROVEMENTS ==================== */
@media (max-width: 768px) {
    /* Improve focus indicators */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid var(--secondary-color) !important;
        outline-offset: 2px !important;
    }
    
    /* Skip links for mobile */
    .skip-link:focus {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 10000;
        padding: 10px 20px;
        background: var(--primary-color);
        color: white;
        text-decoration: none;
        border-radius: 4px;
    }
}

/* ==================== LANDSCAPE MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) and (orientation: landscape) {
    .page-hero {
        min-height: 400px !important;
        padding: 40px 0 !important;
    }
    
    .page-hero h1 {
        font-size: 1.5rem !important;
    }
    
    header {
        padding: 5px 0 !important;
    }
    
    body {
        margin-top: 0 !important;
    }
}

/* ==================== SERVICE BOX MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    .service-box {
        margin-bottom: 15px;
    }
    
    .service-box h3 {
        font-size: 18px !important;
    }
    
    .service-box p {
        font-size: 14px !important;
    }
    
    .service-icon {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 15px !important;
    }
}

/* ==================== DESTINATION PAGE MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    /* Destination page specific optimizations moved to destinations.css */
}

/* ==================== OFFERS PAGE MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    .offers-grid {
        gap: 15px !important;
    }
    
    .offer-price-tag {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .price {
        font-size: 1.5rem !important;
    }
    
    .old-price {
        font-size: 1rem !important;
    }
}

/* ==================== SERVICES PAGE MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    .service-content {
        flex-direction: column !important;
    }
    
    .service-content.reverse {
        flex-direction: column-reverse !important;
    }
    
    .service-text, 
    .service-image {
        width: 100% !important;
    }
    
    .service-text {
        padding: 20px 0 !important;
    }
    
    .service-image {
        min-height: 180px !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .service-image img {
        height: auto !important;
        object-fit: contain !important;
    }
    
    .service-features {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* ==================== RTL SPECIFIC MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    [dir="rtl"] .mobile-menu-toggle {
        margin-left: -12px !important;
        margin-right: 0 !important;
    }
    
    [dir="rtl"] .offer-features span,
    [dir="rtl"] .destination-features span {
        justify-content: center !important;
    }
}

/* ==================== MOBILE CSS FIXES ==================== */
@media (max-width: 768px) {
    /* Fix for touch active state */
    .touch-active {
        transform: scale(0.98) !important;
        opacity: 0.8 !important;
        transition: all 0.1s ease !important;
    }
    
    /* Fix for 100vh issue on mobile */
    .vh-fix {
        height: calc(var(--vh, 1vh) * 100) !important;
    }
    
    /* Fix for sticky elements on iOS */
    .ios-sticky-fix {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* ==================== PRINT OPTIMIZATIONS ==================== */
@media print {
    /* Hide non-essential elements */
    .mobile-menu-toggle,
    .hero-buttons,
    .contact-cta,
    .social-links,
    nav {
        display: none !important;
    }
    
    /* Optimize layout for printing */
    body {
        font-size: 12pt;
        line-height: 1.5;
        margin: 0;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
} 