/* Paleta de colores Cyber-Dark */
:root {
    --bg-dark: #1e1e2e;
    --panel-bg: rgba(30, 30, 46, 0.85);
    --border-color: #cba6f7;
    --text-main: #cdd6f4;
    --text-user: #f5c2e7;
    --text-bot: #89b4fa;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Consolas', 'Courier New', monospace;
    background-color: #11111b;
    /* Fondo de pantalla general configurado con tu archivo avatar.png */
    background-image: url('avatar.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    display: flex;
    width: 90vw;
    max-width: 1000px;
    height: 85vh;
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    box-shadow: 0 0 20px rgba(203, 166, 247, 0.3);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

/* Panel Izquierdo */
.avatar-panel {
    width: 35%;
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(17, 17, 27, 0.5);
}

.panel-header {
    padding: 10px;
    text-align: center;
    background: rgba(203, 166, 247, 0.2);
    color: var(--border-color);
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}

.avatar-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.avatar-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

/* Panel Derecho (Chat) */
.chat-panel {
    width: 65%;
    display: flex;
    flex-direction: column;
}

.chat-history {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    line-height: 1.5;
    white-space: pre-wrap;
}

.message.user {
    color: var(--text-user);
    font-weight: bold;
}

.message.bot {
    color: var(--text-bot);
}

/* Input y Botón */
.chat-input-area {
    display: flex;
    padding: 15px;
    gap: 10px;
    background: rgba(17, 17, 27, 0.7);
    border-top: 1px solid var(--border-color);
}

#user-input {
    flex: 1;
    background: #11111b;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
}

#send-btn {
    background: var(--border-color);
    color: #11111b;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #b4befe;
}

#send-btn:disabled, #user-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   ESTILOS PARA EL MODAL DE CONFIGURACIÓN
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 17, 27, 0.85);
    backdrop-filter: blur(12px); /* Desenfoque del chat de fondo */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Asegura que esté por encima de todo */
    transition: opacity 0.3s ease;
}

.modal-content {
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    box-shadow: 0 0 30px rgba(203, 166, 247, 0.4);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    padding: 30px;
    text-align: center;
    color: var(--text-main);
}

.modal-icon {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 15px;
    animation: pulse-border 2s infinite ease-in-out;
}

.modal-content h2 {
    font-size: 1.4rem;
    color: var(--border-color);
    margin: 5px 0;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: #a6adc8;
    margin-bottom: 25px;
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 18px;
    gap: 6px;
}

.modal-form-group label {
    font-size: 0.85rem;
    color: var(--text-bot);
    font-weight: bold;
}

.modal-form-group select,
.modal-form-group input {
    background: #11111b;
    border: 1px solid rgba(203, 166, 247, 0.5);
    padding: 10px;
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.modal-form-group select:focus,
.modal-form-group input:focus {
    border-color: var(--border-color);
    box-shadow: 0 0 8px rgba(203, 166, 247, 0.2);
}

.modal-error-msg {
    color: #f38ba8; /* Rojo neón suave */
    font-size: 0.85rem;
    margin-bottom: 15px;
    min-height: 18px;
    font-weight: bold;
}

#modal-accept-btn {
    background: var(--border-color);
    color: #11111b;
    border: none;
    padding: 12px 24px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: transform 0.1s ease, background-color 0.2s ease;
}

#modal-accept-btn:hover {
    background: #b4befe;
    transform: scale(1.01);
}

#modal-accept-btn:active {
    transform: scale(0.99);
}

@keyframes pulse-border {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}
