/**
 * Floorplan Frontend Styles
 * 
 * Styles for the interactive floorplan map on the frontend
 */

.floorplan-map-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    margin: 40px 0;
}

.floorplan-map-wrapper.no-legend {
    grid-template-columns: 1fr;
}

.floorplan-map-wrapper.no-legend .floorplan-legend {
    display: none;
}

.floorplan-map-container {
    position: relative;
    display: inline-block;
    width: 100%;
    overflow: hidden;
}

.floorplan-map-image {
    display: block;
    width: 100%;
    height: auto;
}

.floorplan-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floorplan-marker-frontend {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    pointer-events: all;
    transition: all 0.2s ease;
    
    /* Reset button styles */
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    outline: none;
}

.floorplan-marker-frontend:focus {
    outline: 2px solid #0073aa;
    outline-offset: 4px;
}

.floorplan-marker-frontend:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 20;
}

.floorplan-marker-frontend.active {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 30;
}

.floorplan-marker-frontend .marker-dot {
    display: block;
    width: 30px;
    height: 30px;
    background: #dc3232;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.floorplan-marker-frontend .marker-dot::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(0,0,0,0.3), 0 0 0 0 rgba(220, 50, 50, 0.7);
    }
    50% {
        box-shadow: 0 2px 6px rgba(0,0,0,0.3), 0 0 0 10px rgba(220, 50, 50, 0);
    }
}

/* Tooltip */
.floorplan-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 0;
    min-width: 280px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.floorplan-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #fff;
}

.floorplan-marker-frontend:hover .floorplan-tooltip,
.floorplan-marker-frontend.active .floorplan-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
    pointer-events: all;
}

.floorplan-tooltip .tooltip-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.floorplan-tooltip .tooltip-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floorplan-tooltip .tooltip-content {
    padding: 20px;
}

.floorplan-tooltip h4 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.floorplan-tooltip p {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.floorplan-tooltip .tooltip-link {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

.floorplan-tooltip .tooltip-link:hover {
    color: #005177;
}

/* Legend / Sidebar */
.floorplan-legend {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.floorplan-legend h3 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

.floorplan-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.floorplan-list li {
    margin-bottom: 12px;
}

.floorplan-list-item {
    display: block;
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 15px;
}

.floorplan-list-item:hover,
.floorplan-list-item.active {
    background: #0073aa;
    color: #fff;
    border-left-color: #005177;
    transform: translateX(3px);
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .floorplan-map-wrapper {
        grid-template-columns: 1fr;
    }
    
    .floorplan-legend {
        order: 2;
    }
    
    .floorplan-map-container {
        order: 1;
    }
    
    .floorplan-tooltip {
        min-width: 240px;
        max-width: 280px;
    }
}

@media screen and (max-width: 768px) {
    .floorplan-marker-frontend .marker-dot {
        width: 24px;
        height: 24px;
    }
    
    .floorplan-marker-frontend .marker-dot::after {
        font-size: 16px;
    }
    
    .floorplan-tooltip {
        min-width: 200px;
        max-width: 240px;
        font-size: 14px;
    }
    
    .floorplan-tooltip h4 {
        font-size: 16px;
    }
    
    .floorplan-tooltip .tooltip-image {
        height: 120px;
    }
    
    .floorplan-tooltip .tooltip-content {
        padding: 15px;
    }
}

/* Tooltip position adjustment for markers near edges */
.floorplan-marker-frontend.near-top .floorplan-tooltip {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 15px;
}

.floorplan-marker-frontend.near-top .floorplan-tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #fff;
}

.floorplan-marker-frontend.near-left .floorplan-tooltip {
    left: 0;
    transform: translateX(0);
}

.floorplan-marker-frontend.near-left .floorplan-tooltip::after {
    left: 20px;
}

.floorplan-marker-frontend.near-right .floorplan-tooltip {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.floorplan-marker-frontend.near-right .floorplan-tooltip::after {
    left: auto;
    right: 20px;
}

