/* ============================================
   MOBILE FIXES
   Addressing specific resolution issues:
   375x667, 414x896, 390x844, 430x932, 412x915, 360x740
   ============================================ */

/* Ensure global overflow protection */
html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Hide mobile socials by default (desktop) */
.mobile-socials {
    display: none;
}

/* General Mobile Adjustments (max-width: 480px covers most phones) */
@media (max-width: 480px) {

    /* Reduce container padding to prevent content squeezing or overflow */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Navbar adjustments */
    .navbar .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar-logo {
        font-size: 1.75rem;
        /* Slightly smaller logo */
    }

    /* Booking Section Fixes */
    .booking-form,
    .calendar-wrapper {
        padding: 1rem !important;
        /* Reduce padding from 2rem to 1rem */
        width: 100% !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    .booking-container {
        gap: 1.5rem;
        /* Reduce gap between calendar and form */
        width: 100% !important;
        padding: 0 !important;
        margin: 1.5rem 0 0 0 !important;
        display: flex;
        flex-direction: column;
    }

    /* Ensure form inputs don't overflow */
    .form-input,
    .form-select,
    .form-textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Floating Buttons Fixes */
    /* Move them closer to the edge but ensure they are visible */
    .floating-buttons {
        right: 1rem;
        bottom: 1rem;
        z-index: 9999;
        /* Ensure they are on top of everything */
    }

    .floating-btn {
        width: 50px;
        /* Smaller buttons */
        height: 50px;
    }

    .floating-btn i {
        font-size: 1.25rem !important;
        /* Adjust icon size */
    }

    /* Hero Section Fixes */
    .hero-title {
        font-size: 3rem;
        /* Prevent title from causing overflow */
        line-height: 1.1;
    }

    .hero-tagline {
        font-size: 1.2rem;
    }
}

/* Specific fixes for 390px - 430px range (Modern iPhones/Androids) */
@media (min-width: 390px) and (max-width: 430px) {
    .floating-buttons {
        right: 1.25rem;
        /* Give a bit more breathing room on slightly larger phones */
        bottom: 1.25rem;
    }
}

/* Specific fixes for very small screens (360px and below) */
@media (max-width: 370px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .navbar .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .floating-buttons {
        right: 0.5rem;
        bottom: 0.5rem;
    }

    .floating-btn {
        width: 45px;
        height: 45px;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

/* Fix for "totally off screen" issue on 390x844 */
/* Sometimes caused by fixed width elements */
img,
video,
iframe,
canvas {
    max-width: 100%;
    height: auto;
}

/* Override for Hero Video to ensure it covers the screen (fixing portrait mode) */
#hero-video {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    max-width: none !important;
    /* Ensure it can go wider than container to cover */
}

/* Ensure the mobile menu doesn't overflow and is visible */
@media (max-width: 768px) {

    /* Ensure toggle is visible and clickable */
    .navbar-toggle {
        display: flex !important;
        z-index: 1002;
        /* Higher than menu */
        position: relative;
    }

    .navbar-toggle span {
        box-shadow: 0 0 8px rgba(245, 9, 0, 0.6);
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        /* Better for mobile browsers */
        /* Premium Gradient Background */
        background: radial-gradient(circle at 100% 0%, rgba(20, 20, 35, 0.98) 0%, rgba(5, 5, 10, 0.99) 100%);
        backdrop-filter: blur(15px);
        padding-top: 90px;
        /* Space for header */
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 3vh;
        /* Dynamic gap */
        overflow: hidden;
        /* No scrolling */
        padding-bottom: 2rem;

        /* Animation: Slide from right */
        transform: translateX(100%);
        opacity: 1;
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

        z-index: 1001;
        /* High z-index */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* Compact layout for screens shorter than 750px */
    @media (max-height: 750px) {
        .navbar-menu {
            padding-top: 70px;
            gap: 2vh;
        }

        .navbar-menu a {
            font-size: 2rem !important;
            padding: 0.25rem 1rem !important;
        }

        .mobile-socials {
            margin-bottom: 1.5rem !important;
        }
    }

    /* Ultra-compact for very short screens (< 600px) */
    @media (max-height: 600px) {
        .navbar-menu {
            padding-top: 60px;
            gap: 1.5vh;
            justify-content: center;
        }

        .navbar-menu a {
            font-size: 1.5rem !important;
            padding: 0 !important;
        }

        .mobile-socials {
            margin-bottom: 5px !important;
            margin-top: 10px !important;
        }

        .mobile-socials a {
            width: 40px !important;
            height: 40px !important;
            font-size: 1.2rem !important;
            padding: 5px !important;
        }
    }

    .navbar-menu.active {
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: auto;
    }

    .navbar-menu li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .navbar-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Staggered Animation Delays */
    .navbar-menu li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .navbar-menu li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .navbar-menu li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .navbar-menu li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .navbar-menu li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .navbar-menu li:nth-child(6) {
        transition-delay: 0.35s;
    }

    /* Socials delay */
    .navbar-menu li.mobile-socials {
        transition-delay: 0.4s;
    }

    .navbar-menu a {
        font-family: var(--font-heading);
        font-size: 2.5rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.7);
        text-transform: uppercase;
        letter-spacing: 2px;
        position: relative;
        padding: 0.5rem 1rem;
        display: inline-block;
        transition: all 0.3s ease;
    }

    .navbar-menu a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 2px;
        background: var(--gradient-primary);
        transition: width 0.3s ease;
        box-shadow: 0 0 10px var(--color-accent-cyan);
    }

    .navbar-menu a:hover {
        color: #fff;
        text-shadow: 0 0 20px rgba(245, 9, 0, 0.6);
        transform: scale(1.1);
    }

    .navbar-menu a:hover::after {
        width: 80%;
    }

    /* Mobile Socials Styling */
    .mobile-socials {
        display: block !important;
        margin-top: auto;
        /* Push to bottom */
        margin-bottom: 3rem;
        width: 100%;
    }

    .social-row {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        /* Allow wrapping on narrow screens */
        gap: 1.5rem;
        /* Reduced gap safely */
        padding: 0 1rem;
        /* Ensure side padding */
        max-width: 100%;
        box-sizing: border-box;
    }

    .mobile-socials a {
        font-size: 1.5rem;
        /* Smaller icon size */
        padding: 5px;
        width: auto;
        /* Remove fixed width */
        height: auto;
        /* Remove fixed height */
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0;
        /* Remove circular border */
        background: transparent;
        /* Transparent background */
        border: none;
        /* No border */
        color: var(--color-text-secondary);
        transition: all 0.3s ease;
    }

    .mobile-socials a::after {
        display: none;
        /* Remove underline from icons */
    }

    .mobile-socials a:hover {
        transform: translateY(-3px) scale(1.1);
        background: transparent;
        color: var(--color-accent-cyan);
        /* Color change on hover */
        box-shadow: none;
        /* Remove box shadow */
        border-color: transparent;
        filter: drop-shadow(0 0 5px rgba(245, 9, 0, 0.6));
        /* Subtle glow */
    }
}