/* 
 * BestTravelHacks.net - Responsive Styles
 * Mobile-first responsive design optimizations
 */

/* ==========================================================================
   Mobile First Approach - Base styles are mobile
   ========================================================================== */

/* Mobile Optimizations (Default) */
.hero-bg {
    background-attachment: scroll; /* Better performance on mobile */
}

.cta-button {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
}

/* ==========================================================================
   Tablet Styles (768px and up)
   ========================================================================== */

@media (min-width: 768px) {
    .hero-bg {
        background-attachment: fixed; /* Parallax effect on larger screens */
    }
    
    .cta-button {
        font-size: 1rem;
        padding: 1rem 2rem;
    }
    
    .card-hover:hover {
        transform: translateY(-5px);
    }
}

/* ==========================================================================
   Desktop Styles (1024px and up)
   ========================================================================== */

@media (min-width: 1024px) {
    .section-spacing {
        padding: 6rem 0;
    }
    
    .hero-section {
        min-height: 100vh;
        display: flex;
        align-items: center;
    }
}

/* ==========================================================================
   Large Desktop Styles (1280px and up)
   ========================================================================== */

@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
}

/* ==========================================================================
   Mobile Specific Optimizations
   ========================================================================== */

@media (max-width: 767px) {
    /* Header Mobile Optimizations */
    header nav {
        padding: 0.75rem 1rem !important;
    }

    header nav img {
        height: 2rem !important; /* Reduce logo from h-12 to smaller */
    }

    header nav .cta-button {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Container padding reduction */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Hero Section Mobile */
    .hero-bg {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .hero-bg h1 {
        font-size: 1.875rem !important; /* Reduce from 4xl to smaller */
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }

    .hero-bg p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Stack hero benefits vertically */
    .hero-bg .flex.space-x-6 {
        flex-direction: column !important;
        space-x: 0 !important;
        gap: 0.75rem !important;
        align-items: center !important;
    }

    /* Disable hover effects on mobile for better performance */
    .card-hover:hover {
        transform: none;
    }

    /* Optimize text sizes for mobile */
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    /* Stack elements vertically on mobile */
    .mobile-stack {
        flex-direction: column;
    }

    /* Improve touch targets */
    .cta-button {
        min-height: 48px;
        min-width: 48px;
        width: 100%;
        max-width: 100%;
    }

    /* Main section spacing */
    main {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    main section {
        margin-bottom: 3rem !important;
    }

    /* Email capture section */
    .border-4.border-teal-400 {
        padding: 1.5rem !important;
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }

    .border-4.border-teal-400 h3 {
        font-size: 1.5rem !important;
    }

    .border-4.border-teal-400 img {
        max-width: 200px !important;
        margin: 0 auto !important;
    }

    /* Form spacing */
    .border-4.border-teal-400 .flex.space-x-6 {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: center !important;
    }

    /* Optimize forms for mobile */
    input[type="email"],
    input[type="text"] {
        font-size: 16px !important; /* Prevent zoom on iOS */
        width: 100% !important;
    }

    /* Stack form fields vertically on mobile */
    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Feature cards */
    .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .bg-white.p-8 {
        padding: 1.5rem !important;
    }

    /* Section headings */
    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Comparison Table - Horizontal Scroll */
    .overflow-x-auto {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    table {
        min-width: 600px !important;
        font-size: 0.75rem !important;
    }

    table th,
    table td {
        padding: 0.5rem !important;
        white-space: nowrap !important;
    }

    table th {
        font-size: 0.75rem !important;
    }

    table th i {
        font-size: 1rem !important;
    }

    /* Improve cookie banner on mobile */
    #cookie-banner {
        padding: 1rem;
    }

    #cookie-banner .container {
        flex-direction: column;
        gap: 1rem;
    }

    /* Optimize comparison table for mobile */
    .comparison-table {
        font-size: 0.875rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
    }

    /* FAQ optimization for mobile */
    details summary {
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    details .p-6 {
        padding: 1rem !important;
    }

    .faq-section {
        padding: 1rem;
    }

    /* Countdown timer */
    #countdown-container {
        gap: 0.5rem !important;
    }

    #countdown-container > div {
        min-width: 60px !important;
    }

    #countdown-container .text-2xl {
        font-size: 1.5rem !important;
    }

    /* Final CTA section */
    .border-4.border-teal-400.py-20 {
        padding: 2rem !important;
    }

    /* Footer */
    footer .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }

    footer .text-right {
        text-align: center !important;
    }

    footer .flex.justify-end {
        justify-content: center !important;
    }

    footer .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Trust badges responsive layout */
    .trust-badges {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .trust-badge {
        flex: 1 1 45%;
        min-width: 120px;
    }
}

/* ==========================================================================
   High DPI / Retina Display Optimizations
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-bg {
        background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=4148&q=80');
    }
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .pulse-animation,
    .card-hover,
    .cta-button {
        animation: none;
        transition: none;
    }
}

@media (prefers-color-scheme: dark) {
    /* Optional: Dark mode support for system preference */
    .bg-white {
        background-color: #1f2937 !important;
    }
    
    .bg-gray-50 {
        background-color: #374151 !important;
    }
    
    .hover\:bg-gray-100:hover {
        background-color: #4b5563 !important;
    }
    
    .text-gray-900 {
        color: #f9fafb !important;
    }
    
    .text-gray-700 {
        color: #f9fafb !important;
    }
    
    .text-gray-600 {
        color: #f3f4f6 !important;
    }
    
    .text-gray-500 {
        color: #d1d5db !important;
    }
}

/* ==========================================================================
   Landscape Mobile Optimization
   ========================================================================== */

@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
}