/* ========================================
   360° Viewer Frontend Styles
   ======================================== */

/* Container */
.viewer-360-container {
    position: relative;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Panorama Viewer */
.viewer-360-panorama {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: #000 !important;
}

/* Temporary viewer for crossfade transitions */
.viewer-360-temp-panorama {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000 !important;
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 10;
}

/* Pannellum container - keep background consistent */
.viewer-360-panorama .pnlm-container,
.viewer-360-temp-panorama .pnlm-container {
    background: #000 !important;
}

.viewer-360-panorama .pnlm-render-container,
.viewer-360-temp-panorama .pnlm-render-container {
    background: #000 !important;
}

/* Prevent white flash during panorama switching */
.viewer-360-panorama canvas,
.viewer-360-temp-panorama canvas {
    background: #000 !important;
}

/* Loading Screen - ONLY SHOWN ON FIRST LOAD */
.viewer-360-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.spinner-container {
    margin-bottom: 20px;
}

.viewer-360-loading .spinner {
    display: block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.viewer-360-loading .loading-text {
    display: block;
    font-size: 18px;
    font-weight: 500;
}

/* ========================================
   SHARE BUTTON & MODAL
   ======================================== */

/* Share button - matches other controls */
.viewer-360-panorama .pnlm-share-button,
.viewer-360-temp-panorama .pnlm-share-button {
     position: static !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 4 !important;
    transition: transform 0.2s, opacity 0.2s !important;
    opacity: 0.9 !important;
}

/* Share button image */
.viewer-360-panorama .pnlm-share-button img,
.viewer-360-temp-panorama .pnlm-share-button img {
    width: 32px !important;
    height: 32px !important;
    display: block !important;
    pointer-events: none !important;
    filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
}

.viewer-360-panorama .pnlm-share-button:hover,
.viewer-360-temp-panorama .pnlm-share-button:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.15) !important;
    border-color: transparent !important;
    opacity: 1 !important;
}

/* Remove the ::before pseudo-element */
.viewer-360-panorama .pnlm-share-button::before,
.viewer-360-temp-panorama .pnlm-share-button::before {
    display: none !important;
}

/* Share Modal */
.viewer-360-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.share-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px 30px 30px;
    max-width: 500px;
    width: 90%;
    z-index: 2;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.share-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.2s;
}

.share-modal-close:hover {
    background: #f5f5f5;
    border-color: #333;
    transform: scale(1.1);
}

.share-modal-title {
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.share-btn {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #f5f5f5;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.share-btn svg {
    width: 40px;
    height: 40px;
}

.share-url-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.share-url-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    background: #f9f9f9;
}

