/* ============================================
   MOBILE HERO SECTION & SEARCH FORM FIXES
   Real Estate Platform - Mobile Optimization
   ============================================ */

/* Base Mobile Styles - Apply to all mobile devices */
@media (max-width: 767px) {
    /* Ensure navbar is above hero section on home page */
    .navbar {
        z-index: 10000 !important;
        position: relative !important;
    }
    
    .nav-content {
        z-index: 10001 !important;
        position: relative !important;
    }
    
    .nav-right {
        z-index: 10002 !important;
        position: relative !important;
    }
    
    .mobile-menu-toggle {
        z-index: 99999 !important;
        position: relative !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2) !important;
        touch-action: manipulation !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: transparent !important;
        border: none !important;
        padding: 0.5rem !important;
        margin: 0 !important;
    }
    
    .mobile-menu-toggle i {
        pointer-events: none !important;
        z-index: 99999 !important;
    }
    
    /* Ensure nothing covers the menu button */
    .nav-right {
        position: relative !important;
        z-index: 99998 !important;
    }
    
    /* Hero Section - Full Width, Professional Layout */
    .hero {
        position: relative;
        margin-bottom: 2.5rem;
        width: 100%;
        max-width: 100vw;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        z-index: 1 !important;
    }

    /* Hero Banner Container - Full Width, No Padding */
    .hero-banner-container {
        position: relative;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 500px;
        min-height: 500px;
        overflow: visible;
        border-radius: 0 !important;
        margin: 0;
        padding: 0;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        display: flex;
        flex-direction: column;
        z-index: 1 !important;
    }

    /* Hero Banner Image - Full Width, Professional */
    .hero-banner {
        width: 100% !important;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        margin: 0;
        padding: 0;
    }

    /* Hero Overlay - Enhanced for Mobile */
    .hero-overlay {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)) !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }

    /* Hero Content - Professional Padding & Alignment */
    .hero-content {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 1.5rem 1rem !important;
        padding-top: 1.75rem !important;
        text-align: center;
        color: var(--white);
        width: 100%;
        box-sizing: border-box;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 2 !important;
    }

    /* Hero Text - Professional Mobile Typography */
    .hero-faded-title {
        font-size: 0.8125rem;
        font-weight: 400;
        letter-spacing: 0.5px;
        opacity: 0.95;
        margin-bottom: 0.5rem;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
        text-transform: uppercase;
        flex-shrink: 0;
    }

    .hero-main-title {
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1.25;
        margin-bottom: 0.5rem;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
        padding: 0;
        letter-spacing: -0.5px;
        flex-shrink: 0;
    }

    .hero-tagline {
        font-size: 0.875rem;
        font-weight: 400;
        margin-bottom: 1.25rem;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
        padding: 0;
        line-height: 1.5;
        opacity: 0.95;
        flex-shrink: 0;
    }

    /* Hero Search Form - Professional Mobile Card */
    .hero-search {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.875rem !important;
        max-width: 100% !important;
        width: 100% !important;
        background: #ffffff;
        padding: 1.25rem !important;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
        margin: 0 auto;
        box-sizing: border-box;
        border: 1px solid rgba(255, 255, 255, 0.2);
        position: relative;
        z-index: 10;
        flex-shrink: 0;
        margin-top: auto;
        margin-bottom: 1rem;
    }

    /* Search Inputs & Selects - Professional Styling */
    .hero-search input,
    .hero-search select {
        width: 100% !important;
        flex: none !important;
        padding: 1rem 1.125rem !important;
        border: 1.5px solid #e5e7eb;
        border-radius: 10px;
        font-size: 1rem !important;
        font-weight: 500;
        min-height: 48px !important;
        box-sizing: border-box;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-color: #ffffff;
        color: #1f2937;
        transition: all 0.2s ease;
    }

    .hero-search input::placeholder {
        color: #9ca3af;
        font-weight: 400;
    }

    .hero-search select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%231f2937' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        background-size: 14px;
        padding-right: 2.75rem !important;
        cursor: pointer;
    }

    .hero-search input:focus,
    .hero-search select:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        background-color: #ffffff;
    }

    .hero-search input:hover,
    .hero-search select:hover {
        border-color: #d1d5db;
    }

    /* Search Button - Professional CTA */
    .btn-search {
        width: 100% !important;
        padding: 1.125rem 1.5rem !important;
        background: linear-gradient(135deg, #0a1f3a 0%, #1a3a5f 100%);
        color: #ffffff;
        border: none;
        border-radius: 10px;
        font-weight: 600;
        font-size: 1.0625rem !important;
        cursor: pointer;
        transition: all 0.3s ease;
        min-height: 48px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.625rem;
        box-sizing: border-box;
        box-shadow: 0 4px 12px rgba(10, 31, 58, 0.3);
        letter-spacing: 0.3px;
    }

    .btn-search:hover,
    .btn-search:active {
        background: linear-gradient(135deg, #1a3a5f 0%, #0a1f3a 100%);
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(10, 31, 58, 0.4);
    }

    .btn-search:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(10, 31, 58, 0.3);
    }

    .btn-search i {
        font-size: 1.125rem;
    }

    /* Container - Professional Mobile Padding */
    .container {
        padding: 0 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Prevent Horizontal Scroll */
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Property Types Section - Mobile Professional */
    .property-types {
        padding: 2.5rem 0 !important;
    }

    .section-header {
        margin-bottom: 2rem !important;
        padding: 0 0.5rem;
    }

    .section-header h2 {
        font-size: 1.75rem !important;
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 0.75rem;
        color: #1a1a1a;
    }

    .section-header p {
        font-size: 0.9375rem !important;
        color: #6b7280;
        line-height: 1.5;
    }

    /* Property Types Grid - Mobile */
    .property-types-grid {
        gap: 1rem !important;
        padding: 0;
    }

    .property-type-card {
        padding: 1.5rem 1rem !important;
        border-radius: 12px;
        transition: all 0.3s ease;
    }

    .property-type-card:active {
        transform: scale(0.98);
    }

    /* Hide City Selector and Post Ad Button on Mobile */
    .city-selector-wrapper {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Hide Post Ad button in navigation on mobile - STRONG OVERRIDE */
    .nav-right a[href*="post-ad"],
    .nav-right .btn-secondary[href*="post-ad"],
    a.btn-secondary[href*="post-ad"],
    .desktop-post-ad,
    .navbar .btn-secondary[href*="post-ad"],
    .nav-content .btn-secondary[href*="post-ad"],
    .nav-right .desktop-post-ad {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        pointer-events: none !important;
    }
    
    /* Mobile Menu Improvements - Professional Styling */
    .mobile-menu {
        width: 85% !important;
        max-width: 320px !important;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15) !important;
        z-index: 10000 !important;
        pointer-events: auto !important;
    }
    
    .mobile-menu.active {
        right: 0 !important;
    }
    
    .mobile-menu-overlay {
        z-index: 9999 !important;
        pointer-events: auto !important;
    }
    
    .mobile-menu-overlay.active {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .mobile-menu-content {
        padding: 1rem 0 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: calc(100vh - 80px);
        pointer-events: auto !important;
    }
    
    .mobile-menu-link {
        display: flex !important;
        align-items: center !important;
        padding: 1rem 1.25rem !important;
        color: #1f2937 !important;
        text-decoration: none !important;
        font-size: 1rem !important;
        font-weight: 500 !important;
        border-bottom: 1px solid #f3f4f6 !important;
        transition: all 0.2s ease !important;
        min-height: 52px !important;
        box-sizing: border-box !important;
        position: relative !important;
        z-index: 10001 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    }
    
    .mobile-menu-link:hover,
    .mobile-menu-link:active {
        background-color: #f9fafb !important;
        color: var(--primary-color) !important;
    }
    
    .mobile-menu-link:focus {
        outline: 2px solid var(--primary-color) !important;
        outline-offset: -2px !important;
    }
    
    .mobile-menu-link i {
        color: var(--primary-color) !important;
        font-size: 1.125rem !important;
        flex-shrink: 0;
        pointer-events: none !important;
    }
    
    /* Ensure links are clickable */
    .mobile-menu-link a {
        pointer-events: auto !important;
        z-index: 10002 !important;
    }
    
    /* Post Ad button in mobile menu - styled as primary CTA */
    .mobile-post-ad-btn {
        background: linear-gradient(135deg, var(--primary-color) 0%, #1a3a5f 100%) !important;
        color: white !important;
        font-weight: 600 !important;
        margin: 0.75rem 1rem !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
        border: none !important;
        text-align: center !important;
        justify-content: center !important;
        min-height: 52px !important;
    }
    
    .mobile-post-ad-btn:hover,
    .mobile-post-ad-btn:active {
        background: linear-gradient(135deg, #1e40af 0%, #0f2540 100%) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4) !important;
    }
    
    .mobile-post-ad-btn i {
        color: white !important;
        margin-right: 0.5rem !important;
    }
    
    /* Logout button styling */
    .mobile-logout-btn {
        color: #dc3545 !important;
        border-top: 2px solid #f3f4f6 !important;
        margin-top: 0.5rem !important;
    }
    
    .mobile-logout-btn:hover,
    .mobile-logout-btn:active {
        background-color: #fef2f2 !important;
        color: #b91c1c !important;
    }
    
    .mobile-logout-btn i {
        color: #dc3545 !important;
    }
    
    /* Mobile menu divider */
    .mobile-menu-divider {
        height: 1px !important;
        background: #e5e7eb !important;
        margin: 0.75rem 1rem !important;
    }
    
    /* Mobile menu header */
    .mobile-menu-header {
        padding: 1.25rem 1.25rem !important;
        border-bottom: 2px solid #f3f4f6 !important;
        background: white !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
    }
    
    .mobile-menu-close {
        width: 40px !important;
        height: 40px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f3f4f6 !important;
        border: none !important;
        color: #1f2937 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .mobile-menu-close:hover,
    .mobile-menu-close:active {
        background: #e5e7eb !important;
        color: var(--primary-color) !important;
    }

    /* Navigation adjustments for mobile */
    .nav-right {
        gap: 0.5rem !important;
        justify-content: flex-end !important;
    }

    /* Ensure mobile menu toggle is visible */
    .mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Extra Small Devices (320px - 374px) */
@media (max-width: 374px) {
    .hero-banner-container {
        height: 480px;
        min-height: 480px;
    }
    
    .hero-content {
        padding: 1.25rem 0.875rem !important;
        padding-top: 1.5rem !important;
    }

    .hero-content {
        padding: 1.75rem 0.875rem 1.25rem 0.875rem !important;
    }

    .hero-main-title {
        font-size: 1.625rem;
        line-height: 1.25;
        margin-bottom: 0.75rem;
    }

    .hero-faded-title {
        font-size: 0.75rem;
        margin-bottom: 0.625rem;
    }

    .hero-tagline {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .hero-search {
        padding: 1rem !important;
        gap: 0.75rem !important;
        border-radius: 14px;
    }

    .hero-search input,
    .hero-search select {
        padding: 0.9375rem 1rem !important;
        font-size: 0.9375rem !important;
        min-height: 46px !important;
        border-radius: 8px;
    }

    .btn-search {
        padding: 1rem 1.25rem !important;
        font-size: 1rem !important;
        min-height: 46px !important;
        border-radius: 8px;
    }

    .container {
        padding: 0 0.875rem !important;
    }
}

/* Small Mobile Devices (375px - 479px) */
@media (min-width: 375px) and (max-width: 479px) {
    .hero-banner-container {
        height: 520px;
        min-height: 520px;
    }

    .hero-main-title {
        font-size: 2rem;
    }

    .hero-content {
        padding: 2.25rem 1rem 1.75rem 1rem !important;
    }

    .hero-search {
        padding: 1.375rem !important;
    }
}

/* Standard Mobile Devices (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .hero-banner-container {
        height: 540px;
        min-height: 540px;
    }

    .hero-main-title {
        font-size: 2.125rem;
    }

    .hero-content {
        padding: 2.5rem 1.25rem 2rem 1.25rem !important;
    }

    .hero-search {
        padding: 1.5rem !important;
        border-radius: 18px;
    }

    .hero-search input,
    .hero-search select {
        padding: 1.125rem 1.25rem !important;
        min-height: 50px !important;
    }

    .btn-search {
        padding: 1.25rem 1.75rem !important;
        min-height: 50px !important;
    }
}

/* Ensure Desktop/Tablet Unchanged */
@media (min-width: 768px) {
    .hero {
        margin-bottom: 3rem;
    }

    .hero-banner-container {
        width: 100%;
        height: 500px;
        border-radius: 12px;
        margin: 0 auto;
        left: auto;
        right: auto;
        margin-left: 0;
        margin-right: 0;
    }

    .hero-content {
        padding: 2rem;
        justify-content: center;
    }

    .hero-main-title {
        font-size: 3rem;
    }

    .hero-search {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        max-width: 900px;
    }

    .hero-search input,
    .hero-search select {
        flex: 1;
        width: auto;
    }

    .btn-search {
        width: auto;
        padding: 0.75rem 2rem;
    }
}

