/**
 * Interactive Building Floor Map - Frontend Styles
 * 75/25 layout with side panel for floor details
 */

/* Main Layout Container */
.ibfm-layout {
    display: flex;
    width: 100%;
    min-height: 500px;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
}

/* Map Section - 75% */
.ibfm-map-section {
    flex: 0 0 75%;
    max-width: 75%;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Map Wrapper - handles scaling */
.ibfm-map-wrapper {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

/* Container styling */
.building-container {
    position: relative;
    display: inline-block;
    transform-origin: top left;
}

.building-container img.building-map {
    display: block;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Details Panel - 25% */
.ibfm-details-panel {
    flex: 0 0 25%;
    max-width: 25%;
    background: #000;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: #fff;
}

/* Panel Header */
.ibfm-panel-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ibfm-panel-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 8px 0;
}

.ibfm-floor-name {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* Empty State */
.ibfm-panel-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

.ibfm-panel-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.ibfm-panel-empty p {
    margin: 0;
    font-size: 14px;
}

/* Panel Content */
.ibfm-panel-content {
    display: none;
    flex-direction: column;
    flex: 1;
}

.ibfm-panel-content.active {
    display: flex;
}

/* Availability Badge */
.ibfm-availability {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
}

.ibfm-availability.available {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.ibfm-availability.limited {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.ibfm-availability.full {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

/* Price Display */
.ibfm-price-display {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
}

.ibfm-price-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ibfm-price-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

/* Info Grid */
.ibfm-info-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.ibfm-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ibfm-info-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.ibfm-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

/* Floor Plan Image in Panel */
.ibfm-floor-plan-thumb {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ibfm-floor-plan-thumb:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* View Details Button */
.ibfm-view-details-btn {
    background: #fff;
    color: #1a1a2e;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    margin-top: auto;
}

.ibfm-view-details-btn:hover {
    transform: translateY(-2px);
    background: #f0f0f0;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

/* Custom Content Area */
.ibfm-custom-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.ibfm-custom-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Tooltip styling - smaller on hover */
.floor-tooltip {
    position: absolute;
    background: rgba(30, 30, 63, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    min-width: 180px;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floor-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(30, 30, 63, 0.95);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.floor-label {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.availability-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.tooltip-content {
    display: none;
}

.tooltip-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-align: center;
}

.close-tooltip {
    display: none;
}

/* Hide old elements */
.price-range,
.info-row,
.view-units-btn {
    display: none;
}

/* Highlight effect for the area */
area {
    cursor: pointer;
}

/* Modal Popup - for expanded floor plan view */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    padding: 20px 25px;
    background: #1e1e3f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 25px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    background: #0f0f23;
}

.floor-plan-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-custom-content {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.modal-custom-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Responsive */
@media screen and (max-width: 900px) {
    .ibfm-layout {
        flex-direction: column;
    }

    .ibfm-map-section,
    .ibfm-details-panel {
        flex: none;
        max-width: 100%;
    }

    .ibfm-map-section {
        padding: 15px;
    }

    .ibfm-details-panel {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 20px;
    }
}