.share-copy-btn {
    padding: 12px 24px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.share-copy-btn:hover {
    background: #135e96;
}

/* ========================================
   Floor Plan / Map Feature
   ======================================== */

/* Map Toggle Button - TOP LEFT, HIGH Z-INDEX */
.viewer-360-map-toggle {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 1000 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: transform 0.2s, opacity 0.2s !important;
    opacity: 0.9 !important;
}

.viewer-360-map-toggle:hover {
    background: transparent !important;
    transform: scale(1.15) !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

.viewer-360-map-toggle svg {
    width: 28px !important;
    height: 28px !important;
    color: white !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
}

/* Hide Pannellum's default icons inside buttons */
.viewer-360-panorama .pnlm-zoom-in *,
.viewer-360-panorama .pnlm-zoom-out *,
.viewer-360-panorama .pnlm-fullscreen-toggle-button *,
.viewer-360-temp-panorama .pnlm-zoom-in *,
.viewer-360-temp-panorama .pnlm-zoom-out *,
.viewer-360-temp-panorama .pnlm-fullscreen-toggle-button * {
    display: none !important;
}

/* Floor Plan Card - TOP LEFT, NEXT TO BUTTON */
.viewer-360-map-card {
    position: absolute !important;
    top: 12px !important;
    left: 60px !important;
    z-index: 999 !important;
    width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    overflow: visible !important;
}

/* Close button - COMPLETELY OUTSIDE */
.map-card-close {
    position: absolute !important;
    top: -18px !important;
    right: -18px !important;
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.map-card-close:hover {
    background: #f5f5f5;
    border-color: #333;
    transform: scale(1.1);
}

.map-card-close svg {
    color: #333;
}

/* Card content */
.map-card-content {
    position: relative;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    max-height: calc(100vh - 120px);
}

.floor-plan-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    max-height: 400px;
    object-fit: contain;
}

/* Hotspot markers */
.map-hotspot {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #2271b1;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 5;
    padding: 0;
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.4);
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.map-hotspot:hover {
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(34, 113, 177, 0.8);
    opacity: 1;
}

.map-hotspot:hover .map-hotspot-label {
    opacity: 1;
    visibility: visible;
}

.map-hotspot-pulse {
    position: absolute;
    inset: -4px;
    border: 2px solid #2271b1;
    border-radius: 50%;
    opacity: 0.6;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.map-hotspot-label {
    display: none !important;
}

.current-location-indicator {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 6;
    pointer-events: none;
    animation: location-pulse 2s ease-in-out infinite;
}

@keyframes location-pulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* ========================================
   PANNELLUM CONTROLS - COMPLETELY CUSTOM
   ======================================== */

/* HIDE COMPASS - WE DON'T NEED IT */
.viewer-360-panorama .pnlm-compass,
.viewer-360-temp-panorama .pnlm-compass {
    display: none !important;
    visibility: hidden !important;
}

/* Hide any other Pannellum UI elements we don't need */
.viewer-360-panorama .pnlm-orientation-button,
.viewer-360-panorama .pnlm-hot-spot-debug-indicator,
.viewer-360-temp-panorama .pnlm-orientation-button,
.viewer-360-temp-panorama .pnlm-hot-spot-debug-indicator {
    display: none !important;
}

/* Main controls container - BOTTOM RIGHT */
.viewer-360-panorama .pnlm-controls-container,
.viewer-360-temp-panorama .pnlm-controls-container {
    position: absolute !important;
    bottom: 16px !important;
    right: 16px !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    align-items: center !important;
    z-index: 100 !important;
    transition: bottom 0.4s ease !important;
}

/* Remove any nested positioning */
.viewer-360-panorama .pnlm-zoom-controls,
.viewer-360-temp-panorama .pnlm-zoom-controls {
    position: static !important;
    display: contents !important;
}

/* ===== GALLERY/WINDOW BUTTON (BOTTOM LEFT - SEPARATE) ===== */
.viewer-360-panorama .pnlm-gallery-button,
.viewer-360-temp-panorama .pnlm-gallery-button {
    position: absolute !important;
    bottom: 16px !important;
    left: 16px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 101 !important;
    transition: transform 0.2s, opacity 0.2s !important;
    opacity: 0.9 !important;
}

.viewer-360-panorama .pnlm-gallery-button svg,
.viewer-360-temp-panorama .pnlm-gallery-button svg {
    width: 32px !important;
    height: 32px !important;
    color: white !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
}

.viewer-360-panorama .pnlm-gallery-button:hover,
.viewer-360-temp-panorama .pnlm-gallery-button:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.15) !important;
    border-color: transparent !important;
    opacity: 1 !important;
}

/* When slider is open, highlight the gallery button and move it up */
.viewer-360-container.slider-open .pnlm-gallery-button {
    background: transparent !important;
    border-color: transparent !important;
    bottom: 155px !important;
    transform: scale(1.2) !important;
}

.viewer-360-container.slider-open .pnlm-gallery-button svg {
    color: #4db8ff !important;
}

/* ===== ZOOM IN BUTTON (+) ===== */
.viewer-360-panorama .pnlm-zoom-in,
.viewer-360-temp-panorama .pnlm-zoom-in {
    position: static !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 32px !important;
    font-weight: bold !important;
    color: white !important;
    line-height: 1 !important;
    order: 1 !important;
    transition: transform 0.2s, opacity 0.2s !important;
    opacity: 0.9 !important;
}

.viewer-360-panorama .pnlm-zoom-in::before,
.viewer-360-temp-panorama .pnlm-zoom-in::before {
    content: '+' !important;
    display: block !important;
    font-size: 32px !important;
    font-weight: bold !important;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.viewer-360-panorama .pnlm-zoom-in:hover,
.viewer-360-temp-panorama .pnlm-zoom-in:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.2) !important;
    border-color: transparent !important;
    opacity: 1 !important;
}

/* ===== ZOOM OUT BUTTON (-) ===== */
.viewer-360-panorama .pnlm-zoom-out,
.viewer-360-temp-panorama .pnlm-zoom-out {
    position: static !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 32px !important;
    font-weight: bold !important;
    color: white !important;
    line-height: 1 !important;
    order: 2 !important;
    transition: transform 0.2s, opacity 0.2s !important;
    opacity: 0.9 !important;
}

