/* =========== RESPONSIVE STYLES FOR LUXURY REAL ESTATE =========== */

/* ===== GENERAL RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1400px) {
    .carousel-container {
        padding: 0 3rem;
        margin-bottom: 6rem;
    }
}

/* ===== LAPTOP & SMALL DESKTOP (1200px) ===== */
@media (max-width: 1200px) {
    /* Carousel Adjustments */
    .property-card {
        flex: 0 0 calc(50% - 2rem);
        min-width: calc(50% - 2rem);
        height: 400px;
    }

    .carousel-container {
        padding: 0 2rem;
        margin-bottom: 5rem;
    }

    /* Modal Adjustments */
    .property-info-modal .modal-content {
        width: 95%;
        max-width: 900px;
    }

    .property-info-modal .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* ===== TABLET & SMALL LAPTOP (1024px) ===== */
@media (max-width: 1024px) {
    /* Carousel Adjustments */
    .carousel-track {
        gap: 1.5rem;
    }

    /* Modal Adjustments - Additional to existing ones */
    .property-info-modal .modal-content {
        margin: 1.5rem auto;
        max-height: 90vh;
    }

    .property-info-modal .property-main-data {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .property-info-modal .data-box {
        flex: 1 0 30%;
        margin: 0.5rem;
    }

    .property-info-modal .section-title {
        font-size: 1.4rem;
        margin: 1.5rem 0 1rem 0;
    }
}

/* ===== TABLET (768px) ===== */
@media (max-width: 768px) {
    /* Carousel Adjustments */
    .property-card {
        flex: 0 0 calc(100% - 2rem);
        min-width: calc(100% - 2rem);
        height: 380px;
    }

    .carousel-container {
        padding: 0 1.5rem;
        margin-bottom: 4rem;
    }

    .carousel-button {
        width: 2.5rem;
        height: 2.5rem;
    }

    .carousel-button svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .property-title {
        font-size: 1.3rem;
    }

    .property-price {
        font-size: 1.1rem;
    }

    /* Modal Adjustments - Additional to existing ones */
    .property-info-modal .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .property-info-modal .property-main-data {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .property-info-modal .data-box {
        margin: 0;
        padding: 1rem 0.5rem;
    }

    .property-info-modal .data-value {
        font-size: 1.2rem;
    }

    .property-info-modal .info-table th,
    .property-info-modal .info-table td {
        padding: 0.75rem 0;
    }

    .property-info-modal .map-container {
        height: 200px;
    }

    /* Gallery Modal Adjustments */
    .property-info-modal .gallery-image-container {
        max-height: 60vh;
    }

    .property-info-modal .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .property-info-modal .gallery-nav.prev {
        left: 1rem;
    }

    .property-info-modal .gallery-nav.next {
        right: 1rem;
    }

    .property-info-modal .gallery-counter {
        top: 1.5rem;
        left: 1.5rem;
        padding: 0.4rem 1rem;
    }

    .property-info-modal .gallery-close {
        right: 1.5rem;
        top: 1.5rem;
        width: 35px;
        height: 35px;
    }
}

/* ===== LARGE MOBILE (576px) ===== */
@media (max-width: 576px) {
    /* Carousel Adjustments */
    .carousel-container {
        padding: 0 1rem;
        margin-bottom: 3rem;
    }

    .carousel-button {
        width: 2rem;
        height: 2rem;
    }

    .carousel-button svg {
        width: 1rem;
        height: 1rem;
    }

    .carousel-button.prev {
        left: 0.5rem;
    }

    .carousel-button.next {
        right: 0.5rem;
    }

    .property-card {
        height: 350px;
    }

    .property-content {
        padding: 1.5rem;
    }

    .property-title {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }

    .property-location {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .property-price {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .property-details-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    /* Modal Adjustments - Additional to existing ones */
    .property-info-modal .modal-gallery,
    .property-info-modal .property-details {
        padding: 1rem 0.75rem;
    }

    .property-info-modal .property-title {
        font-size: 1.2rem;
    }

    .property-info-modal .property-location {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .property-info-modal .property-price {
        font-size: 1.3rem;
        margin: 1rem 0;
    }

    .property-info-modal .property-main-data {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .property-info-modal .data-box {
        padding: 0.75rem 0.5rem;
    }

    .property-info-modal .data-label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .property-info-modal .data-value {
        font-size: 1.1rem;
    }

    .property-info-modal .section-title {
        font-size: 1.2rem;
        margin: 1.25rem 0 0.75rem 0;
        padding-bottom: 0.5rem;
    }

    .property-info-modal .info-table th,
    .property-info-modal .info-table td {
        padding: 0.6rem 0;
        font-size: 0.9rem;
    }

    .property-info-modal .info-table {
        margin-bottom: 1.5rem;
    }

    .property-info-modal .description-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .property-info-modal .map-container {
        height: 180px;
    }

    .property-info-modal .location-address {
        font-size: 0.9rem;
    }

    .property-info-modal .feature-card {
        padding: 1rem;
    }

    .property-info-modal .feature-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .property-info-modal .feature-content {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Gallery Modal Adjustments */
    .property-info-modal .gallery-content {
        padding: 2rem 1rem;
    }

    .property-info-modal .gallery-image-container {
        max-height: 50vh;
    }

    .property-info-modal .gallery-thumbs {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .property-info-modal .gallery-thumb-wrapper {
        width: 100px;
        height: 70px;
    }
}

/* ===== SMALL MOBILE (480px) ===== */
@media (max-width: 480px) {
    /* Carousel Adjustments */
    .property-card {
        height: 300px;
    }

    .property-content {
        padding: 1.25rem;
    }

    .property-title {
        font-size: 1.1rem;
    }

    .property-location {
        font-size: 0.85rem;
    }

    .property-price {
        font-size: 0.95rem;
    }

    .property-details-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    /* Modal Adjustments - Additional to existing ones */
    .property-info-modal .property-main-data {
        grid-template-columns: 1fr 1fr;
    }

    .property-info-modal .data-box:last-child {
        grid-column: span 2;
    }

    .property-info-modal .thumbnail-container {
        gap: 0.3rem;
    }

    .property-info-modal .thumbnail-wrapper {
        width: 70px;
        height: 50px;
    }

    .property-info-modal .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .property-info-modal .virtual-tour-container {
        padding: 1.5rem 1rem;
    }

    .property-info-modal .virtual-tour-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .property-info-modal .virtual-tour-button {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Gallery Modal Further Adjustments */
    .property-info-modal .gallery-thumb-wrapper {
        width: 80px;
        height: 60px;
    }

    .property-info-modal .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .property-info-modal .gallery-nav.prev {
        left: 0.5rem;
    }

    .property-info-modal .gallery-nav.next {
        right: 0.5rem;
    }

    .property-info-modal .gallery-counter {
        font-size: 0.9rem;
        padding: 0.3rem 0.8rem;
    }
}

/* ===== EXTRA SMALL MOBILE (360px) ===== */
@media (max-width: 360px) {
    /* Carousel Adjustments */
    .property-card {
        height: 280px;
    }

    .property-content {
        padding: 1rem;
    }

    .property-title {
        font-size: 1rem;
    }

    .property-location {
        font-size: 0.8rem;
    }

    .property-price {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .property-details-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    /* Modal Additional Adjustments */
    .property-info-modal .property-title {
        font-size: 1.1rem;
    }

    .property-info-modal .property-price {
        font-size: 1.1rem;
    }

    .property-info-modal .section-title {
        font-size: 1.1rem;
    }

    .property-info-modal .main-image-container {
        height: 180px;
    }

    .property-info-modal .info-table th,
    .property-info-modal .info-table td {
        font-size: 0.85rem;
    }

    .property-info-modal .modal-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    /* Gallery Additional Adjustments */
    .property-info-modal .gallery-thumb-wrapper {
        width: 70px;
        height: 50px;
    }
}

/* ===== LANDSCAPE MODE ===== */
@media (max-height: 600px) and (orientation: landscape) {
    /* Adjust modal for landscape orientation on mobile */
    .property-info-modal .modal-body {
        flex-direction: row;
    }

    .property-info-modal .modal-gallery,
    .property-info-modal .property-details {
        width: 50%;
        max-height: 90vh;
    }

    .property-info-modal .main-image-container {
        height: 180px;
    }

    .property-info-modal .property-title {
        font-size: 1.2rem;
    }

    .property-info-modal .property-main-data {
        flex-direction: column;
    }

    .property-info-modal .data-box {
        margin: 0.3rem 0;
    }

    /* Gallery Modal Landscape Adjustments */
    .property-info-modal .gallery-image-container {
        max-height: 70vh;
    }

    .property-info-modal .gallery-content {
        padding: 1.5rem;
    }

    .property-info-modal .gallery-thumbs {
        max-width: 95%;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .carousel-container, 
    .carousel-button,
    .property-details-btn,
    .property-info-modal .close-modal,
    .property-info-modal .modal-nav-btn,
    .property-info-modal .thumbnail-container,
    .property-info-modal .view-all-photos,
    .property-info-modal .gallery-modal,
    .property-info-modal .mls-button,
    .property-info-modal .google-maps-button,
    .property-info-modal .virtual-tour-button {
        display: none !important;
    }

    .property-info-modal {
        position: relative;
        display: block !important;
        background: white;
        overflow: visible;
    }

    .property-info-modal .modal-content {
        box-shadow: none;
        margin: 0;
        width: 100%;
    }

    .property-info-modal .modal-body {
        flex-direction: column;
    }

    .property-info-modal .modal-gallery,
    .property-info-modal .property-details {
        width: 100%;
        padding: 0;
    }

    .property-info-modal .property-title {
        color: #000;
    }

    .property-info-modal .section-title {
        color: #000;
        page-break-after: avoid;
    }

    .property-info-modal .main-image-container {
        height: auto;
        max-height: 300px;
        page-break-inside: avoid;
    }

    .property-info-modal .property-main-data {
        page-break-inside: avoid;
    }

    .property-info-modal .data-box {
        border: 1px solid #ddd;
    }

    .property-info-modal .property-price {
        color: #000;
    }

    .property-info-modal .map-container {
        page-break-inside: avoid;
    }

    .property-info-modal .features-grid {
        display: block;
    }

    .property-info-modal .feature-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ===== HIGH-RESOLUTION SCREENS (RETINA) ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize images for high-resolution displays */
    .property-image,
    .property-info-modal #modalMainImage,
    .property-info-modal .thumbnail,
    .property-info-modal .gallery-image-container img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    /* Only apply if website supports dark mode */
    /* This is commented out by default - uncomment and adjust if you want dark mode support
    :root {
        --bg-light: #121212;
        --text-dark: #f5f5f5;
        --text-secondary: #aaaaaa;
        --bg-gray: #1e1e1e;
    }

    .property-info-modal .modal-content {
        background: #1e1e1e;
    }

    .property-info-modal .property-title,
    .property-info-modal .section-title,
    .property-info-modal .info-table th,
    .property-info-modal .feature-title {
        color: #c5a572;
    }

    .property-info-modal .info-table td,
    .property-info-modal .description-text,
    .property-info-modal .feature-content,
    .property-info-modal .location-address {
        color: #dddddd;
    }

    .property-info-modal .data-box {
        background: #252525;
    }

    .property-info-modal .data-value {
        color: #c5a572;
    }

    .property-info-modal .google-maps-button {
        background: #252525;
    }

    .property-info-modal .close-modal {
        color: #f5f5f5;
        background: rgba(30, 30, 30, 0.9);
    }
    */
}