/* Room Map Modal Styles */
.room-map-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.room-map-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.room-map-btn:focus {
    outline: 2px solid #007acc;
    outline-offset: 2px;
}

/* Modal Overlay */
.room-map-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.room-map-modal.active {
    display: flex;
}

/* Modal Content */
.room-map-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Close Button */
.room-map-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.room-map-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.room-map-close:focus {
    outline: 2px solid #007acc;
}

/* Map Image */
.room-map-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Legend toggle button */
.room-map-legend-toggle {
    position: absolute;
    top: 12px;
    right: 62px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-map-legend-toggle:hover {
    background: rgba(0,0,0,0.8);
}

/* Legend overlay */
.room-map-legend {
    position: absolute;
    bottom: 18px;
    left: 18px;
    background: rgba(255,255,255,0.95);
    color: #222;
    border-radius: 8px;
    padding: 12px 14px;
    max-width: 320px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    z-index: 1002;
}

.room-map-legend .legend-title {
    margin: 0 0 8px 0;
    font-size: 1em;
}

.room-map-legend .legend-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.room-map-legend .legend-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.95em;
}

.room-map-legend .legend-list img {
    width: 20px;
    height: 20px;
}

.room-map-legend .legend-footer {
    margin-top: 8px;
    font-size: 0.9em;
}

/* Loading State */
.room-map-loading {
    padding: 40px;
    text-align: center;
    color: #666;
}

.room-map-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #007acc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.room-map-error {
    padding: 40px;
    text-align: center;
    color: #d32f2f;
    background: #ffebee;
    border-radius: 4px;
    margin: 20px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .room-map-modal {
        padding: 10px;
    }
    
    .room-map-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .room-map-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .room-map-btn {
        font-size: 14px;
        padding: 1px 4px;
        margin-left: 6px;
    }

    .room-map-legend {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
}

/* Accessibility Improvements */
.room-map-modal:focus-within .room-map-close {
    outline: 2px solid #007acc;
}

/* Ensure modal is above other content */
.room-map-modal {
    z-index: 9999;
}
