/* style.css - Fixed for mobile and auto-expanding route box */

/* ✅ FIXED: Image centering for guest panel */
#floorPlanImg {
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: contain;
    display: none;
}

/* ✅ FIXED: Hotel map container with centering */
hotel-map {
    position: relative;
    display: block;
    height: 500px;
    background: #f0f0f0;
    overflow: hidden;
    border: 1px solid #ddd;
    width: 100%;
}

/* Center the image container */
#hotelMapContainer {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation; /* ✅ Better touch handling */
}

/* ✅ FIXED: Marker styling for mobile */
.marker {
    position: absolute;
    width: 48px; /* ✅ Larger for mobile touch */
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px; /* ✅ Larger font */
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7); /* ✅ Stronger shadow */
    user-select: none; /* ✅ Prevent text selection */
    -webkit-user-select: none; /* ✅ Safari */
    pointer-events: auto; /* ✅ Ensure markers are clickable */
    border-radius: 50%; /* ✅ Circular markers */
    background-color: rgba(255, 255, 255, 0.9); /* ✅ White background for visibility */
    border: 3px solid #3b82f6; /* ✅ Blue border */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* ✅ Better shadow */
}

/* ✅ FIXED: Mobile touch optimization */
@media (max-width: 768px) {
    .marker {
        width: 56px; /* ✅ Even larger on mobile */
        height: 56px;
        font-size: 28px;
        border-width: 4px;
    }
    
    #hotelMapContainer {
        height: 400px; /* ✅ Slightly smaller on mobile */
    }
}

.marker.highlighted {
    transform: translate(-50%, -50%) scale(1.4); /* ✅ Larger highlight */
    z-index: 20;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8); /* ✅ Blue glow */
}

.marker.start {
    border: 4px solid #10b981; /* ✅ Green for start */
    background-color: rgba(16, 185, 129, 0.1); /* ✅ Light green background */
}

.marker.end {
    border: 4px solid #3b82f6; /* ✅ Blue for end */
    background-color: rgba(59, 130, 246, 0.1); /* ✅ Light blue background */
}

.connection {
    position: absolute;
    background: #94a3b8;
    transform-origin: 0 0;
    z-index: 1;
    opacity: 0.6;
    height: 4px; /* ✅ Slightly thicker */
}

.path-segment {
    position: absolute;
    background: #ef4444;
    transform-origin: 0 0;
    z-index: 5;
    opacity: 0.9;
    height: 6px; /* ✅ Thicker for visibility */
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.7); /* ✅ Stronger glow */
}

.path-segment.elevator {
    background: #f59e0b;
    border: 2px dashed #d97706;
    height: 8px; /* ✅ Thicker elevator segments */
    z-index: 4;
}

.elevator-indicator {
    position: absolute;
    width: 50px; /* ✅ Larger */
    height: 50px;
    background: rgba(245, 158, 11, 0.3); /* ✅ More visible */
    border: 4px solid #f59e0b;
    border-radius: 50%;
    z-index: 4;
    transform: translate(-50%, -50%);
}

/* ✅ FIXED: Auto-expanding route box */
#routeSteps {
    min-height: 120px; /* ✅ Minimum height */
    max-height: 400px; /* ✅ Maximum height before scroll */
    overflow-y: auto; /* ✅ Scroll if content is too long */
    transition: min-height 0.3s ease; /* ✅ Smooth expansion */
}

/* ✅ Custom scrollbar for route steps */
#routeSteps::-webkit-scrollbar {
    width: 6px;
}

#routeSteps::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#routeSteps::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#routeSteps::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ✅ Route container that expands */
.route-container {
    transition: all 0.3s ease;
}

/* Animation for highlighting */
@keyframes pulse {
    0% {
        opacity: 0.7;
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.9);
    }
    100% {
        opacity: 0.7;
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    }
}

@keyframes elevatorPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
}

.path-segment {
    animation: pulse 2s infinite;
}

.path-segment.elevator {
    animation: pulse 1.5s infinite;
}

.elevator-indicator {
    animation: elevatorPulse 2s infinite;
}

/* ✅ Mobile optimizations */
@media (max-width: 640px) {
    #hotelMapContainer {
        height: 350px; /* ✅ Smaller on very small screens */
    }
    
    .marker {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    
    #routeSteps {
        max-height: 300px; /* ✅ Smaller max height on mobile */
        font-size: 14px; /* ✅ Smaller text */
    }
}
