/**
 * BEGRES 3D Viewer Styles
 * Professional architectural 3D viewer UI
 */

:root {
    --begres-primary: #1e67b9;
    --begres-dark: #2C3E50;
}

/* ===== Viewer Container ===== */
.viewer-container {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.viewer-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
}

.viewer-container canvas {
    display: block;
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e5;
    border-top-color: var(--begres-primary, #1e67b9);
    border-radius: 50%;
    animation: viewer-spin 1s linear infinite;
}

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

/* ===== Toolbar ===== */
.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--begres-dark, #2C3E50);
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 6px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

.toolbar-btn.active {
    background: var(--begres-primary, #1e67b9);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30, 103, 185, 0.3);
}

/* ===== Viewer Info Bar ===== */
.viewer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    font-size: 0.8rem;
    color: #666;
}

.viewer-info .model-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.viewer-info .model-status i {
    color: #28a745;
}

.viewer-info .viewer-hint {
    opacity: 0.7;
    font-size: 0.75rem;
}

/* ===== Loading Progress Bar ===== */
.loading-progress {
    width: 200px;
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.loading-bar {
    height: 100%;
    background: var(--begres-primary, #1e67b9);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* ===== Error State ===== */
.viewer-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    z-index: 10;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .viewer-wrapper {
        height: 400px;
    }
    
    .viewer-toolbar {
        padding: 10px;
        gap: 4px;
    }
    
    .toolbar-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .toolbar-divider {
        margin: 0 3px;
    }
    
    .viewer-info {
        flex-direction: column;
        gap: 4px;
        text-align: center;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .viewer-wrapper {
        height: 320px;
    }
}

/* ===== Fullscreen Mode ===== */
.viewer-container:fullscreen,
.viewer-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.viewer-container:fullscreen .viewer-wrapper,
.viewer-container:-webkit-full-screen .viewer-wrapper {
    flex: 1;
    height: auto;
    min-height: 0;
}

.viewer-container:fullscreen canvas,
.viewer-container:-webkit-full-screen canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    .toolbar-btn {
        width: 40px;
        height: 40px;
    }
}
