/**
 * ==========================================================================
 * SOPORTE TÉCNICO IA - ESTILOS ESPECÍFICOS (soporte.css)
 * Arquitectura Dashboard SaaS (Clon Gemini/ChatGPT)
 * ==========================================================================
 */

:root {
    --color-verde-acento: #28CC43;
    --color-texto-secundario: #cccccc;
    --bg-header-cristal: rgba(0, 9, 87, 0.9);
    --borde-sutil: rgba(255, 255, 255, 0.2);
    --color-texto-principal: #ffffff;
    --fuente-principal: system-ui, -apple-system;
    --resplandor-verde: 0 0 10px rgba(40, 204, 67, 0.4);
}

.support-section {
    padding: 60px 20px 100px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 5;
    min-height: 80vh;
}

.support-header {
    text-align: center;
    max-width: 800px;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.support-title {
    font-size: 2.5rem;
    color: var(--color-verde-acento);
    margin-bottom: 15px;
}

.support-subtitle {
    font-size: 1.1rem;
    color: var(--color-texto-secundario);
    line-height: 1.6;
}

.auth-card-container {
    width: 100%;
    max-width: 550px;
    background: var(--bg-header-cristal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--borde-sutil);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    transition: all 0.4s ease;
}

.auth-view {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.auth-view.active-view {
    display: block;
}

.auth-view h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: var(--color-texto-principal);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.support-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid var(--borde-sutil);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-texto-principal);
    font-size: 1rem;
    font-family: var(--fuente-principal), sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-verde-acento);
    box-shadow: var(--resplandor-verde);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.view-description {
    color: var(--color-texto-secundario);
    font-size: 0.95rem;
    margin-top: -10px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-links {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    font-size: 0.95rem;
}

.auth-links.row-links {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.auth-links a {
    color: var(--color-verde-acento);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.form-message.error { background-color: rgba(255, 60, 60, 0.1); color: #ff6b6b; border: 1px solid #ff6b6b; display: block; }
.form-message.success { background-color: rgba(40, 204, 67, 0.1); color: var(--color-verde-acento); border: 1px solid var(--color-verde-acento); display: block; }

.chat-dashboard {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: 80vh;
    min-height: 600px;
    background: var(--bg-header-cristal);
    backdrop-filter: blur(10px);
    border: 1px solid var(--borde-sutil);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    animation: fadeIn 0.4s ease-in-out;
}

.chat-sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--borde-sutil);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

.btn-close-sidebar {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-texto-principal);
    font-size: 2rem;
    cursor: pointer;
    align-self: flex-end;
    line-height: 1;
    transition: color 0.3s ease;
}

.btn-close-sidebar:hover {
    color: #ff6b6b;
}

.btn-new-chat {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--borde-sutil);
    background: transparent;
    color: var(--color-texto-principal);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-new-chat span {
    font-size: 1.2rem;
    color: var(--color-verde-acento);
}

.btn-new-chat:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-verde-acento);
}

.sidebar-chat-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-verde-acento) transparent;
}

.sidebar-title {
    font-size: 0.8rem;
    color: var(--color-texto-secundario);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-left: 5px;
}

#chat-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-history-item {
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-texto-principal);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-history-item:hover, .chat-history-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.btn-delete-chat {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-history-item:hover .btn-delete-chat {
    opacity: 1;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--borde-sutil);
}

.btn-logout {
    width: 100%;
    background: transparent;
    color: var(--color-texto-secundario);
    border: 1px solid var(--borde-sutil);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-logout:hover { background: rgba(255,60,60,0.2); color: #ff6b6b; border-color: #ff6b6b; }

.chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    width: calc(100% - 280px);
}

.chat-header-main {
    padding: 15px 20px;
    border-bottom: 1px solid var(--borde-sutil);
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-toggle-sidebar {
    background: transparent;
    border: none;
    color: var(--color-texto-principal);
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
}

.ai-status h4 {
    margin: 0;
    color: var(--color-texto-principal);
    font-size: 1.1rem;
}

.chat-history-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-verde-acento) transparent;
}