.viewer-360-panorama .pnlm-zoom-out::before,
.viewer-360-temp-panorama .pnlm-zoom-out::before {
    content: '−' !important;
    display: block !important;
    font-size: 32px !important;
    font-weight: bold !important;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.viewer-360-panorama .pnlm-zoom-out:hover,
.viewer-360-temp-panorama .pnlm-zoom-out:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.2) !important;
    border-color: transparent !important;
    opacity: 1 !important;
}

/* ===== FULLSCREEN BUTTON (⛶) ===== */
.viewer-360-panorama .pnlm-fullscreen-toggle-button,
.viewer-360-temp-panorama .pnlm-fullscreen-toggle-button {
    position: static !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 3 !important;
    transition: transform 0.2s, opacity 0.2s !important;
    opacity: 0.9 !important;
}

.viewer-360-panorama .pnlm-fullscreen-toggle-button::before,
.viewer-360-temp-panorama .pnlm-fullscreen-toggle-button::before {
    content: '⛶' !important;
    display: block !important;
    font-size: 24px !important;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.viewer-360-panorama .pnlm-fullscreen-toggle-button:hover,
.viewer-360-temp-panorama .pnlm-fullscreen-toggle-button:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.2) !important;
    border-color: transparent !important;
    opacity: 1 !important;
}

/* Hide Pannellum's default icons inside buttons */
.viewer-360-panorama .pnlm-zoom-in *,
.viewer-360-panorama .pnlm-zoom-out *,
.viewer-360-panorama .pnlm-fullscreen-toggle-button *,
.viewer-360-temp-panorama .pnlm-zoom-in *,
.viewer-360-temp-panorama .pnlm-zoom-out *,
.viewer-360-temp-panorama .pnlm-fullscreen-toggle-button * {
    display: none !important;
}

/* ========================================
   BOTTOM SLIDER - COMPLETELY HIDDEN BY DEFAULT
   ======================================== */

.viewer-360-bottom-slider {
    position: absolute;
    bottom: -150px;
    left: 0;
    right: 0;
    height: 140px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 0 0 12px 12px;
    transition: bottom 0.4s ease;
    z-index: 50;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.viewer-360-bottom-slider.active {
    bottom: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Move controls UP when slider is open */
.viewer-360-container.slider-open .pnlm-controls-container {
    bottom: 155px !important;
}

/* Slider wrapper */
.bottom-slider-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 45px;
}

/* Slider track - horizontal scroll */
.bottom-slider-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 15px 10px;
    flex: 1;
    height: 100%;
    align-items: center;
}

.bottom-slider-track::-webkit-scrollbar {
    height: 6px;
}

.bottom-slider-track::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.bottom-slider-track::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.bottom-slider-track::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Slider item */
.bottom-slider-item {
    position: relative;
    flex-shrink: 0;
    width: 140px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    background: #000;
}

.bottom-slider-item:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.bottom-slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.bottom-slider-item:hover img {
    opacity: 1;
}

/* Item label */
.slider-item-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 6px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Active indicator */
.slider-item-active {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #2271b1;
    border: 2px solid white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.bottom-slider-item.active {
    border-color: #2271b1;
    transform: scale(1.08);
}

.bottom-slider-item.active img {
    opacity: 1;
}

.bottom-slider-item.active .slider-item-active {
    opacity: 1;
    animation: pulse-active 2s ease-in-out infinite;
}

@keyframes pulse-active {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Navigation arrows - NO BUTTON STYLING */
.slider-nav-prev,
.slider-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 60px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.2s;
    opacity: 0.7;
}

.slider-nav-prev:hover,
.slider-nav-next:hover {
    opacity: 1;
}

.slider-nav-prev {
    left: 5px;
}

.slider-nav-next {
    right: 5px;
}

.slider-nav-prev svg,
.slider-nav-next svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* Hot spot container */
.panorama-hotspot {
    cursor: pointer !important;
}

.hotspot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

.hotspot-arrow {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

.hotspot-arrow img {
    display: block;
    width: 60px;
    height: auto;
}

.hotspot-label {
    color: white;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,1);
    pointer-events: none;
}

.panorama-hotspot:hover .hotspot-arrow img {
    transform: scale(1.15);
    transition: transform 0.2s;
}

/* ========================================
   Info Bar & Error State
   ======================================== */

.viewer-360-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 0 5px;
}

