@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&display=swap');

/* ===================================
   METAVERSO ARQUITECTÓNICO - ESTILOS
   Universidad de Piura 2025
   =================================== */

/* Reset y Variables */
:root {
    --font-main: 'Chakra Petch', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --primary-color: #000000;
    --secondary-color: #111111;
    --success-color: #000000;
    --warning-color: #000000;
    --danger-color: #000000;
    --bg-dark: #000000;
    --bg-medium: #111111;
    --bg-light: #1a1a1a;
    --text-dark: #f5f5f5;
    --text-light: #ffffff;
    --border-color: #000000;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    overflow: hidden;
    background: #000000;
    color: var(--text-light);
}

button,
input,
textarea,
select,
a {
    font-family: inherit;
}

/* ===================================
   LANDING DE ENTRADA
   =================================== */

.landing-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.landing-screen.active {
    opacity: 1;
    visibility: visible;
}

.landing-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.landing-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.06), transparent 50%),
        linear-gradient(135deg, #060606 0%, #000000 60%, #101010 100%);
}

.landing-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    text-align: center;
    padding: 2.5rem 2rem;
    border: 1px solid #222222;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(8px);
}

.landing-content h1 {
    font-size: clamp(2rem, 4vw, 3.1rem);
    letter-spacing: 0.06em;
    margin-bottom: 0.95rem;
}

.landing-content p {
    color: #d0d0d0;
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 1.9rem;
}

.landing-enter-btn {
    display: inline-block;
    padding: 0.85rem 1.8rem;
    border: 1px solid #ffffff;
    background: #000000;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.landing-enter-btn:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-1px);
}

/* ===================================
   PANTALLA DE CARGA PROFESIONAL 3D
   =================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
}

.loading-screen.active {
    opacity: 1;
    visibility: visible;
}

/* Video de Fondo */
.loading-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0;
    z-index: 1;
}

/* Overlay Gradiente */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 2;
}

/* Canvas de Partículas */
.particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* Contenido Principal */
.loading-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--text-light);
    max-width: 700px;
    padding: 2rem;
    animation: contentFadeIn 1s ease-out;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icono Premium de Carga */
.loading-logo {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
}

.premium-icon {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.outer-ring {
    width: 130px;
    height: 130px;
    border-top-color: #d4af37;
    border-right-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.25), inset 0 0 25px rgba(212, 175, 55, 0.05);
    animation: spinRing 2.5s linear infinite;
}

.middle-ring {
    width: 96px;
    height: 96px;
    border-top-color: rgba(212, 175, 55, 0.65);
    border-left-color: rgba(255, 255, 255, 0.25);
    animation: spinRing 1.8s linear infinite reverse;
}

.inner-ring {
    width: 62px;
    height: 62px;
    border-top-color: rgba(255, 255, 255, 0.9);
    border-right-color: rgba(255, 255, 255, 0.15);
    animation: spinRing 1.2s linear infinite;
}

.premium-core {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.core-symbol {
    font-size: 1.8rem;
    color: #d4af37;
    animation: corePulse 2.5s ease-in-out infinite;
}

@keyframes spinRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes corePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.9)); }
    50% { transform: scale(1.2); filter: drop-shadow(0 0 20px rgba(212, 175, 55, 1)); }
}

