/* Mobile Enhancements for Platinum Choice Real Estate */

/* ========================================
   DESKTOP VIEW - Keep Original
   ======================================== */
@media (min-width: 1024px) {
    /* Desktop Nav Container - Logo on EXTREME LEFT */
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    
    /* Logo Desktop - EXTREME LEFT */
    .logo {
        margin-right: auto;
        margin-left: 0;
        order: 1;
    }
    
    /* Desktop Navigation - Center */
    .desktop-nav {
        display: flex !important;
        order: 2;
        margin: 0 auto;
    }
    
    /* Desktop CTA - Right Side */
    .desktop-cta {
        display: flex !important;
        order: 3;
        margin-left: auto;
    }
    
    /* Hide mobile menu elements */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* ========================================
   MOBILE VIEW - Hamburger Menu
   ======================================== */
@media (max-width: 1023px) {
    /* Hide desktop navigation and CTA */
    .desktop-nav {
        display: none !important;
    }
    
    .desktop-cta {
        display: none !important;
    }
    
    /* Mobile Header Background (Figma: Grey/10 #1A1A1A with border) */
    .header-clean,
    .nav-clean {
        background-color: #1A1A1A;
        border-bottom: 1px solid #211E2F;
    }
    
    /* Nav Container Mobile - Logo EXTREME LEFT, Menu EXTREME RIGHT (Figma Design) */
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        padding: 12px 16px;
        width: 100%;
        min-height: 50px;
    }
    
    /* Logo Mobile - EXTREME LEFT SIDE (100px x 29px per Figma) */
    .logo {
        order: 1;
        flex-shrink: 0;
        margin-right: auto;
        margin-left: 0;
    }
    
    .logo img {
        height: 29px;
        width: 100px;
        object-fit: contain;
    }
    
    /* Show hamburger menu button - EXTREME RIGHT SIDE (28px x 28px per Figma) */
    .mobile-menu-toggle {
        order: 2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        width: 28px;
        height: 28px;
        z-index: 1001;
        transition: all 0.3s ease;
        flex-shrink: 0;
        position: relative;
        margin-left: auto;
        margin-right: 0;
    }
    
    .mobile-menu-toggle span {
        width: 21px;
        height: 2px;
        background-color: #FFFFFF;
        border-radius: 2px;
        transition: all 0.3s ease;
        display: block;
    }
    
    /* Ensure hamburger stays white in all states */
    .mobile-menu-toggle.active span {
        background-color: #FFFFFF !important;
    }
    
    /* Hamburger to X animation */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Mobile Menu Overlay - GLASSY EFFECT */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        /* Glassy background with gradient */
        background: linear-gradient(
            135deg,
            rgba(26, 26, 26, 0.95) 0%,
            rgba(33, 30, 47, 0.92) 50%,
            rgba(26, 26, 26, 0.95) 100%
        );
        /* Enhanced blur for frosted glass effect */
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        /* Subtle border for glass edge effect */
        border: 1px solid rgba(255, 255, 255, 0.1);
        /* Glass shine overlay */
        box-shadow: 
            inset 0 1px 0 0 rgba(255, 255, 255, 0.05),
            0 10px 50px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                    visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding-top: 60px;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Mobile Menu Content - Enhanced for Glass Effect */
    .mobile-menu-content {
        display: flex;
        flex-direction: column;
        padding: 40px 20px;
        min-height: calc(100vh - 60px);
        max-width: 100%;
        /* Subtle inner glow for depth */
        background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.02) 0%,
            transparent 50%
        );
    }
    
    /* Mobile Menu Links */
    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 40px;
    }
    
    .mobile-nav-link {
        color: #FFFFFF;
        text-decoration: none;
        font-size: 18px;
        font-weight: 500;
        padding: 16px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        transition: all 0.3s ease;
        display: block;
        /* Glass card effect for links */
        background: rgba(255, 255, 255, 0.02);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        margin-bottom: 8px;
    }
    
    .mobile-nav-link:last-child {
        border-bottom: none;
    }
    
    .mobile-nav-link:hover,
    .mobile-nav-link.active {
        color: #703BF7;
        background: rgba(112, 59, 247, 0.1);
        border: 1px solid rgba(112, 59, 247, 0.3);
        transform: translateX(5px);
        box-shadow: 0 4px 15px rgba(112, 59, 247, 0.2);
    }
    
    /* Mobile CTA Button - Glassy Purple Style */
    .btn-mobile-cta {
        background: linear-gradient(135deg, rgba(112, 59, 247, 0.9), rgba(130, 84, 248, 0.9));
        color: #FFFFFF;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        padding: 18px 24px;
        font-size: 18px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
        transition: all 0.3s ease;
        width: 100%;
        margin-top: auto;
        backdrop-filter: blur(10px);
        box-shadow: 
            0 8px 32px rgba(112, 59, 247, 0.3),
            inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    }
    
    .btn-mobile-cta:hover {
        background: linear-gradient(135deg, rgba(130, 84, 248, 1), rgba(112, 59, 247, 1));
        transform: translateY(-3px);
        box-shadow: 
            0 12px 40px rgba(112, 59, 247, 0.4),
            inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
    }
}