.viewer-360-hint {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.viewer-360-error {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    color: #c00;
    text-align: center;
}

.viewer-360-error p {
    margin: 0;
    font-size: 14px;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .viewer-360-container {
        margin: 15px 0;
    }
    
    .viewer-360-panorama {
        border-radius: 8px;
    }
    
    /* Gallery button - bottom left on mobile */
    .viewer-360-panorama .pnlm-gallery-button,
    .viewer-360-temp-panorama .pnlm-gallery-button {
        /* bottom: 12px !important;
        left: 12px !important; */
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }
    
    .viewer-360-panorama .pnlm-gallery-button svg,
    .viewer-360-temp-panorama .pnlm-gallery-button svg {
        width: 28px !important;
        height: 28px !important;
    }
    
    .viewer-360-container.slider-open .pnlm-gallery-button {
        bottom: 135px !important;
    }
    
    /* Other Controls - bottom right */
    .viewer-360-panorama .pnlm-controls-container,
    .viewer-360-temp-panorama .pnlm-controls-container {
        bottom: 12px !important;
        right: 12px !important;
        gap: 8px !important;
    }
    
    .viewer-360-panorama .pnlm-zoom-in,
    .viewer-360-panorama .pnlm-zoom-out,
    .viewer-360-panorama .pnlm-fullscreen-toggle-button,
    .viewer-360-panorama .pnlm-share-button,
    .viewer-360-temp-panorama .pnlm-zoom-in,
    .viewer-360-temp-panorama .pnlm-zoom-out,
    .viewer-360-temp-panorama .pnlm-fullscreen-toggle-button,
    .viewer-360-temp-panorama .pnlm-share-button {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }
    
    .viewer-360-panorama .pnlm-share-button img,
    .viewer-360-temp-panorama .pnlm-share-button img {
        width: 28px !important;
        height: 28px !important;
    }
    
    .viewer-360-panorama .pnlm-zoom-in::before,
    .viewer-360-panorama .pnlm-zoom-out::before,
    .viewer-360-temp-panorama .pnlm-zoom-in::before,
    .viewer-360-temp-panorama .pnlm-zoom-out::before {
        font-size: 28px !important;
    }
    
    .viewer-360-panorama .pnlm-fullscreen-toggle-button::before,
    .viewer-360-temp-panorama .pnlm-fullscreen-toggle-button::before {
        font-size: 22px !important;
    }
    
    /* Bottom Slider */
    .viewer-360-bottom-slider {
        height: 120px;
        bottom: -130px;
    }
    
    .viewer-360-bottom-slider.active {
        bottom: 0;
    }
    
    .viewer-360-container.slider-open .pnlm-controls-container {
        bottom: 135px !important;
    }
    
    .bottom-slider-wrapper {
        padding: 0 35px;
    }
    
    .bottom-slider-track {
        gap: 10px;
        padding: 12px 8px;
    }
    
    .bottom-slider-item {
        width: 110px;
        height: 80px;
    }
    
    .slider-item-label {
        font-size: 11px;
        padding: 6px 4px;
    }
    
    .slider-nav-prev,
    .slider-nav-next {
        width: 30px;
        height: 50px;
    }
    
    .slider-nav-prev svg,
    .slider-nav-next svg {
        width: 20px;
        height: 20px;
    }
    
    /* Info */
    .viewer-360-hint {
        display: none;
    }
    
    .viewer-360-title {
        font-size: 14px;
    }
    
    /* Loading */
    .viewer-360-loading .loading-text {
        font-size: 16px;
    }
    
    .viewer-360-loading .spinner {
        width: 40px;
        height: 40px;
    }
    
    /* Map */
    .viewer-360-map-card {
        width: 160px !important;
        top: 10px !important;
        left: 50px !important;
    }
    
    .map-card-close {
        width: 28px;
        height: 28px;
        top: -16px !important;
        right: -16px !important;
    }
    
    .map-card-close svg {
        width: 14px;
        height: 14px;
    }
    
    .floor-plan-image {
        max-height: 280px;
    }
    
    .viewer-360-map-toggle {
        width: 32px !important;
        height: 32px !important;
        padding: 6px;
        top: 10px !important;
        left: 10px !important;
    }
    
    .viewer-360-map-toggle svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    .map-hotspot {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }
    
    /* Share Modal */
    .share-modal-content {
        padding: 20px 15px 15px;
        width: 90%;
        max-width: 350px;
        border-radius: 12px;
    }
    
    .share-modal-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .share-buttons {
        gap: 10px;
    }
    
    .share-btn {
        width: 50px;
        height: 50px;
    }
    
    .share-btn svg {
        width: 32px;
        height: 32px;
    }
    
    .share-url-container {
        flex-direction: column;
    }
    
    .share-copy-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Gallery button */
    .viewer-360-panorama .pnlm-gallery-button,
    .viewer-360-temp-panorama .pnlm-gallery-button {
        bottom: 10px !important;
        left: 10px !important;
    }
    
    .viewer-360-container.slider-open .pnlm-gallery-button {
        bottom: 115px !important;
    }
    
    /* Bottom Slider */
    .viewer-360-bottom-slider {
        height: 100px;
        bottom: -110px;
    }
    
    .viewer-360-container.slider-open .pnlm-controls-container {
        bottom: 115px !important;
    }
    
    .bottom-slider-wrapper {
        padding: 0 30px;
    }
    
    .bottom-slider-item {
        width: 90px;
        height: 65px;
    }
    
    .slider-item-label {
        font-size: 10px;
        padding: 5px 3px;
    }
    
    .slider-nav-prev,
    .slider-nav-next {
        width: 25px;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .viewer-360-hint::before {
        content: '👆 ';
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .viewer-360-title {
        color: #e0e0e0;
    }
    
    .viewer-360-hint {
        color: #a0a0a0;
    }
}

/* ========================================
   NEW FEATURES - Add to existing viewer.css
   ======================================== */

/* Password Protection Form */
.viewer-360-password-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 40px;
    max-width: 450px;
    margin: 40px auto;
    text-align: center;
}

.password-form-content h3 {
    margin: 0 0 15px;
    font-size: 24px;
    color: #333;
}

.password-form-content p {
    margin: 0 0 25px;
    color: #666;
    font-size: 15px;
}

.password-form-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.password-form-content input[type="password"] {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.password-form-content input[type="password"]:focus {
    outline: none;
    border-color: #2271b1;
}

.password-form-content button {
    padding: 12px 24px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.password-form-content button:hover {
    background: #135e96;
}

/* Info Modal */
.viewer-360-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.info-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.info-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #333;
    transition: all 0.2s;
}

.info-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.info-modal-content h3 {
    margin: 0 0 20px;
    font-size: 24px;
    color: #333;
    padding-right: 40px;
}

.info-modal-body {
    color: #555;
    line-height: 1.6;
}

.info-modal-body p {
    margin: 0 0 15px;
}

.info-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

/* Video Modal */
.viewer-360-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1;
}

.video-modal-content {
    position: relative;
    background: #000;
    border-radius: 16px;
    padding: 20px;
    max-width: 900px;
    width: 90%;
    z-index: 2;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.video-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #333;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.video-modal-close:hover {
    background: #f5f5f5;
    transform: rotate(90deg) scale(1.1);
}

.video-modal-content h3 {
    margin: 0 0 15px;
    font-size: 20px;
    color: white;
    padding-right: 40px;
}

.video-modal-body {
    border-radius: 8px;
    overflow: hidden;
}

.video-modal-body iframe,
.video-modal-body video {
    display: block;
    border-radius: 8px;
}

/* Enhanced Hotspot Types */
.hotspot-info .hotspot-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 5px 12px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.hotspot-video .hotspot-label {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 5px 12px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
}

.hotspot-link .hotspot-label {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 5px 12px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.4);
}

/* Responsive for new modals */
@media (max-width: 768px) {
    .viewer-360-password-form {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .info-modal-content,
    .video-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .info-modal-content h3,
    .video-modal-content h3 {
        font-size: 18px;
    }
    
    .video-modal-body iframe,
    .video-modal-body video {
        height: 250px !important;
    }
}

/* ========================================
   ORIENTATION INDICATOR - SMOOTH RADAR CONE
   ======================================== */

.map-orientation-indicator {
    position: absolute;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 7;
    display: block !important;
}

.orientation-cone {
    position: absolute;
    top: 0;
    left: 50%;
    width: 80px;
    height: 80px;
    transform-origin: center center;
    /* ✅ SMOOTH real-time rotation - no transition delay */
    transform: translateX(-50%);
}

.orientation-cone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(
        from 90deg at 50% 50%,
        transparent 0deg,
        transparent 45deg,
        rgba(34, 113, 177, 0.4) 45deg,
        rgba(34, 113, 177, 0.5) 90deg,
        rgba(34, 113, 177, 0.4) 135deg,
        transparent 135deg,
        transparent 360deg
    );
    border-radius: 50%;
    /* ✅ No rotation here - all handled in JS */
}

.orientation-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #2271b1;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

/* ========================================
   ANNOTATION MODAL
   ======================================== */

.viewer-360-annotation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.annotation-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1;
}

