/* assets/css/universe.css */

:root {
    --neon-teal: var(--color-accent);
    --neon-gold: var(--color-warn);
    --neon-red: var(--color-danger);
    --glass-bg: rgba(10, 15, 20, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body.nexus-mode {
    margin: 0;
    overflow: hidden;
    /* Importante: Sin scroll en el universo */
    background-color: #000;
    font-family: 'Montserrat', sans-serif;
    /* Más futurista */
}

/* --- CANVAS 3D --- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Fondo */
    outline: none;
}

/* --- HUD LAYER --- */
#nexus-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* Sobre el 3D */
    pointer-events: none;
    /* Permite hacer clic en el 3D a través de los huecos vacíos */
}

/* Elementos interactivos del HUD reactivan el puntero */
#nexus-ui>* {
    pointer-events: auto;
}

/* --- NAVBAR FLOTANTE (Sobrescribe components.css) --- */
.nexus-nav {
    top: 15px !important;
    right: 15px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid var(--neon-teal) !important;
}

/* --- ESTILO GLASS PANEL --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    color: #fff;
}

/* Pantalla Bienvenida */
.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 2.5rem;
    text-align: center;
    min-width: 320px;
    border-top: 2px solid var(--neon-teal);
}

.centered h2 {
    color: var(--neon-teal);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.centered input {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #444;
    /* Borde más grueso */
    color: var(--neon-teal);
    text-align: center;
    margin-top: 1.5rem;
    font-size: 1.3rem;
    padding: 15px;
    width: 100%;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
}

.centered input:focus {
    border-color: var(--neon-teal);
    box-shadow: 0 0 15px rgba(28, 180, 149, 0.3);
}


.neon-btn {
    width: 100%;
    margin-top: 1.5rem;
    background: rgba(28, 180, 149, 0.1);
    /* Un poco de fondo por defecto */
    border: 2px solid var(--neon-teal);
    color: var(--neon-teal);
    box-shadow: 0 0 10px var(--neon-teal);
    transition: 0.3s;
    font-size: 1.1rem;
    padding: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    cursor: pointer;
}

.neon-btn:hover {
    background: var(--neon-teal);
    color: #000;
    box-shadow: 0 0 25px var(--neon-teal);
    transform: scale(1.02);
}

/* --- CHAT PANEL (HUD) --- */
.side-panel {
    position: absolute;
    top: 60px;
    /* Debajo del nav */
    right: 20px;
    width: 350px;
    height: calc(100% - 80px);
    /* Ajuste vertical */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-right: 2px solid var(--neon-gold);
}

.side-panel.hidden {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

.panel-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: var(--neon-gold);
    text-transform: uppercase;
}

.chat-feed-area {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mensajes en el HUD */
.hud-msg {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 2px solid #555;
}

.hud-msg.me {
    align-self: flex-end;
    border-left: none;
    border-right: 2px solid var(--neon-teal);
    background: rgba(28, 180, 149, 0.15);
}

.hud-msg img {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 5px;
    border: 1px solid var(--neon-teal);
}

.chat-controls {
    padding: 15px;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-controls input[type="text"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    font-size: 0.9rem;

    /* --- CORRECCIÓN AQUÍ --- */
    color: #ffffff;
    /* Texto blanco */
    padding: 8px 12px;
    /* Un poco de espacio interno para que no se pegue al borde */
    border-radius: 4px;
    /* Bordes redondeados sutiles */
    outline: none;
    /* Quitar borde azul feo al hacer clic */
}

.chat-controls input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-controls input[type="text"]:focus {
    border-color: var(--neon-teal);
    background: rgba(0, 0, 0, 0.7);
}


.icon-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--neon-teal);
}

.file-btn {
    color: var(--neon-gold);
}

/* --- TERMINAL LOG --- */
#terminal-log {
    position: absolute;
    bottom: 10px;
    left: 10px;
    max-width: 300px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    opacity: 0.7;
    pointer-events: none;
}

.log-line {
    margin-top: 2px;
    text-shadow: 0 0 2px #000;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .side-panel {
        width: 100%;
        height: 50%;
        /* Panel ocupa media pantalla abajo */
        top: auto;
        bottom: 0;
        right: 0;
        border-right: none;
        border-top: 2px solid var(--neon-gold);
        border-radius: 20px 20px 0 0;
    }

    .side-panel.hidden {
        transform: translateY(120%);
        /* Se oculta hacia abajo */
    }
}

/* universe.css */

/* --- BARRA DE SALAS (Room Switcher) --- */
.panel-header-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.room-switcher {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    overflow-x: auto;
    /* Scroll horizontal si hay muchos chats */
    scrollbar-width: none;
    /* Ocultar barra scroll Firefox */
    white-space: nowrap;
}

.room-switcher::-webkit-scrollbar {
    display: none;
}

/* Ocultar barra Chrome */

.room-badge {
    width: 40px;
    height: 40px;
    min-width: 40px;
    /* Evita que se aplasten */
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    color: #aaa;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

.room-badge:hover {
    border-color: var(--neon-gold);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.room-badge.active {
    background: rgba(28, 180, 149, 0.2);
    border-color: var(--neon-teal);
    color: var(--neon-teal);
    box-shadow: 0 0 10px rgba(28, 180, 149, 0.3);
}

/* Indicador de mensaje nuevo (punto rojo) */
.room-badge.has-news::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--neon-red);
    border-radius: 50%;
    border: 2px solid #000;
    box-shadow: 0 0 5px var(--neon-red);
    animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ajuste del título */
.panel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    font-size: 0.75rem;
    color: var(--neon-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.2);
}