/* ==============================================================================
   CESIA CORE OS - ESTILOS NEURONALES (3 NIVELES & MODO NEURONA AUTÓNOMO)
   ============================================================================== */

:root {
    --cesia-purple: #a855f7;
    --cesia-pink: #ec4899;
    --cesia-cyan: #06b6d4;
    --cesia-emerald: #10b981;
    --cesia-dark: #050711;
    --cesia-space: radial-gradient(circle at 50% 20%, #150d2a 0%, #050711 100%);
    --cesia-card: rgba(15, 17, 35, 0.88);
    --cesia-border: rgba(168, 85, 247, 0.28);
}

* {
    box-sizing: border-box;
}

body.cesia-body {
    background: #050711 !important;
    background-image: var(--cesia-space) !important;
    background-attachment: fixed !important;
    color: #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Wrapper principal Cesia */
.cesia-standalone-wrapper {
    max-width: 1540px;
    margin: 0 auto;
    padding: 16px 14px;
}

/* Barra superior Cesia */
.cesia-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: rgba(15, 17, 35, 0.85);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.cesia-top-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.cesia-top-brand h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 2.5px;
    background: linear-gradient(135deg, #c084fc 0%, #f472b6 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.cesia-badge-plan {
    font-size: 9px;
    font-family: monospace;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cesia-badge-free {
    background: rgba(100, 116, 139, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
}

.cesia-badge-premium {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.4);
    color: #f472b6;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

/* Interruptor Universal para regresar al Panel Visual */
.cesia-switch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cesia-switch-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
    color: #e9d5ff;
    transform: translateY(-1px);
}

/* Contenedor central Cesia */
.cesia-container {
    background: radial-gradient(circle at 50% 25%, #150d2a 0%, #050711 100%);
    border-radius: 20px;
    padding: 22px;
    color: #f1f5f9;
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.12), inset 0 0 25px rgba(236, 72, 153, 0.05);
    position: relative;
    border: 1px solid rgba(168, 85, 247, 0.25);
    width: 100%;
}

/* Header de la consola */
.cesia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    padding-bottom: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.cesia-title {
    font-size: 20px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 2px;
}

/* Barra de Contexto Dinámico (Ámbito: Index vs Admin-Panel vs Panelia) */
.cesia-context-bar {
    background: rgba(15, 17, 35, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 14px;
    padding: 10px 16px;
    margin-bottom: 16px;
}

/* Viewport del Cerebro Neuronal Canvas */
.brain-viewport {
    position: relative;
    width: 100%;
    height: 380px;
    background: radial-gradient(circle at center, rgba(30, 20, 50, 0.4) 0%, rgba(5, 7, 17, 0.95) 100%);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    overflow: hidden;
}

.brain-viewport canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.brain-overlay-top {
    position: absolute;
    top: 14px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.brain-overlay-bottom {
    position: absolute;
    bottom: 12px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

/* Card de Control por Voz y Comandos */
.voice-command-card {
    background: rgba(15, 17, 35, 0.9);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    padding: 18px;
    margin-top: 16px;
}

.mic-action-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(236, 72, 153, 0.5);
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.35);
}

.mic-action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.mic-action-btn.listening {
    animation: pulseMic 1.2s infinite ease-in-out;
    background: #ec4899;
}

@keyframes pulseMic {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.6); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(236, 72, 153, 0); }
}

/* HUD Lateral Cards */
.hud-card {
    background: rgba(15, 17, 35, 0.9);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    padding: 16px;
}

.hud-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #c084fc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
    padding-bottom: 6px;
}

/* Feed Terminal Sináptico */
.feed-terminal {
    background: rgba(5, 7, 17, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    height: 220px;
    overflow-y: auto;
    color: #94a3b8;
}

.feed-item {
    margin-bottom: 8px;
    line-height: 1.5;
}

.feed-time {
    color: #64748b;
    margin-right: 6px;
}

.feed-actor {
    color: #f472b6;
    font-weight: bold;
    margin-right: 6px;
}

/* Chips de Wake Words y Atajos */
.wake-chip {
    background: rgba(20, 25, 45, 0.8);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #cbd5e1;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wake-chip:hover {
    background: rgba(168, 85, 247, 0.25);
    color: white;
    border-color: #c084fc;
}
