/* ============================================
   RESPONSIVE DESIGN
============================================ */

/* ---------- Extra Large (≤1200px) ---------- */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 42px;
    }
    
    .section-title {
        font-size: 36px;
    }
    
    .properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* ---------- Large / Tablet Landscape (≤992px) ---------- */
@media (max-width: 992px) {
    .main-nav {
        display: none;
    }
    
    .auth-buttons {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .logo-title {
        font-size: 24px;
    }
    
    .logo-main {
        height: 60px;
        width: 60px;
        font-size: 28px;
    }
    
    .search-form {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .about-image {
        height: 350px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .user-role-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 17px;
    }
    
    .section-title {
        font-size: 30px;
    }
}

/* ---------- Tablet Portrait (≤768px) ---------- */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 30px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .type-tab {
        padding: 16px 28px;
        min-width: 140px;
        font-size: 15px;
    }
    
    .section-properties,
    .search-section,
    .featured-section,
    .about-section,
    .contact-section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 26px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
    
    .search-container {
        padding: 25px;
    }
    
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .search-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .category-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        margin: 20px 0 30px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-links-bottom {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .modal-content {
        width: 95%;
        margin: 15px auto;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .modal-header {
        padding: 25px 20px;
    }
    
    /* Modal gallery grid responsive */
    .modal-gallery-grid {
        grid-template-columns: 1fr !important;
        padding: 15px !important;
        gap: 10px !important;
    }
    
    .modal-gallery-grid > div:first-child {
        height: 250px !important;
        min-height: 200px !important;
    }
    
    .modal-gallery-grid > div:nth-child(2) {
        flex-direction: row !important;
    }
    
    .modal-gallery-grid > div:nth-child(2) > div {
        height: 80px !important;
        flex: 1;
    }
    
    /* Admin users detail 2-column grid */
    .info-card {
        break-inside: avoid;
    }
    
    div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 30px"] {
        grid-template-columns: 1fr !important;
    }
    
    .modal-title {
        font-size: 22px;
    }
    
    .user-role-selector {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .property-image {
        height: 140px;
    }
    
    .property-content {
        padding: 12px;
    }
    
    .property-price {
        font-size: 15px;
        margin-bottom: 4px;
    }
    
    .property-title {
        font-size: 13px;
        margin-bottom: 4px;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .property-location {
        font-size: 12px;
        margin-bottom: 10px;
        gap: 4px;
    }
    
    .property-features {
        padding: 8px 0;
        margin-bottom: 10px;
        gap: 4px;
    }
    
    .feature-icon {
        font-size: 14px;
    }
    
    .feature-text {
        font-size: 11px;
    }
    
    .property-badge,
    .property-type-badge {
        padding: 3px 8px;
        font-size: 10px;
        top: 10px;
        left: 10px;
    }
    
    .property-type-badge {
        left: auto;
        right: 10px;
    }
    
    .about-image {
        height: 250px;
    }
    
    .about-content {
        gap: 30px;
    }
    
    .property-detail-header {
        flex-direction: column;
    }
    
    .property-detail-main-image {
        height: 250px;
    }
    
    .property-detail-actions {
        flex-direction: column;
    }

    /* Dashboard responsive */
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0 !important;
    }
    
    .dashboard-topbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-content {
        padding: 15px;
    }
    
    .property-item {
        grid-template-columns: 1fr;
    }
    
    /* Admin table responsive */
    .admin-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table thead {
        display: none;
    }
    
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }
    
    .admin-table tr {
        margin-bottom: 15px;
        border: 1px solid var(--gray-border, #E5E7EB);
        border-radius: 8px;
        padding: 10px;
    }
    
    .admin-table td {
        text-align: right;
        padding: 8px 10px;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding-left: 50%;
    }
    
    .admin-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        text-align: left;
        font-weight: 600;
        font-size: 13px;
        color: #666;
    }
    
    .admin-table td:last-child {
        border-bottom: none;
    }
}

/* ---------- Small / Mobile (≤576px) ---------- */
@media (max-width: 576px) {
    .container {
        padding: 0 14px;
    }
    
    .header-container {
        padding: 12px 0;
    }
    
    .logo-section {
        gap: 10px;
    }
    
    .logo-main {
        height: 45px;
        width: 45px;
        font-size: 20px;
        border-radius: 10px;
    }
    
    .logo-title {
        font-size: 18px;
    }
    
    .logo-domain {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    .hero-title {
        font-size: 26px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .hero-section {
        padding: 50px 0;
    }
    
    .property-type-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .type-tab {
        width: 100%;
        max-width: 280px;
    }
    
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .property-image {
        height: 120px;
    }
    
    .property-content {
        padding: 10px;
    }
    
    .property-price {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .property-title {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .property-location {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .property-features {
        padding: 6px 0;
        margin-bottom: 8px;
    }
    
    .feature-icon {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .feature-text {
        font-size: 10px;
    }
    
    .property-badge,
    .property-type-badge {
        padding: 2px 6px;
        font-size: 9px;
        top: 8px;
        left: 8px;
    }
    
    .property-type-badge {
        left: auto;
        right: 8px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .section-subtitle {
        font-size: 13px;
    }
    
    .user-role-selector {
        grid-template-columns: 1fr;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-header {
        padding: 20px 15px;
    }

    /* Stats cards stack */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-info h3 {
        font-size: 22px;
    }
    
    /* WhatsApp float */
    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 26px;
        bottom: 20px;
        right: 15px;
    }
    
    /* Flash messages */
    .flash-message {
        right: 10px;
        left: 10px;
        max-width: none;
        top: 80px;
    }
    
    /* Welcome banner */
    .welcome-banner {
        padding: 20px !important;
    }
    
    .welcome-banner h1 {
        font-size: 20px !important;
    }
    
    .welcome-banner p {
        font-size: 13px !important;
    }
}

/* ---------- Extra Small (≤400px) ---------- */
@media (max-width: 400px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 22px;
    }
    
    .hero-subtitle {
        font-size: 13px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .property-image {
        height: 100px;
    }
    
    .property-content {
        padding: 8px;
    }
    
    .property-price {
        font-size: 13px;
    }
    
    .property-title {
        font-size: 11px;
    }
    
    .property-location {
        font-size: 10px;
    }
    
    .property-features {
        gap: 4px;
        flex-wrap: wrap;
        padding: 5px 0;
        margin-bottom: 5px;
    }
    
    .feature-icon {
        font-size: 11px;
    }
    
    .feature-text {
        font-size: 9px;
    }
    
    .logo-title {
        font-size: 16px;
    }
}