* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

#map {
    height: 500px;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-bottom: 30px;
    border: 3px solid white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.close-btn:active {
    transform: scale(0.95);
}

.modal-body {
    padding: 0;
    position: relative;
}

#pannellum-container {
    width: 100%;
    height: 500px;
    border-radius: 0 0 15px 15px;
}

/* Ensure Pannellum zoom controls are visible */
.pnlm-zoom-controls {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.pnlm-zoom-controls .pnlm-zoom-in,
.pnlm-zoom-controls .pnlm-zoom-out {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.pnlm-zoom-controls .pnlm-zoom-in:hover,
.pnlm-zoom-controls .pnlm-zoom-out:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.1) !important;
}

.tour-controls {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 1200 !important;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.control-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.control-btn:active {
    transform: translateY(0);
}

footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    opacity: 0.8;
}

/* Custom Map Marker Styles */
.custom-marker {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.custom-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Enhanced Map Controls */
.leaflet-control-layers {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.leaflet-control-layers-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3) !important;
}

.leaflet-control-zoom {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.leaflet-control-zoom a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    margin: 2px !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
    transition: all 0.3s ease !important;
}

.leaflet-control-zoom a:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.leaflet-control-scale {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 5px 10px !important;
}

.leaflet-control-scale-line {
    border: 2px solid #667eea !important;
    border-top: none !important;
    color: #333 !important;
    font-weight: bold !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    #map {
        height: 400px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    #pannellum-container {
        height: 400px;
    }

    .tour-controls {
        flex-direction: column;
        align-items: center;
    }

    .control-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    #map {
        height: 300px;
    }

    #pannellum-container {
        height: 300px;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    color: white;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    border: 3px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Embed mode: when loaded in iframe, remove background and chrome */
body.embed {
    background: transparent;
}
body.embed .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
}
body.embed header,
body.embed footer {
    display: none;
}
body.embed #map {
    height: 720px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    margin: 0;
}
body.embed #pannellum-container {
    height: 640px;
    border-radius: 12px;
}
/* End embed mode */

.exit-btn {
    position: absolute;
    right: 50px;
    top: 16px;
    z-index: 1250;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}
.exit-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
}

/* Floating controls inside the 360 viewer */
.floating-controls {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1300;
    background: rgba(0,0,0,0.6);
    padding: 10px 14px;
    border-radius: 24px;
    backdrop-filter: blur(8px);
}
.floating-controls .control-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.floating-controls .control-btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}
/* Ensure container is positioned for absolute children */
#pannellum-container {
    position: relative;
}

/* Compact top-left mini controls */
.mini-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    z-index: 1400;
    visibility: visible !important;
}
.mini-controls .mini-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.mini-controls .mini-btn:hover { background: #fff; }