/* Título Animado */
.loading-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 
        0 0 30px rgba(212, 175, 55, 0.9),
        0 0 60px rgba(212, 175, 55, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.title-word {
    display: inline-block;
    animation: titleFloat 3s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Subtítulo */
.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 300;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.subtitle-icon {
    font-size: 1.3rem;
    animation: pulse 2s ease-in-out infinite;
}

.subtitle-separator {
    opacity: 0.6;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Barra de Progreso Moderna */
.progress-container {
    width: 100%;
    margin-bottom: 2rem;
}

.progress-track {
    position: relative;
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: visible;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(212, 175, 55, 0.15);
}

.progress-bar {
    position: relative;
    height: 100%;
    background: linear-gradient(
        90deg,
        #d4af37 0%,
        #c9992a 30%,
        #b8860b 60%,
        #e8c840 100%
    );
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    box-shadow: 
        0 0 20px rgba(212, 175, 55, 0.8),
        0 0 40px rgba(212, 175, 55, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.progress-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.progress-percentage {
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8), 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* Mensaje de Carga */
.loading-message {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.message-icon {
    font-size: 1.3rem;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Tips Educativos con Glassmorphism */
.education-tips {
    background: rgba(212, 175, 55, 0.05);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(212, 175, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.education-tips:hover {
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(212, 175, 55, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tip-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.tip-text {
    font-size: 1rem;
    line-height: 1.6;
    text-align: left;
    margin: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Indicadores de Carga */
.loading-indicators {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.indicator.active {
    opacity: 1;
    transform: scale(1.05);
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.indicator.active .indicator-dot {
    background: #d4af37;
    box-shadow: 0 0 15px #d4af37, 0 0 25px rgba(212, 175, 55, 0.5);
    animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Footer */
.loading-footer {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
    .loading-title {
        font-size: 2.5rem;
    }
    
    .loading-content {
        padding: 1rem;
    }
    
    .loading-indicators {
        gap: 1rem;
    }
    
    .premium-icon {
        width: 100px;
        height: 100px;
    }

    .outer-ring { width: 100px; height: 100px; }
    .middle-ring { width: 74px; height: 74px; }
    .inner-ring { width: 48px; height: 48px; }
}

/* ===================================
   INTERFAZ PRINCIPAL
   =================================== */

.main-interface {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease;
}

.main-interface.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Header */
.main-header {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    z-index: 100;
}

.logo h2 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-icon,
.section-title-icon,
.btn-icon,
.tool-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.header-icon svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid transparent;
    background: var(--bg-medium);
    color: var(--text-light);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    border-color: var(--text-light);
}

.tools {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-medium);
    color: var(--text-light);
    border: 1px solid #000000;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.btn-icon svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: currentColor;
}

.tool-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

/* ===================================
   WORKSPACE
   =================================== */

.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Paneles Laterales */
.left-panel,
.right-panel {
    background: #0b0b0b;
    border-right: 2px solid var(--border-color);
    overflow-y: auto;
    flex: 0 0 300px;
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 30;
    width: 300px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.left-panel {
    left: 0;
}

.right-panel {
    right: 0;
    border-right: none;
    border-left: 2px solid var(--border-color);
}

.left-panel .panel-section,
.right-panel > * {
    transition: opacity 0.15s ease;
}

.workspace.left-panel-hidden .left-panel {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.workspace.left-panel-hidden .left-panel .panel-section {
    opacity: 0;
    pointer-events: none;
}

.workspace.right-panel-hidden .right-panel {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.workspace.right-panel-hidden .right-panel > * {
    opacity: 0;
    pointer-events: none;
}

.panel-toggle-btn.active {
    background: #000000;
    border-color: #ffffff;
}

.panel-section {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.panel-section h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.section-title-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-option,
.template-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem;
    background: #111111;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.tool-option-icon svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: currentColor;
}

.tool-option:hover,
.template-btn:hover {
    background: #000000;
    color: var(--text-light);
    border-color: #000000;
    transform: translateX(4px);
}

.tool-option.active {
    background: #000000;
    color: var(--text-light);
    border-color: #000000;
}

.properties-panel {
    font-size: 0.9rem;
}

.properties-panel .hint {
    color: #bdbdbd;
    font-style: italic;
}

.property-item {
    margin-bottom: 1rem;
}

.property-item label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.property-item input,
.property-item select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background: #111111;
    color: var(--text-light);
}

.model-templates {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.model-edit-panel .property-item {
    margin-bottom: 0.75rem;
}

.model-edit-panel input[type="range"] {
    accent-color: #5671ff;
    cursor: pointer;
}

.model-edit-panel input[type="color"] {
    width: 100%;
    height: 2.2rem;
    padding: 0.2rem;
    border: 1px solid #2b2b2b;
    border-radius: 6px;
    background: #090909;
}

.glb-interaction-group {
    margin-bottom: 0.75rem;
}

.glb-transform-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}

.glb-mode-btn.active {
    border-color: #5f7aff;
    background: #141a30;
}

.glb-transform-nudge {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

/* ===================================
   ÁREA DE VISUALIZACIÓN
   =================================== */

.main-view {
    flex: 1;
    width: 100%;
    position: relative;
    background: #000000;
    overflow: hidden;
}

.view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.view-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.view-container.active {
    opacity: 1;
    visibility: visible;
}

#canvas3D {
    width: 100%;
    height: 100%;
    display: block;
    background: #000000;
}

.canvas-2d-container {
    width: 100%;
    height: calc(100% - 98px);
    background: #000000;
    cursor: crosshair;
}

.view2d-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.7rem;
    border-bottom: 1px solid #1f1f1f;
    background: rgba(0, 0, 0, 0.85);
}

.view2d-mode-btn {
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    background: #0f0f0f;
    color: #f0f0f0;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.45rem 0.5rem;
    cursor: pointer;
}

.view2d-mode-btn.active {
    border-color: #6f86ff;
    background: #162042;
}

#topPlanCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #dfe4ea;
}

.is-hidden {
    display: none !important;
}

#canvas2D {
    display: block;
}

.view-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.view-info p {
    margin: 0.25rem 0;
}

/* ===================================
   ASISTENTE DE DISEÑO
   =================================== */

.assistant-container {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.assistant-container h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.assistant-messages {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.assistant-message {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.assistant-message.welcome {
    background: #111111;
    border: 1px solid #000000;
    color: white;
}

.assistant-message.info {
    background: #151515;
    border-left: 4px solid #000000;
}

.assistant-message.success {
    background: #151515;
    border-left: 4px solid #000000;
}

.assistant-message.warning {
    background: #151515;
    border-left: 4px solid #000000;
}

.assistant-message.error {
    background: #151515;
    border-left: 4px solid #000000;
}

.assistant-message ul {
    margin: 0.5rem 0 0 1.5rem;
}

.assistant-message strong {
    display: block;
    margin-bottom: 0.5rem;
}

.floating-assistant-widget {
    position: fixed;
    left: 1rem;
    bottom: 5.1rem;
    z-index: 85;
    width: min(370px, calc(100vw - 2rem));
    display: flex;
    align-items: flex-end;
    gap: 0.7rem;
    pointer-events: none;
}

.floating-assistant-avatar {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid #3a3a3a;
    background: radial-gradient(circle at 35% 28%, #202020 0%, #090909 75%);
    padding: 0.45rem;
    box-shadow: 0 0 0 3px rgba(86, 113, 255, 0.18), 0 12px 24px rgba(0, 0, 0, 0.5);
    animation: robotPulse 2.8s ease-in-out infinite;
}

.assistant-floating-messages {
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0;
    pointer-events: auto;
}

.assistant-floating-messages.hidden {
    display: none;
}

.assistant-floating-messages .assistant-message {
    margin: 0;
    font-size: 0.8rem;
    max-width: min(300px, calc(100vw - 5.5rem));
    padding: 0.58rem 0.68rem;
    border-radius: 14px 14px 14px 3px;
    border: 1px solid #313131;
    background: rgba(12, 12, 12, 0.94);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
    line-height: 1.5;
}

.assistant-floating-messages .assistant-message strong {
    color: #9cb0ff;
    margin-bottom: 0.28rem;
}

.assistant-floating-messages .assistant-message p {
    margin: 0;
}

.assistant-floating-messages .assistant-message.typing::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 0.28rem;
    border-radius: 50%;
    background: #7f96ff;
    animation: typingBlink 0.9s infinite;
}

@keyframes robotPulse {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 0 0 3px rgba(86, 113, 255, 0.18), 0 12px 24px rgba(0, 0, 0, 0.5);
    }
    50% {
        transform: translateY(-2px);
        box-shadow: 0 0 0 5px rgba(86, 113, 255, 0.13), 0 14px 28px rgba(0, 0, 0, 0.52);
    }
}

@keyframes typingBlink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.facade-ai-panel {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(180deg, #101010 0%, #0a0a0a 100%);
}

.facade-ai-panel h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
}

.facade-ai-help {
    color: #c6c6c6;
    font-size: 0.86rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.facade-ai-prompt {
    width: 100%;
    resize: vertical;
    min-height: 82px;
    border: 1px solid #2f2f2f;
    border-radius: 8px;
    background: #060606;
    color: #f2f2f2;
    padding: 0.65rem 0.72rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.facade-ai-prompt:focus,
.facade-ai-select:focus {
    outline: none;
    border-color: #6f86ff;
    box-shadow: 0 0 0 2px rgba(111, 134, 255, 0.18);
}

.facade-ai-controls,
.facade-ai-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-top: 0.7rem;
}

.facade-ai-select {
    width: 100%;
    border: 1px solid #2f2f2f;
    border-radius: 8px;
    background: #080808;
    color: #f2f2f2;
    padding: 0.58rem 0.62rem;
    font-size: 0.86rem;
}

.facade-ai-btn {
    border: 1px solid #2c2c2c;
    background: #111111;
    color: #f5f5f5;
    border-radius: 8px;
    padding: 0.58rem 0.68rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.facade-ai-btn:hover {
    border-color: #4b4b4b;
    background: #161616;
    transform: translateY(-1px);
}

.facade-ai-btn-primary {
    border-color: #3a51d1;
    background: linear-gradient(90deg, #2f46bf 0%, #4865ff 100%);
}

.facade-result {
    margin-top: 0.85rem;
    border: 1px solid #252525;
    border-radius: 10px;
    background: #080808;
    padding: 0.72rem;
    font-size: 0.84rem;
}

.facade-result-hint {
    color: #b9b9b9;
}

.facade-result-title {
    color: #f8f8f8;
    font-size: 0.92rem;
    margin-bottom: 0.45rem;
}

.facade-result-list {
    margin: 0;
    padding-left: 1rem;
    color: #d8d8d8;
    line-height: 1.55;
}

.facade-variation-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.45rem;
}

.facade-variation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #0e0e0e;
    padding: 0.45rem 0.55rem;
}

.facade-variation-item span {
    color: #ececec;
    font-size: 0.82rem;
}

/* ===================================
   MÉTRICAS
   =================================== */

.metrics-panel {
    padding: 1.5rem;
}

.metrics-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #111111;
    border: 1px solid #000000;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-weight: 500;
}

.metric-value {
    color: #ffffff;
    font-weight: 700;
}

/* ===================================
   ELEMENTOS SVG (Planos 2D)
   =================================== */

.wall-line {
    stroke: #1e293b;
    stroke-width: 2;
    fill: none;
    cursor: pointer;
    transition: stroke 0.2s ease;
}

.wall-line:hover {
    stroke: var(--primary-color);
    stroke-width: 3;
}

.wall-line.selected {
    stroke: var(--success-color);
    stroke-width: 3;
}

.room-polygon {
    fill: rgba(37, 99, 235, 0.1);
    stroke: var(--primary-color);
    stroke-width: 1.5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.room-polygon:hover {
    fill: rgba(37, 99, 235, 0.2);
    stroke-width: 2;
}

.room-polygon.selected {
    fill: rgba(16, 185, 129, 0.2);
    stroke: var(--success-color);
    stroke-width: 2;
}

.dimension-line {
    stroke: #64748b;
    stroke-width: 0.5;
    stroke-dasharray: 2, 2;
}

.dimension-text {
    fill: #64748b;
    font-size: 3px;
    font-family: Arial, sans-serif;
}

/* ===================================
   SCROLLBAR PERSONALIZADO
   =================================== */

.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar,
.assistant-messages::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track,
.assistant-messages::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb,
.assistant-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover,
.assistant-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 1200px) {
    .left-panel,
    .right-panel {
        flex-basis: 250px;
        width: 250px;
    }
}

@media (max-width: 768px) {
    .left-panel,
    .right-panel {
        flex-basis: 85%;
        width: 85%;
        max-width: 320px;
    }

    .floating-assistant-widget {
        left: 0.7rem;
        width: calc(100vw - 1.4rem);
        bottom: 4.8rem;
    }

    .floating-assistant-avatar {
        width: 46px;
        height: 46px;
    }
}
