@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --brillo: #00f0ff;
    --brillo-texto: #00bcd4;
    --texto: #ffffff;
    --suave: rgba(255, 255, 255, 0.75);
    --bg-url: url('https://images.unsplash.com/photo-1518709268805-4e9042af9f23?auto=format&fit=crop&w=2000&q=85');
}

body.theme-pink { --brillo: #ff4d79; --brillo-texto: #ff6b93; }
body.theme-green { --brillo: #10b981; --brillo-texto: #34d399; }
body.theme-red { --brillo: #f43f5e; --brillo-texto: #fb7185; }
body.theme-purple { --brillo: #a855f7; --brillo-texto: #c084fc; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #070b14;
    color: var(--texto);
    padding: 24px;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

#bg-scene {
    position: fixed !important;
    inset: 0 !important;
    z-index: -999 !important;
    background-image: var(--bg-url) !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
}

#bg-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: -998 !important;
    background: rgba(5, 10, 22, 0.45) !important;
    pointer-events: none !important;
}

/* =========================================================================
   LIQUID GLASS DE ACOMPAÑAMIENTO (Nítido, elegante y ligero)
   ========================================================================= */
.liquid-glass {
    position: relative;
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1.5px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    color: var(--texto);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.liquid-glass:hover {
    border-color: rgba(255, 255, 255, 0.28);
}

/* El toque especial: Pastilla de cristal líquido flotante para elementos activos */
.liquid-pill-active {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05)) !important;
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.acento-txt {
    color: var(--brillo-texto) !important;
}

/* Contenedor Login */
.auth-container {
    position: relative;
    background: rgba(10, 15, 28, 0.82) !important;
    backdrop-filter: blur(25px);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 36px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    width: 850px;
    max-width: 92%;
    min-height: 520px;
    display: flex;
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sign-in-container { left: 0; }
.sign-up-container { left: 0; opacity: 0; z-index: 1; }

.auth-container.right-panel-active .sign-in-container {
    transform: translateX(100%);
    opacity: 0;
    z-index: 0;
}

.auth-container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.auth-container.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: linear-gradient(135deg, var(--brillo) 0%, #0072ff 100%);
    color: #ffffff;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
    display: flex;
}

.auth-container.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    z-index: 2;
}

.overlay-left { transform: translateX(-20%); }
.auth-container.right-panel-active .overlay-left { transform: translateX(0); }
.overlay-right { right: 0; transform: translateX(0); }
.auth-container.right-panel-active .overlay-right { transform: translateX(20%); }

/* Inputs y Botones */
.liquid-input {
    background: rgba(10, 15, 28, 0.5) !important;
    backdrop-filter: blur(4px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    color: var(--texto) !important;
    border-radius: 50px;
    padding: 11px 18px;
    outline: none;
    width: 100%;
    font-size: 0.88rem;
}
.liquid-input::placeholder { color: var(--suave); }
.liquid-input:focus { border-color: var(--brillo); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 10px var(--brillo); }

.aro, .calc-btn, .toque {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    color: var(--texto);
    transition: all 0.2s ease;
}
.aro:hover, .calc-btn:hover, .toque:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--brillo); }

.aro { width: 42px; height: 42px; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.calc-btn { height: 42px; border-radius: 14px; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; }
.toque { width: 100%; padding: 12px 20px; border-radius: 50px; font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; }
.toque i { font-size: 1.3rem; margin-right: 14px; color: var(--brillo-texto); }

.toque.activo {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05)) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: var(--brillo-texto) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.btn-gradiente {
    background: linear-gradient(135deg, var(--brillo) 0%, #0072ff 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 20px rgba(0, 114, 255, 0.3);
    color: #ffffff !important;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-gradiente:hover { filter: brightness(1.1); transform: translateY(-1px); }

.costado {
    width: 270px;
    height: calc(100vh - 48px);
    position: sticky;
    top: 24px;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
    flex-shrink: 0;
}

.calc-box {
    background: rgba(10, 15, 28, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 14px;
}

.item-cristal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(10, 15, 28, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--texto);
    font-size: 0.85rem;
}

.chat-mensajes { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: 400px; }
.msg-item { display: flex; gap: 12px; max-width: 82%; align-items: flex-end; }
.msg-propio { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brillo); flex-shrink: 0; }

.msg-burbuja {
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--texto) !important;
}
.msg-propio .msg-burbuja {
    background: linear-gradient(135deg, #0072ff 0%, #00c6ff 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.tablero-gato { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 260px; margin: 16px auto; }
.celda-gato {
    width: 100%; height: 75px; border-radius: 16px;
    background: rgba(10, 15, 28, 0.4); border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; cursor: pointer; color: var(--brillo-texto);
    transition: all 0.2s ease;
}
.celda-gato:hover { border-color: var(--brillo); background: rgba(255, 255, 255, 0.05); }

#toast-container { position: fixed; top: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; }
.toast {
    padding: 14px 22px; border-radius: 18px;
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2); color: #ffffff; font-size: 0.9rem;
    display: flex; align-items: center; gap: 12px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }

/* Responsividad barra inferior móvil corregida y centrada */
@media (max-width: 1024px) {
    body { 
        padding: 14px 12px 100px 12px !important; 
    }

    .costado {
        position: fixed !important;
        bottom: 14px !important;
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 24px) !important;
        max-width: 420px !important;
        height: 64px !important;
        padding: 0 12px !important;
        border-radius: 50px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 9999 !important;
        background: rgba(10, 15, 28, 0.85) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
    }

    /* Ocultar el título "Menu" y la tarjeta de perfil en celular para que no empujen los iconos */
    .costado > div:first-child > div:first-child,
    .perfil-card {
        display: none !important;
    }

    .costado > div:first-child, 
    .costado nav {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .lazos {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-evenly !important;
        width: 100% !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .lazos li {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .toque {
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Ocultar los textos de los botones en móvil y centrar el icono */
    .toque span {
        display: none !important;
    }

    .toque i {
        font-size: 1.35rem !important;
        margin: 0 !important;
    }

    /* Ajustar altura de la tarjeta del chat en celular para que no la tape el menú de abajo */
    #seccion-chat > .liquid-glass {
        height: calc(100vh - 210px) !important;
        min-height: 420px !important;
    }
}
/* Menú contextual flotante tipo burbuja (Desktop & Móvil) */
.bubble-context-menu {
    position: fixed;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: 20px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    transform: scale(0.95);
    animation: bubbleIn 0.15s ease-out forwards;
}

@keyframes bubbleIn {
    to {
        transform: scale(1);
    }
}

.bubble-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: var(--texto);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}
.bubble-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.emoji-bar {
    display: flex;
    gap: 6px;
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.emoji-picker-btn {
    font-size: 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.emoji-picker-btn:hover {
    transform: scale(1.3);
}

/* Chips de Reacciones en el mensaje */
.reaction-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.reaction-chip {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 2px 8px;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.reaction-chip.active {
    border-color: var(--brillo);
    background: rgba(0, 240, 255, 0.15);
}
