/* ============================================
   COMPREHENSIVE RESPONSIVE STYLES
   For All Devices: Mobile, Tablet, Desktop
   ============================================ */

/* ============================================
   BREAKPOINTS
   Mobile: 0-767px
   Tablet: 768px-1023px
   Desktop: 1024px+
   ============================================ */

/* ============================================
   GLOBAL RESPONSIVE UTILITIES
   ============================================ */

/* Container Responsive */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 32px;
    }
}

/* ============================================
   HEADER & NAVIGATION RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .header {
        padding: 12px 0;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    .logo {
        font-size: 18px;
    }

    .nav {
        display: none;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text-color);
        cursor: pointer;
        padding: 8px;
    }

    .mobile-menu {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        padding: 16px;
        gap: 12px;
        z-index: 999;
    }

    .mobile-menu.hidden {
        display: none;
    }

    .mobile-menu a {
        padding: 12px;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }

    .mobile-menu {
        display: none;
    }
}

/* ============================================
   HOME PAGE RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .hero {
        padding: 32px 0 48px;
    }

    .hero-text h1 {
        font-size: 28px;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .hero-stats-mini {
        flex-direction: column;
        gap: 16px;
    }

    .stat-mini {
        width: 100%;
    }

    .properties-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .categories-grid,
    .locations-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        flex-direction: column;
    }

    .step-card {
        width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid,
    .locations-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   LISTINGS PAGE RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .listings-banner .focus-banner-image {
        height: 250px;
    }

    .listings-banner .focus-content h3 {
        font-size: 24px;
    }

    .listings-search-section {
        padding: 24px 16px;
    }

    .advanced-search-card {
        padding: 20px;
    }

    .property-type-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .property-type-container {
        display: flex;
        gap: 8px;
        min-width: max-content;
    }

    .type-filter-btn {
        min-width: 100px;
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .search-fields {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .listings-container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 20px;
    }

    .filter-sidebar {
        position: relative;
        order: 2;
        max-height: none;
    }

    .listings-main {
        order: 1;
    }

    .listings-top-bar {
        flex-direction: column;
        gap: 12px;
    }

    .location-search {
        width: 100%;
    }

    .top-bar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .listings-grid {
        grid-template-columns: 1fr;
    }

    .listing-card.expanded {
        grid-template-columns: 1fr;
    }

    .listing-images {
        min-height: 250px;
    }

    .main-image {
        height: auto;
    }

    .inset-images {
        height: auto;
        grid-template-columns: 1fr 1fr;
    }

    .listing-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .listing-tab {
        min-width: 100px;
        white-space: nowrap;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .listings-container {
        grid-template-columns: 250px 1fr;
        gap: 20px;
    }

    .search-fields {
        grid-template-columns: repeat(2, 1fr);
    }

    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .listing-card.expanded {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .listings-container {
        grid-template-columns: 300px 1fr;
    }

    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .listing-card.expanded {
        grid-template-columns: 1.2fr 1fr;
    }
}

/* ============================================
   PROPERTY DETAIL PAGE RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .property-main-container {
        padding: 16px 0;
    }

    .property-section {
        padding: 20px 16px;
    }

    .property-layout {
        grid-template-columns: 1fr;
    }

    .property-sidebar {
        position: static;
        margin-top: 24px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 200px);
    }

    .gallery-item.main-gallery-item {
        grid-row: 1 / 2;
    }

    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .features-grid,
    .amenities-grid {
        grid-template-columns: 1fr;
    }

    .connectivity-grid {
        grid-template-columns: 1fr;
    }

    .related-properties-grid {
        grid-template-columns: 1fr;
    }

    .price-display h3 {
        font-size: 24px;
    }

    .detail-row {
        grid-template-columns: 1fr;
    }

    .property-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn-contact,
    .btn-schedule {
        width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .property-layout {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-grid,
    .amenities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .related-properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   ADMIN DASHBOARD RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    /* Admin Header */
    header[style*="padding"] {
        padding: 12px 16px !important;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    header h1 {
        font-size: 20px !important;
    }

    /* Stats Grid */
    div[style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }

    /* Property Form Modal */
    div[style*="max-width: 800px"] {
        max-width: 95vw !important;
        padding: 16px !important;
        max-height: 95vh !important;
    }

    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Property Table */
    div[style*="overflowX"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 800px;
    }

    table th,
    table td {
        padding: 8px 12px !important;
        font-size: 13px;
    }

    /* Action Buttons */
    div[style*="display: flex"][style*="gap: 0.5rem"] {
        flex-direction: column;
        gap: 8px !important;
    }

    button[style*="padding: 0.5rem 1rem"] {
        width: 100%;
        padding: 10px !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* Admin Stats */
    div[style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Form Grid */
    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   MODALS & FORMS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .lead-modal-container,
    .comparison-modal-container,
    .wishlist-modal-container {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 20px auto !important;
        padding: 20px 16px !important;
        max-height: 90vh !important;
        overflow-y: auto;
    }

    .lead-modal-header h3 {
        font-size: 20px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 12px;
    }

    .btn-lead-submit {
        width: 100%;
        padding: 14px !important;
    }
}

/* ============================================
   FLOATING BUTTONS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .floating-lead-buttons {
        right: 16px;
        bottom: 16px;
        gap: 10px;
    }

    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

/* ============================================
   FOOTER RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }

    .footer {
        padding: 32px 0 16px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   CONTACT & OTHER PAGES RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .contact-form,
    .connect-form {
        padding: 20px 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hero-lead-form-card,
    .properties-lead-form-card {
        padding: 20px 16px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none;
}

@media (max-width: 767px) {
    .show-mobile {
        display: block;
    }
}

/* Full width on mobile */
@media (max-width: 767px) {
    .full-width-mobile {
        width: 100% !important;
    }
}

/* Text alignment */
@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

/* ============================================
   TOUCH FRIENDLY ELEMENTS
   ============================================ */

@media (max-width: 767px) {
    button,
    .btn,
    a.btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
    }

    input,
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
}

/* ============================================
   IMAGE RESPONSIVE
   ============================================ */

img,
.image,
.property-image {
    max-width: 100%;
    height: auto;
}

/* ============================================
   TABLES RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }
}

/* ============================================
   CARDS & GRIDS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .card,
    .property-card,
    .listing-card {
        width: 100%;
        margin-bottom: 16px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}
