/* ============================================
   Modern Property Details Modal - 2024 Design
   Responsive, RTL/LTR Support, Mobile-First
   ============================================ */

/* Modal Container */
.modern-property-modal .modal-dialog {
    max-width: 1200px;
    margin: 1rem auto;
}

.modern-property-modal .modal-content {
    border: none;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Modal Header */
.modern-modal-header {
    background: linear-gradient(135deg, #0071d0 0%, #0056b3 100%);
    color: #ffffff;
    padding: 1.5rem 2rem;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modern-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
    flex: 1;
}

/* RTL: Move title to left side in Arabic */
[dir="rtl"] .modern-modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .modern-modal-title {
    text-align: right;
}

.modern-btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 1;
    padding: 0;
    transition: all 0.3s ease;
}

.modern-btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.modern-btn-close i {
    font-size: 1.1rem;
    color: #ffffff !important;
}

.modern-btn-close:hover i {
    color: #ffffff !important;
}

/* Modal Body */
.modern-modal-body {
    padding: 2rem;
    background: #f8fafc;
}

/* Modern Nav Pills */
.modern-nav-pills {
    background: #ffffff;
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
}

.modern-nav-link {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    color: #6b7280;
    font-weight: 500;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-nav-link i {
    font-size: 1rem;
    color: #6b7280;
    transition: color 0.3s ease;
}

.modern-nav-link:hover {
    color: #0071d0;
    background: rgba(0, 113, 208, 0.1);
}

.modern-nav-link:hover i {
    color: #0071d0;
}

.modern-nav-link.active {
    background: linear-gradient(135deg, #0071d0 0%, #0056b3 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 113, 208, 0.3);
}

.modern-nav-link.active i {
    color: #ffffff !important;
}

/* Tab Content */
.modern-tab-content {
    margin-top: 0;
}

/* Image Gallery */
.modern-image-gallery {
    position: relative;
}

.gallery-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #e5e7eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.gallery-main-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    background-color: #e3f2fd;
}

/* Placeholder image styling */
.gallery-main-image[alt*="Not Available"],
.gallery-main-image[alt*="غير متاح"] {
    object-fit: contain;
    background-color: #e3f2fd;
    padding: 2rem;
}

.gallery-container:hover .gallery-main-image {
    transform: scale(1.02);
}

/* Gallery Navigation Buttons */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0071d0;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.gallery-container:hover .gallery-nav-btn {
    opacity: 1;
}

.gallery-nav-prev {
    left: 16px;
}

.gallery-nav-next {
    right: 16px;
}

.gallery-nav-btn:hover {
    background: #0071d0;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Gallery Dots */
.gallery-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.gallery-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.gallery-dots .dot.active {
    background: #ffffff;
    width: 32px;
    border-radius: 5px;
    border-color: #ffffff;
}

/* Section Cards */
.modern-section-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    height: 100%;
}

.modern-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0071d0;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.modern-section-title i {
    color: #0071d0;
}

/* Amenities Grid */
.modern-amenities-grid {
    max-height: 420px;
    overflow-y: auto;
}

.amenities-tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.amenity-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.amenity-item i {
    font-size: 1rem;
    min-width: 20px;
    transition: color 0.2s ease;
}

.amenity-item .amenity-present,
.amenity-item i.fa-check-circle.amenity-present {
    color: #10b981 !important;
}

.amenity-item .amenity-absent,
.amenity-item i.fa-times-circle.amenity-absent {
    color: #d1d5db !important;
}

/* Details Grid */
.modern-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.detail-item:hover {
    box-shadow: 0 4px 12px rgba(0, 113, 208, 0.1);
    transform: translateY(-2px);
    border-color: #0071d0;
}

.detail-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0071d0 0%, #0056b3 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 113, 208, 0.25);
}

.detail-icon i {
    color: #ffffff !important;
}

.detail-item-price .detail-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.detail-item-price .detail-icon i {
    color: #ffffff !important;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.detail-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.price-value {
    color: #10b981;
    font-size: 1.25rem;
}

.price-value .cur {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Video Container */
.modern-video-container {
    border-radius: 16px;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modern-video-player {
    width: 100%;
    height: 500px;
    display: block;
}

/* RTL Support */
[dir="rtl"] .modern-modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .gallery-nav-prev {
    left: auto;
    right: 16px;
}

[dir="rtl"] .gallery-nav-next {
    right: auto;
    left: 16px;
}

[dir="rtl"] .amenity-item:hover {
    transform: translateX(-4px);
}

[dir="rtl"] .modern-nav-link i {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .modern-section-title i,
[dir="rtl"] .modern-nav-link i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* RTL Support for chip-style tabs on mobile */
@media (max-width: 991.98px) {
    [dir="rtl"] .modern-nav-link i {
        margin-left: 0.375rem;
        margin-right: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .modern-property-modal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }

    .modern-modal-header {
        padding: 1rem 1.25rem;
    }

    .modern-modal-title {
        font-size: 1.25rem;
    }

    .modern-modal-body {
        padding: 1.25rem;
    }

    /* Chip-style tabs on mobile */
    .modern-nav-pills {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
        justify-content: center;
    }

    .modern-nav-link {
        width: auto;
        flex: 0 0 auto;
        padding: 0.625rem 1rem;
        border-radius: 20px;
        border: 1.5px solid #e5e7eb;
        background: #ffffff;
        color: #6b7280;
        font-size: 0.875rem;
        white-space: nowrap;
        min-width: fit-content;
    }

    .modern-nav-link i {
        font-size: 0.875rem;
        margin-right: 0.375rem;
        margin-left: 0;
    }

    .modern-nav-link:hover {
        border-color: #0071d0;
        background: rgba(0, 113, 208, 0.05);
        color: #0071d0;
    }

    .modern-nav-link.active {
        background: linear-gradient(135deg, #0071d0 0%, #0056b3 100%);
        border-color: #0071d0;
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 113, 208, 0.25);
    }

    .modern-nav-link.active i {
        color: #ffffff !important;
    }

    /* RTL adjustments for mobile chips */
    [dir="rtl"] .modern-nav-link {
        flex-direction: row-reverse;
    }

    [dir="rtl"] .modern-nav-link i {
        margin-right: 0;
        margin-left: 0.375rem;
    }

    [dir="rtl"] .modern-nav-pills {
        flex-direction: row;
    }

    .gallery-main-image {
        height: 300px;
    }

    .modern-section-card {
        margin-bottom: 1rem;
    }

    .amenities-tbody {
        grid-template-columns: 1fr;
    }

    .modern-details-grid {
        grid-template-columns: 1fr;
    }

    .modern-video-player {
        height: 300px;
    }

    .gallery-nav-btn {
        opacity: 1;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .gallery-nav-prev {
        left: 10px;
    }

    .gallery-nav-next {
        right: 10px;
    }
}

@media (max-width: 575.98px) {
    .modern-property-modal .modal-dialog {
        max-width: 100%;
        margin: 0;
        height: 100vh;
    }

    .modern-property-modal .modal-content {
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .modern-modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
    }

    .gallery-main-image {
        height: 250px;
    }

    .modern-video-player {
        height: 250px;
    }
}

/* Smooth Transitions */
.modern-property-modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.modern-property-modal.show .modal-dialog {
    transform: none;
}

/* Scrollbar Styling */
.modern-amenities-grid::-webkit-scrollbar {
    width: 6px;
}

.modern-amenities-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.modern-amenities-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modern-amenities-grid::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

