/* ==========================================================================
   REMAKER 3D — INDUSTRIAL HUD & TELEMETRY DESIGN SYSTEM
   ========================================================================== */

:root {
    --bg-base: #0a0b0e;
    --bg-panel: rgba(16, 18, 24, 0.82);
    --bg-card: rgba(26, 30, 42, 0.7);
    --border-tech: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(56, 189, 248, 0.35);
    
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-mono: #cbd5e1;

    --accent-cyan: #38bdf8;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", "Courier New", monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(249, 115, 22, 0.04) 0%, transparent 40%),
        linear-gradient(var(--border-tech) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-tech) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header HUD */
.hud-header {
    border-bottom: 1px solid var(--border-tech);
    background: rgba(10, 11, 14, 0.85);
    backdrop-filter: blur(12px);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.hud-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid var(--border-accent);
    color: var(--accent-cyan);
    letter-spacing: 1px;
}

.hud-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-tech);
    border-radius: 6px;
    padding: 2px;
}

.mode-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: var(--accent-cyan);
    color: #000;
    font-weight: 700;
}

/* Layout Principal */
.hud-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    padding: 20px 24px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 960px) {
    .hud-main {
        grid-template-columns: 1fr;
    }
}

/* Panel Central de Voz / Chat */
.console-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-tech);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.panel-corner {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    user-select: none;
}
.corner-tl { top: 6px; left: 8px; }
.corner-tr { top: 6px; right: 8px; }

.console-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-tech);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-mono);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.status-dot.pulsing {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Visualizador de Voz Activa y Orbe 3D */
.voice-visualizer-container {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-tech);
    background: radial-gradient(circle at center, rgba(0, 255, 178, 0.03) 0%, rgba(0, 0, 0, 0.3) 100%);
    position: relative;
}

.orb-stage {
    position: relative;
    width: 100%;
    max-width: 560px;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
}

#orbCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.voice-circle-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(10, 15, 25, 0.82);
    border: 1.5px solid rgba(0, 255, 178, 0.5);
    box-shadow: 0 0 25px rgba(0, 255, 178, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.voice-circle-overlay:hover {
    border-color: #00ffb2;
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 0 35px rgba(0, 255, 178, 0.6);
}

.voice-circle-overlay.active {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.18);
    box-shadow: 0 0 45px rgba(0, 229, 255, 0.75);
    animation: orbPulse 1.8s infinite;
}

@keyframes orbPulse {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 25px rgba(0, 229, 255, 0.4); }
    50% { transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 0 50px rgba(0, 229, 255, 0.85); }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 25px rgba(0, 229, 255, 0.4); }
}

.mic-icon {
    font-size: 26px;
    user-select: none;
}

.voice-status-text {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.voice-meta-badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.hud-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* Transcripción e Historial de Chat */
.chat-transcript {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 480px;
}

.message-bubble {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.message-bubble.user {
    align-self: flex-end;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #e2e8f0;
}

.message-bubble.model {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-tech);
    color: #f1f5f9;
}

.message-author {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Badge de ejecución de herramienta */
.tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.4);
    color: var(--accent-orange);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    margin-top: 6px;
}

/* Formulario de Entrada de Texto */
.console-input-bar {
    padding: 16px;
    border-top: 1px solid var(--border-tech);
    display: flex;
    gap: 10px;
}

.console-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-tech);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.console-input:focus {
    border-color: var(--accent-cyan);
}

.send-btn {
    background: var(--accent-cyan);
    color: #000;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 13px;
    transition: opacity 0.2s;
}

.send-btn:hover {
    opacity: 0.9;
}

/* Panel Lateral de Telemetría y Casos */
.telemetry-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.telemetry-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-tech);
    border-radius: 12px;
    padding: 18px;
    backdrop-filter: blur(16px);
}

.card-title {
    font-size: 13px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-range-display {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin: 8px 0;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.metric-label {
    color: var(--text-muted);
}

.metric-value {
    font-family: var(--font-mono);
    color: var(--text-mono);
    font-weight: 600;
}

.no-payment-banner {
    background: rgba(249, 115, 22, 0.1);
    border: 1px dashed rgba(249, 115, 22, 0.4);
    color: #fed7aa;
    font-size: 12px;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    line-height: 1.4;
}

/* Botón Directo WhatsApp */
.wa-direct-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    margin-top: 14px;
    transition: transform 0.15s ease, filter 0.2s ease;
}

.wa-direct-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Botón de Onboarding Rápido (Modo Taller) */
.onboarding-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    display: none; /* Se activa en modo taller */
}

.onboarding-btn.visible {
    display: block;
}

