/* ==========================================================================
   ORQUESTRA - MÓDULO DE MEDIÇÃO BIM (IFC) 3D
   ========================================================================== */

.bim-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    background: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: 'Outfit', sans-serif;
    color: #f8fafc;
}

/* Barra Superior de Ferramentas */
.bim-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
    gap: 15px;
    flex-wrap: wrap;
}

.bim-toolbar-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bim-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bim-title i {
    color: #3b82f6;
    font-size: 1.3rem;
}

.bim-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.7);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bim-select-group label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bim-select {
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    min-width: 160px;
}

.bim-select option {
    background: #1e293b;
    color: #f8fafc;
}

/* Legenda de Cores */
.bim-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.6);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bim-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #cbd5e1;
    font-weight: 500;
}

.bim-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

.bim-dot.nao_iniciado { background-color: #9ca3af; color: rgba(156, 163, 175, 0.5); }
.bim-dot.em_andamento { background-color: #fbbf24; color: rgba(251, 191, 36, 0.5); }
.bim-dot.executado { background-color: #22c55e; color: rgba(34, 197, 94, 0.5); }
.bim-dot.com_pendencia { background-color: #ef4444; color: rgba(239, 68, 68, 0.5); }

/* ÁREA PRINCIPAL DO VIEWER 3D */
.bim-workspace {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

#bimViewportCanvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

/* Indicador de Carregamento 3D */
.bim-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    gap: 15px;
    transition: opacity 0.3s ease;
}

.bim-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: bimSpin 1s linear infinite;
}

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

.bim-loader-text {
    font-size: 0.95rem;
    color: #e2e8f0;
    font-weight: 600;
}

/* PAINEL LATERAL DE DETALHES E MEDIÇÃO */
.bim-side-panel {
    width: 340px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
}

.bim-side-panel.active {
    transform: translateX(0);
}

.bim-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bim-panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bim-panel-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.bim-panel-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.bim-panel-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bim-info-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
}

.bim-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.bim-info-row:last-child {
    border-bottom: none;
}

.bim-info-label {
    color: #94a3b8;
    font-weight: 500;
}

.bim-info-value {
    color: #f8fafc;
    font-weight: 600;
}

.bim-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bim-field-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
}

.bim-input, .bim-textarea, .bim-status-select {
    width: 100%;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    color: #f8fafc;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.bim-input:focus, .bim-textarea:focus, .bim-status-select:focus {
    border-color: #3b82f6;
}

.bim-textarea {
    resize: vertical;
    min-height: 70px;
}

.bim-btn-save {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: all 0.2s;
    margin-top: 10px;
}

.bim-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.bim-btn-save:active {
    transform: scale(0.98);
}

/* Empty State do Viewer */
.bim-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #94a3b8;
    z-index: 10;
}

.bim-empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    color: #475569;
}