.annotation-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px 30px 30px;
    max-width: 500px;
    width: 90%;
    z-index: 2;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.annotation-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.2s;
}

/* .annotation-modal-close:hover {
    background: #f5f5f5 !important;
    transform: rotate(90deg) scale(1.15) !important;
    border-color: #999 !important;
} */

.annotation-modal-title {
    margin: 0 0 15px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    padding-right: 0; /* Remove padding */
}

.annotation-modal-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.annotation-modal-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 250px;
    object-fit: cover;
}

.annotation-modal-description {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
}

/* REMOVE ANNOTATION BADGE - Simple text only */
.panorama-hotspot.hotspot-annotation .hotspot-label {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .annotation-modal-content {
        padding: 28px 20px 20px;
        width: 90%;
        max-width: 380px;
        max-height: 75vh;
    }
    
    .annotation-modal-close {
        top: -14px !important;
        right: -14px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 20px !important;
        line-height: 28px !important;
    }
    
    .annotation-modal-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .annotation-modal-description {
        font-size: 13px;
    }
    
    .annotation-modal-image img {
        max-height: 200px;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
     .map-orientation-indicator {
        width: 60px;
        height: 60px;
    }
    
    .orientation-cone {
        width: 60px;
        height: 60px;
    }
    
    .orientation-dot {
        width: 10px;
        height: 10px;
    }
}

/* ========================================
   TITLE MARQUEE - INSIDE VIEWER AT TOP
   ======================================== */

.viewer-360-title-marquee {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 0;
    z-index: 90;
    overflow: hidden;
    pointer-events: none;
    white-space: nowrap;
}

.viewer-360-title-marquee-inner {
    display: inline-block;
    padding-left: 100%;
    animation: marquee-scroll 15s linear infinite;
}

.viewer-360-title {
    font-size: 18px;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    display: inline-block;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Pause animation on hover */
.viewer-360-title-marquee:hover .viewer-360-title-marquee-inner {
    animation-play-state: paused;
}

/* Hide the old bottom info bar */
.viewer-360-info {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .viewer-360-title-marquee {
        padding: 10px 0;
    }
    
    .viewer-360-title {
        font-size: 16px;
    }
    
    .viewer-360-title-marquee-inner {
        animation: marquee-scroll 12s linear infinite;
    }
}

@media (max-width: 480px) {
    .viewer-360-title-marquee {
        padding: 8px 0;
    }
    
    .viewer-360-title {
        font-size: 14px;
    }
    
    .viewer-360-title-marquee-inner {
        animation: marquee-scroll 10s linear infinite;
    }
}

/* ========================================
   EMBED MODE - FULL SCREEN OVERRIDE
   ======================================== */

/* Only apply these styles when in embed mode */
.embed-mode .viewer-360-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

.embed-mode .viewer-360-panorama {
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure Pannellum containers fill the space in embed mode */
.embed-mode .viewer-360-panorama .pnlm-container,
.embed-mode .viewer-360-temp-panorama .pnlm-container {
    width: 100vw !important;
    height: 100vh !important;
}

.embed-mode .viewer-360-panorama canvas,
.embed-mode .viewer-360-temp-panorama canvas {
    width: 100vw !important;
    height: 100vh !important;
}

/* Controls positioning in embed mode - keep them visible */
.embed-mode .viewer-360-panorama .pnlm-controls-container,
.embed-mode .viewer-360-temp-panorama .pnlm-controls-container {
    bottom: 16px !important;
    right: 16px !important;
}

.embed-mode .viewer-360-panorama .pnlm-gallery-button,
.embed-mode .viewer-360-temp-panorama .pnlm-gallery-button {
    bottom: 16px !important;
    left: 16px !important;
}

/* Map toggle in embed mode */
.embed-mode .viewer-360-map-toggle {
    top: 12px !important;
    left: 12px !important;
}

.embed-mode .viewer-360-map-card {
    top: 12px !important;
    left: 60px !important;
}

/* Bottom slider in embed mode */
.embed-mode .viewer-360-container.slider-open .pnlm-controls-container {
    bottom: 155px !important;
}

.embed-mode .viewer-360-container.slider-open .pnlm-gallery-button {
    bottom: 155px !important;
}

/* Title marquee in embed mode */
.embed-mode .viewer-360-title-marquee {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 90 !important;
}