/* Colby 360 viewer - Frontend Stylesheet */

.vt360-container {
    position: relative;
    width: 100%;
    height: 500px;
    max-height: 80vh;
    background-color: #000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.vt360-container:-webkit-full-screen {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
}

.vt360-container:fullscreen {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
}

.vt360-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.vt360-canvas:active {
    cursor: grabbing;
}

/* Loading Overlay */
.vt360-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 18, 20, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

.vt360-loader.vt360-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.vt360-loader-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.3);
    z-index: -1;
}

.vt360-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: vt360-spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

.vt360-loader-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

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

/* Controls Overlay */
.vt360-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(15, 15, 20, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 30px;
    z-index: 5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0.9;
}

.vt360-controls:hover {
    opacity: 1;
}

.vt360-btn {
    background: transparent;
    border: none;
    outline: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.vt360-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.vt360-btn:active {
    transform: scale(0.95);
}

.vt360-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.vt360-btn.active {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.15);
}

/* Top Panel (Title & Compass) */
.vt360-top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 5;
}

.vt360-title {
    background: rgba(15, 15, 20, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.vt360-compass {
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(15, 15, 20, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.vt360-compass-arrow {
    width: 8px;
    height: 24px;
    position: relative;
    transition: transform 0.1s linear;
}

.vt360-compass-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 12px solid #ef4444; /* North (Red) */
}

.vt360-compass-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 12px solid #e2e8f0; /* South (White/Grey) */
}

/* Fallback States */
.vt360-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #1e293b;
    color: #ffffff;
    padding: 20px;
    text-align: center;
    border-radius: 12px;
}

.vt360-fallback-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.vt360-fallback-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.vt360-fallback-text {
    font-size: 14px;
    color: #94a3b8;
    max-width: 320px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.vt360-fallback-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
    cursor: pointer;
}

.vt360-fallback-btn:hover {
    background-color: #2563eb;
}

/* Gyroscope Permission Toast */
.vt360-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    color: #fff;
    text-align: center;
    z-index: 8;
    max-width: 280px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
}

.vt360-toast.active {
    display: block;
}

.vt360-toast-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.vt360-toast-desc {
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 15px;
    line-height: 1.4;
}

.vt360-toast-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.vt360-toast-btn {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.vt360-toast-btn-primary {
    background-color: #3b82f6;
    color: #fff;
}

.vt360-toast-btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .vt360-container {
        height: 350px;
    }
    .vt360-controls {
        bottom: 10px;
        padding: 4px 8px;
    }
    .vt360-btn {
        width: 32px;
        height: 32px;
    }
    .vt360-top-bar {
        top: 10px;
        left: 10px;
        right: 10px;
    }
}
