/* Analysis Manager Styles */

:root {
    --analysis-bg: rgba(30, 41, 59, 0.4);
    --analysis-border: rgba(255, 255, 255, 0.1);
    --analysis-accent: #6366f1;
    --analysis-text: #f8fafc;
    --analysis-text-dim: #94a3b8;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--analysis-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--analysis-border);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-label {
    color: var(--analysis-text-dim);
    font-weight: 500;
}

.stat-value {
    color: var(--analysis-text);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* Measurement Tools */
.measurement-tools {
    padding: 10px 0;
}

.tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: var(--analysis-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--analysis-border);
    border-radius: 12px;
    color: var(--analysis-text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 500;
}

.tool-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--analysis-accent);
    transform: translateY(-2px);
}

.tool-btn.active {
    background: var(--analysis-accent);
    color: white;
    border-color: var(--analysis-accent);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.measurement-results {
    min-height: 80px;
    padding: 15px;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--analysis-border);
    border-radius: 14px;
    margin-bottom: 20px;
}

.measurement-instructions {
    color: var(--analysis-text-dim);
    font-style: italic;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

.measurement-result {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--analysis-border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.result-type {
    font-weight: 700;
    color: var(--analysis-accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--analysis-text);
    font-family: 'Outfit', sans-serif;
}

/* Material Inspector */
.material-selection {
    margin-bottom: 20px;
}

.material-selection label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--analysis-text-dim);
    font-weight: 600;
}

.material-selection select {
    width: 100%;
    background: var(--analysis-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--analysis-border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--analysis-text);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.material-selection select:focus {
    border-color: var(--analysis-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.material-properties {
    background: var(--analysis-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--analysis-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.property-item:last-child {
    border-bottom: none;
}

.property-label {
    color: var(--analysis-text-dim);
    font-size: 0.85rem;
}

.property-value {
    color: var(--analysis-text);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Presentation Presets */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.preset-btn, .lighting-btn {
    padding: 10px 6px;
    background: var(--analysis-bg);
    border: 1px solid var(--analysis-border);
    border-radius: 10px;
    color: var(--analysis-text);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.preset-btn:hover, .lighting-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--analysis-accent);
}

.preset-btn.active, .lighting-btn.active {
    background: var(--analysis-accent);
    color: white;
    border-color: var(--analysis-accent);
}

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

.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--analysis-text-dim);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--analysis-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

/* Presentation HUD */
.presentation-hud {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    z-index: 2000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: hudSlideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes hudSlideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.hud-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hud-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.hud-btn:hover {
    background: var(--analysis-accent);
    transform: scale(1.1);
}

.hud-counter {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.hud-exit {
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 100px;
    color: #fca5a5;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hud-exit:hover {
    background: #ef4444;
    color: white;
}

/* Fade Overlay */
.fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.fade-overlay.pitch-black {
    opacity: 1;
    pointer-events: all;
}

.fade-overlay.hidden {
    display: none;
}