/* modules/chatbot/chatbot.css */

/* --- 1. ESTILOS BASE (Estructura) --- */
.terminal-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 450px;
    height: 350px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
}
.terminal-container.minimized {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: grab;
}
.header-controls {
    display: flex;
    align-items: center;
    position: relative;
}
.control-btn {
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease;
    margin-left: 10px;
}
.terminal-body {
    flex-grow: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.message-area {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
}
.message-area p {
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.terminal-input-line {
    display: flex;
    align-items: center;
    padding-top: 5px;
}
.terminal-input {
    flex-grow: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
}
.reopen-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}
.reopen-button:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Ocultar iconos y títulos de temas por defecto */
#terminal-title [data-theme-title],
#reopen-btn [data-theme-icon] {
    display: none;
}

/* --- 2. ESTILOS INTERRUPTOR DE TEMA --- */
.theme-switcher-container {
    position: absolute;
    right: 50px; /* Al lado del botón de settings */
    top: -5px;
    background-color: #333;
    border-radius: 5px;
    padding: 5px;
    display: none; /* Oculto por defecto */
    border: 1px solid #555;
    z-index: 10;
}
.theme-switcher-container.active {
    display: flex;
}
.theme-btn {
    background: #555;
    border: 1px solid #777;
    color: white;
    cursor: pointer;
    margin: 0 3px;
    font-size: 1.2rem;
    padding: 2px 6px;
    border-radius: 4px;
}
.theme-btn:hover {
    background: #777;
}

/* --- 3. TEMA RETRO (Xbox) --- */
body.theme-retro .terminal-container {
    background-color: #000;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    font-family: Arial, "Segoe UI", sans-serif;
    color: #FFF;
    border-radius: 8px;
}
body.theme-retro .terminal-header {
    background-color: #1a1a1a;
    border-bottom: 1px solid var(--primary-color);
    font-weight: bold;
}
body.theme-retro .control-btn:hover {
    color: var(--primary-color);
}
body.theme-retro .terminal-body {
    background-color: rgba(10, 10, 10, 0.8);
}
body.theme-retro .message-area p.user-echo { color: #FFF; }
body.theme-retro .message-area p.bot-response { color: var(--primary-color); }
body.theme-retro .terminal-input-line { border-top: 1px solid #333; }
body.theme-retro .prompt { color: var(--primary-color); font-weight: bold; margin-right: 5px; }
body.theme-retro .terminal-input { color: #FFF; font-family: Arial, "Segoe UI", sans-serif; }
body.theme-retro .reopen-button {
    border-radius: 50%;
    background-color: #111;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
    color: var(--primary-color);
    animation: neon-pulse 1.5s infinite alternate;
}
body.theme-retro .reopen-button i { font-size: 2rem; }
body.theme-retro .reopen-button:hover { background-color: var(--primary-color); color: #000; }
@keyframes neon-pulse {
    from { box-shadow: 0 0 5px rgba(0, 255, 0, 0.8); }
    to { box-shadow: 0 0 12px rgba(0, 255, 0, 1); }
}

/* --- 4. TEMA TOON (Animado) --- */
/* (Requiere importar una fuente Toon en tu CSS principal, ej: @import url('https://fonts.googleapis.com/css2?family=Bangers');) */
body.theme-toon .terminal-container {
    background-color: #F0F0F0;
    border: 3px solid #000;
    color: #000;
    font-family: 'Bangers', cursive; /* Fuente tipo cómic */
    border-radius: 0;
    box-shadow: 5px 5px 0px #000; /* Efecto pegatina */
}
body.theme-toon .terminal-header {
    background-color: #FFDE00; /* Amarillo brillante */
    border-bottom: 3px solid #000;
    color: #D62828; /* Rojo */
    letter-spacing: 1px;
}
body.theme-toon .control-btn { color: #000; }
body.theme-toon .control-btn:hover { color: #D62828; }
body.theme-toon .terminal-body { background-color: #F0F0F0; }
body.theme-toon .message-area { font-family: 'Arial', sans-serif; } /* Fuente legible para el chat */
body.theme-toon .message-area p { padding: 8px; border-radius: 10px; margin-bottom: 5px; }
body.theme-toon .message-area p.user-echo { background: #E0E0E0; color: #000; }
body.theme-toon .message-area p.bot-response { background: #00A8E8; color: #FFF; font-weight: bold; }
body.theme-toon .terminal-input-line { border-top: 2px solid #CCC; }
body.theme-toon .prompt { color: #D62828; font-weight: bold; margin-right: 5px; }
body.theme-toon .terminal-input { color: #000; font-family: 'Arial', sans-serif; }
body.theme-toon .reopen-button {
    border-radius: 0;
    background-color: #FFDE00;
    border: 3px solid #000;
    box-shadow: 4px 4px 0px #000;
    color: #D62828;
}
body.theme-toon .reopen-button i { font-size: 2.2rem; }
body.theme-toon .reopen-button:hover { transform: scale(1.05) rotate(5deg); }


/* --- 5. TEMA EJECUTIVO (Formal) --- */
body.theme-ejecutivo .terminal-container {
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    font-family: 'Lato', 'Segoe UI', sans-serif; /* Fuente limpia */
    color: #333;
    border-radius: 6px;
}
body.theme-ejecutivo .terminal-header {
    background-color: #F9F9F9;
    border-bottom: 1px solid #E0E0E0;
    color: #111;
    font-weight: 600;
}
body.theme-ejecutivo .control-btn { color: #888; }
body.theme-ejecutivo .control-btn:hover { color: #111; }
body.theme-ejecutivo .terminal-body { background-color: #FFFFFF; }
body.theme-ejecutivo .message-area p { margin-bottom: 8px; }
body.theme-ejecutivo .message-area p.user-echo { text-align: right; }
body.theme-ejecutivo .message-area p.user-echo::before { content: ""; } /* Quita el prompt */
body.theme-ejecutivo .message-area p.user-echo { 
    display: inline-block;
    background: #EFEFEF; 
    color: #333; 
    padding: 8px 12px;
    border-radius: 12px 12px 0 12px;
    max-width: 80%;
    margin-left: 20%;
}
body.theme-ejecutivo .message-area p.bot-response {
    display: inline-block;
    background: #005A9C; /* Azul corporativo */
    color: #FFF;
    padding: 8px 12px;
    border-radius: 12px 12px 12px 0;
    max-width: 80%;
}
body.theme-ejecutivo .terminal-input-line { 
    border-top: 1px solid #E0E0E0;
    background: #F9F9F9;
    padding: 8px;
    border-radius: 0 0 6px 6px;
}
body.theme-ejecutivo .prompt { display: none; } /* Sin prompt visible */
body.theme-ejecutivo .terminal-input { 
    color: #333; 
    font-family: 'Lato', sans-serif; 
    background: #FFF;
    border: 1px solid #CCC;
    border-radius: 5px;
    padding: 5px;
}
body.theme-ejecutivo .reopen-button {
    border-radius: 50%;
    background-color: #005A9C;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    color: #FFF;
    animation: soft-pulse 2s infinite ease-out;
}
body.theme-ejecutivo .reopen-button i { font-size: 1.8rem; }
body.theme-ejecutivo .reopen-button:hover { background-color: #004170; }
@keyframes soft-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 90, 156, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 90, 156, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 90, 156, 0); }
}

/* Media query para móviles (afecta a todos los temas) */
@media (max-width: 600px) {
    .terminal-container {
        width: calc(100vw - 20px);
        height: 280px;
        bottom: 10px;
        right: 10px;
    }
}