/* ==========================================================================
   MODO ASISTENTE VIRTUAL A PANTALLA COMPLETA (INSPIRADO EN EL VÍDEO TIKTOK)
   ========================================================================== */
.btn-assistant-glow {
    background: linear-gradient(135deg, rgba(0, 255, 178, 0.15), rgba(56, 189, 248, 0.15)) !important;
    border: 1px solid #00ffb2 !important;
    color: #00ffb2 !important;
    font-weight: 700;
    transition: all 0.25s ease;
}

.btn-assistant-glow:hover {
    box-shadow: 0 0 15px rgba(0, 255, 178, 0.4);
    transform: translateY(-1px);
}

body.fullscreen-assistant-mode {
    overflow: hidden;
}

body.fullscreen-assistant-mode .hud-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: transparent;
    border-bottom: none;
    opacity: 0.25;
    transition: opacity 0.3s ease, background 0.3s ease;
}

body.fullscreen-assistant-mode .hud-header:hover {
    opacity: 1;
    background: rgba(10, 11, 14, 0.95);
    border-bottom: 1px solid var(--border-tech);
}

body.fullscreen-assistant-mode .hud-main {
    grid-template-columns: 1fr;
    max-width: 100%;
    height: 100vh;
    padding: 0;
    margin: 0;
}

body.fullscreen-assistant-mode .telemetry-panel {
    display: none;
}

body.fullscreen-assistant-mode .console-panel {
    border: none;
    border-radius: 0;
    background: radial-gradient(circle at center, rgba(16, 26, 40, 0.92) 0%, rgba(5, 7, 10, 0.99) 100%);
    justify-content: center;
    align-items: center;
    height: 100vh;
}

body.fullscreen-assistant-mode .voice-visualizer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: none;
    background: transparent;
    width: 100%;
    padding: 0;
    margin-top: -40px;
}

body.fullscreen-assistant-mode .orb-stage {
    max-width: 880px;
    height: 560px;
}

body.fullscreen-assistant-mode .voice-circle-overlay {
    width: 76px;
    height: 76px;
}

body.fullscreen-assistant-mode .voice-status-text {
    font-size: 15px;
    margin-top: 14px;
    letter-spacing: 1.5px;
}

body.fullscreen-assistant-mode .chat-transcript {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 780px;
    max-height: 180px;
    background: rgba(10, 15, 25, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    z-index: 50;
}

body.fullscreen-assistant-mode .console-input-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 780px;
    background: rgba(10, 15, 25, 0.9);
    border-radius: 8px;
    z-index: 50;
}

/* ==========================================================================
   OPTIMIZACIÓN MÓVIL PROFESIONAL (RESPONSIVE & TOUCH)
   ========================================================================== */
@media (max-width: 768px) {
    .hud-main {
        padding: 8px 10px;
        gap: 12px;
        grid-template-columns: 1fr;
    }

    .hud-header {
        padding: 10px 14px;
        flex-direction: column;
        gap: 8px;
    }

    .hud-brand {
        justify-content: center;
        text-align: center;
    }

    .brand-badge {
        font-size: 9px;
    }

    .hud-title {
        font-size: 13px;
    }

    .console-panel {
        border-radius: 8px;
    }

    .console-header {
        padding: 10px 12px;
        font-size: 11px;
    }

    .voice-visualizer-container {
        padding: 10px;
    }

    .orb-stage {
        max-width: 100%;
        height: 190px;
    }

    .voice-circle-overlay {
        width: 58px;
        height: 58px;
    }

    .mic-icon {
        font-size: 22px;
    }

    .voice-status-text {
        font-size: 11px;
        margin-top: 8px;
        letter-spacing: 0.3px;
    }

    .voice-meta-badges {
        gap: 4px;
        margin-top: 6px;
    }

    .hud-pill {
        font-size: 9px;
        padding: 2px 6px;
    }

    .chat-transcript {
        padding: 12px;
        gap: 10px;
        max-height: 280px;
        font-size: 13px;
    }

    .message-bubble {
        padding: 10px 12px;
        font-size: 13px;
        line-height: 1.45;
    }

    .console-input-bar {
        padding: 8px;
        gap: 6px;
    }

    /* Evitar auto-zoom molesto en iOS Safari */
    .console-input {
        font-size: 16px !important;
        padding: 10px 12px;
    }

    .send-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .telemetry-card {
        padding: 12px 14px;
    }

    .price-range-display {
        font-size: 24px;
        margin: 6px 0;
    }

    .metric-row {
        font-size: 11px;
    }

    .no-payment-banner {
        font-size: 11px;
        padding: 8px;
    }

    .wa-direct-btn {
        padding: 10px;
        font-size: 13px;
    }
}
