/**
 * Partnion360 Virtual Tour Styles
 */

/* =============================================================================
   Base Styles
   ============================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #1a1a1a;
}

/* =============================================================================
   Viewer Container
   ============================================================================= */

#viewer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, #4a4a4a 0%, #2a2a2a 100%);
}

/* =============================================================================
   Photo Sphere Viewer Customization
   ============================================================================= */

.psv-canvas-container {
    background: #3a3a3a !important;
}

.psv-notification-content {
    font-size: 14px;
}

/* =============================================================================
   Virtual Tour Arrow Overrides (Universal)
   Applies to both native PSV arrows and tour link arrows
   ============================================================================= */

/* Remove all transitions and animations */
.psv-virtual-tour-arrows,
.psv-virtual-tour-arrows .psv-virtual-tour-link,
.psv-virtual-tour-link,
.psv-virtual-tour-link.tour-link-external,
.psv-virtual-tour-arrow {
    transition: none !important;
    animation: none !important;
}

/* Arrow button styling */
.psv-virtual-tour-arrow {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
}

.psv-virtual-tour-arrow:hover {
    animation: none !important;
}

/* Tour link external - match native arrows exactly */
.psv-virtual-tour-link.tour-link-external {
    filter: drop-shadow(0 10px 2px rgba(0, 0, 0, 0.7));
    cursor: pointer;
    transform-origin: center;
}

/* =============================================================================
   Error Display
   ============================================================================= */

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background: #1a1a1a;
    color: #fff;
    text-align: center;
}

.error-container h2 {
    color: #dc3545;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
}

.error-container p {
    margin: 10px 0;
    color: #888;
    font-size: 14px;
    max-width: 400px;
}

/* =============================================================================
   Dev Tools - Coordinate Display
   ============================================================================= */

#coordinate-display {
    position: fixed;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    pointer-events: none;
    z-index: 10000;
    display: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#coordinate-display.active {
    display: block;
}

#coordinate-display .label {
    color: #888;
    margin-right: 4px;
}

#coordinate-display .value {
    color: #4ade80;
    font-weight: 600;
}

/* Crosshair cursor when coordinates are active */
#viewer.coordinates-active,
#viewer.coordinates-active .psv-container,
#viewer.coordinates-active .psv-canvas-container,
#viewer.coordinates-active canvas,
#viewer.coordinates-active * {
    cursor: crosshair !important;
}

/* Override PSV move cursor specifically */
#viewer.coordinates-active .psv-canvas-container[style*="cursor"] {
    cursor: crosshair !important;
}

/* =============================================================================
   Loading State
   ============================================================================= */

.loading-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
}

/* =============================================================================
   Description Overlay
   ============================================================================= */

.tour-description-overlay {
    position: absolute;
    bottom: 60px; /* Above the toolbar */
    left: 20px;
    max-width: 420px;
    max-height: 50vh;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 4px;
    color: #1a1a1a;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: move;
    user-select: none;
}

.tour-description-overlay.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tour-description-overlay.dragging {
    transition: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.description-content {
    padding: 16px 18px;
    position: relative;
}

.description-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: #333;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.tour-description-overlay:hover .description-close {
    opacity: 1;
}

.description-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.description-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    cursor: move;
}

.description-text {
    font-size: 14px;
    line-height: 1.6;
    color: #222;
    overflow-y: auto;
    max-height: calc(50vh - 80px);
    white-space: pre-wrap;
    cursor: default;
    user-select: text;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .tour-description-overlay {
        left: 10px;
        right: 10px;
        bottom: 70px;
        max-width: none;
    }
    
    .description-close {
        opacity: 1;
    }
}
