/* Car Concept 3D Viewer - Styles */

:root {
    --bg: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    --panel: rgba(255, 255, 255, 0.95);
    --text: #1e293b;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.1);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

.car-concept-container {
    width: 100vw;
    height: 100vh;
    background: var(--bg-gradient);
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
    color: var(--text);
    position: relative;
    overflow: hidden;
}

/* Header */
.car-header {
    position: fixed;
    top: 0;
    left: 170px;
    right: 0;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0.95) 0%, transparent 100%);
}

.car-header__title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.car-header__subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.car-header__status {
    display: flex;
    gap: 10px;
}

.status-badge {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.status-badge--muted {
    color: var(--text-muted);
}

.status-badge--active {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

/* 3D Viewer */
.viewer-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#threeCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f0f4f8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 50;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* Webcam Preview */
.webcam-preview {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 240px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 200;
}

.webcam-preview__stack {
    position: relative;
    background: #000;
    display: none;
}

.webcam-preview__stack.active {
    display: block;
}

.webcam-preview video {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1);
}

.webcam-preview #overlay2d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.webcam-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease;
}

.webcam-btn:hover {
    background: var(--accent-hover);
}

.webcam-btn.active {
    background: #dc2626;
}

.webcam-btn.active:hover {
    background: #b91c1c;
}

.webcam-error {
    padding: 10px 12px;
    background: rgba(220, 38, 38, 0.1);
    color: #f87171;
    font-size: 12px;
    border-top: 1px solid rgba(220, 38, 38, 0.2);
}

/* Instructions */
.instructions {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.instructions__item {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.instructions__icon {
    font-size: 16px;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .car-header {
        left: 160px;
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .car-header__title {
        font-size: 18px;
    }

    .car-header__status {
        flex-wrap: wrap;
    }

    .webcam-preview {
        width: 180px;
        bottom: 10px;
        left: 10px;
    }

    .instructions {
        bottom: 10px;
        right: 10px;
    }

    .instructions__item {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .car-header__subtitle {
        display: none;
    }

    .webcam-preview {
        width: 140px;
    }

    .webcam-btn {
        padding: 10px 12px;
        font-size: 11px;
    }

    .webcam-btn svg {
        display: none;
    }

    .instructions {
        display: none;
    }
}