.chat-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-bubble {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-texto-principal);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.user-bubble {
    background-color: var(--color-verde-acento);
    color: #000957;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    font-weight: 500;
}

.chat-input-wrapper {
    padding: 15px 20px 20px 20px;
    background: transparent;
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--borde-sutil);
    border-radius: 15px;
    padding: 5px 10px;
    transition: border-color 0.3s;
}

.chat-input-area:focus-within {
    border-color: var(--color-verde-acento);
}

.btn-attach {
    background: transparent;
    border: none;
    color: var(--color-texto-secundario);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s;
}

.btn-attach:hover { color: var(--color-verde-acento); }

.chat-input-area textarea {
    flex-grow: 1;
    resize: none;
    height: 45px;
    max-height: 150px;
    border: none;
    background: transparent;
    padding: 12px 0;
    color: var(--color-texto-principal);
    font-family: var(--fuente-principal), sans-serif;
}

.chat-input-area textarea:focus { outline: none; box-shadow: none; border: none; }

.btn-send-chat {
    background-color: var(--color-verde-acento);
    color: #000957;
    border: none;
    border-radius: 10px;
    width: 45px;
    height: 45px;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
}

.btn-send-chat:hover:not(:disabled) { transform: scale(1.05); box-shadow: var(--resplandor-verde); }
.btn-send-chat:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-disclaimer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-texto-secundario);
    margin-top: 10px;
}

/* ==========================================================================
 * CONTENEDOR MULTIMODAL (CHIPS DE ARCHIVOS)
 * ========================================================================== */
.file-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 10px;
    margin-bottom: 10px;
}

.file-chip {
    background-color: rgba(40, 204, 67, 0.15);
    border: 1px solid var(--color-verde-acento);
    color: var(--color-texto-principal);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease-in-out;
}

[data-theme="light"] .file-chip {
    color: #000957;
    background-color: rgba(40, 204, 67, 0.25);
}

.file-chip-name {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-chip-close {
    cursor: pointer;
    color: #ff6b6b;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.file-chip-close:hover {
    color: #ff4c4c;
    transform: scale(1.2);
}

/* ==========================================================================
 * RESPONSIVO (MÓVILES) Y MODO CLARO
 * ========================================================================== */

@media (max-width: 768px) {
    .chat-dashboard { height: 90vh; min-height: 500px; position: relative; display: block; }
    .chat-main { width: 100%; height: 100%; }
    .btn-toggle-sidebar { display: block; }

    .chat-sidebar {
        position: absolute;
        top: 0; left: 0; height: 100%;
        background: var(--bg-header-cristal);
        z-index: 10;
        transform: translateX(-100%);
    }
    .chat-sidebar.open { transform: translateX(0); }

    .btn-close-sidebar {
        display: block;
        position: absolute;
        top: 10px;
        right: 15px;
        z-index: 20;
    }
    .sidebar-header { padding-top: 40px; }

    .chat-bubble { max-width: 90%; }
}

[data-theme="light"] .chat-dashboard {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}
[data-theme="light"] .chat-sidebar { background: #f9f9f9; border-right: 1px solid rgba(0,0,0,0.1); }
[data-theme="light"] .chat-history-item:hover, [data-theme="light"] .chat-history-item.active { background: #e0e0e0; }
[data-theme="light"] .chat-header-main { border-bottom: 1px solid rgba(0,0,0,0.1); }
[data-theme="light"] .ai-status h4, [data-theme="light"] .chat-history-item { color: #000957; }
[data-theme="light"] .btn-new-chat { color: #000957; border-color: rgba(0,0,0,0.2); }
[data-theme="light"] .btn-new-chat:hover { background: #e0e0e0; }
[data-theme="light"] .chat-input-area { background: #ffffff; border-color: rgba(0,0,0,0.2); }
[data-theme="light"] .ai-bubble { background-color: #f0f0f0; color: #000957; }