/* ========================================
   SMALL MOBILE SCREENS (767px and below)
   ======================================== */
@media (max-width: 767px) {
    .header-clean {
        padding: 0;
    }
    
    .nav-clean {
        padding: 12px 16px;
    }
    
    .nav-container {
        gap: 0;
        padding: 12px 16px;
        min-height: 50px;
    }
    
    /* Keep Figma specs for logo */
    .logo img {
        height: 29px;
        width: 100px;
        object-fit: contain;
    }
    
    /* Hero Section Mobile - Fix Stretched Image */
    .hero-coastal {
        min-height: 600px;
        padding-top: 70px;
        /* Fix stretched image on mobile - maintain proportions */
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }
    
    .hero-coastal-title {
        font-size: 32px;
        line-height: 1.3;
    }
    
    .hero-coastal-subtitle {
        font-size: 16px;
        line-height: 1.6;
    }
    
    /* Center Hero Button on Mobile */
    .hero-coastal-content {
        align-items: center;
        text-align: center;
    }
    
    .btn-hero-primary {
        width: 100%;
        max-width: 100%;
        padding: 14px 20px;
        font-size: 14px;
        text-align: center;
        margin: 0 auto;
        display: block;
    }
    
    /* Mobile Menu */
    .mobile-menu-content {
        padding: 30px 16px;
    }
    
    .mobile-nav-link {
        font-size: 16px;
        padding: 14px 0;
    }
    
    .btn-mobile-cta {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    /* Form Mobile Improvements */
    .form-row-3col {
        flex-direction: column;
        gap: 20px;
    }
    
    .form-group {
        width: 100%;
    }
    
    .contact-form-section {
        padding: 40px 20px;
    }
    
    /* Footer Mobile */
    .footer-cta-main {
        padding: 40px 20px !important;
        flex-direction: column;
    }
    
    .footer-cta-content-figma {
        flex-direction: column;
        gap: 30px;
    }
    
    .btn-footer-cta-figma {
        width: 100%;
        text-align: center;
    }
    
    .newsletter-form {
        width: 100% !important;
        max-width: 100%;
    }
    
    /* Properties Grid Mobile */
    .properties-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .property-card-large {
        flex-direction: column;
    }
    
    .property-image-large {
        width: 100%;
        height: 250px;
    }
    
    /* Projects Grid Mobile */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Cards Mobile */
    .contact-cards-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .contact-card {
        width: 100%;
    }
}

/* ========================================
   EXTRA SMALL MOBILE (479px and below)
   ======================================== */
@media (max-width: 479px) {
    .nav-clean {
        padding: 10px 16px;
    }
    
    .nav-container {
        padding: 10px 16px;
        gap: 0;
        min-height: 46px;
    }
    
    /* Slightly smaller logo for very small screens */
    .logo img {
        height: 26px;
        width: 90px;
        object-fit: contain;
    }
    
    /* Slightly smaller hamburger for very small screens */
    .mobile-menu-toggle {
        width: 24px;
        height: 24px;
    }
    
    .mobile-menu-toggle span {
        width: 18px;
    }
    
    .hero-coastal-title {
        font-size: 28px;
    }
    
    .hero-coastal-subtitle {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .section-description {
        font-size: 16px;
    }
    
    /* Improve touch targets */
    .btn-primary,
    .btn-secondary,
    .btn-hero-primary {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    /* Improve form inputs for mobile */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .mobile-nav-link {
        font-size: 15px;
        padding: 12px 0;
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media (max-width: 767px) and (orientation: landscape) {
    .header-clean {
        padding: 0;
    }
    
    .nav-clean {
        padding: 10px 20px;
    }
    
    .hero-coastal {
        min-height: 500px;
        padding-top: 60px;
    }
}

/* ========================================
   FIX HEADER FULLY DISAPPEARING ON MOBILE
   ======================================== */
@media (max-width: 1023px) {
    .header-clean {
        transform-origin: top center;
    }
    
    /* Ensure header fully hides on scroll down */
    .header-clean[style*="translateY(-100%)"] {
        transform: translateY(-100%) !important;
        opacity: 0;
    }
    
    /* Ensure smooth transition */
    .header-clean {
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out !important;
    }
}

/* ========================================
   TABLET PORTRAIT (768px - 1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .nav-container {
        gap: 40px;
    }
    
    .properties-grid,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   GENERAL MOBILE IMPROVEMENTS
   ======================================== */
/* Ensure smooth transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Improve scrolling on mobile */
html {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    width: 100%;
}

/* Fix for iOS Safari viewport */
@supports (-webkit-touch-callout: none) {
    .hero-coastal {
        min-height: -webkit-fill-available;
    }
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}
