﻿/* --- Estilos base existentes --- */
@import url('lib/tailwindcss/dist/preflight.css');

html {
    min-height: 100vh;
    font-family: telefonicabrand, Arial, sans-serif;
}

html, .main-background-gradient {
    background: linear-gradient(to bottom, rgb(225 227 233), #f4f4f4 25rem);
}

body {
    font-family: "telefonicabrand", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #313235;
    font-weight: bold;
}
/* --- Estilos Telefonica --- */
@font-face {
    font-family: "telefonicabrand";
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    src: url(fonts/brand/normal/light/Telefonica-Light.otf) format("truetype"), url(fonts/brand/normal/light/Telefonica-Light.woff2) format("woff2"), url(fonts/brand/normal/light/Telefonica-Light.woff) format("woff");
}
/* --- Estilos base existentes --- */
@import url('lib/tailwindcss/dist/preflight.css');

html {
    min-height: 100vh;
}

html, .main-background-gradient {
    background: linear-gradient(to bottom, rgb(225 227 233), #f4f4f4 25rem);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html::after {
    content: '';
    background-image: linear-gradient(to right, #3a4ed5, #3acfd5 15%, #d53abf 85%, red);
    width: 100%;
    height: 2px;
    position: fixed;
    top: 0;
}

h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 600;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0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pbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.btn-default {
    display: flex;
    padding: 0.25rem 0.75rem;
    gap: 0.25rem;
    align-items: center;
    border-radius: 0.25rem;
    border: 1px solid #9CA3AF;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    background-color: #D1D5DB;
}

.btn-default:hover {
    background-color: #E5E7EB;
}

.btn-subtle {
    display: flex;
    padding: 0.25rem 0.75rem;
    gap: 0.25rem;
    align-items: center;
    border-radius: 0.25rem;
    border: 1px solid #D1D5DB;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.btn-subtle:hover {
    border-color: #93C5FD;
    background-color: #DBEAFE;
}

.page-width {
    max-width: 1024px;
    margin: auto;
}

/* --- Estilos Chat AI --- */
.chat-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 24px;
    box-sizing: border-box;
    align-items: center;
}

.chat-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.chat-subtitle {
    color: #888;
    font-size: 1rem;
}

.chat-messages {
    width: 408px; /* input (300px) + botón (100px) + gap (8px) */
    min-width: 408px;
    max-width: 500px;
    margin-bottom: 16px;
    margin-left: auto;
    margin-right: auto;
}

.chat-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    margin-bottom: 10px;
    max-width: 80%;
    word-break: break-word;
    position: relative;
}

.chat-bubble.user {
    background: #e3f2fd;
    align-self: flex-end;
    margin-left: auto;
}

.chat-bubble.ai {
    background: #f5f5f5;
    align-self: flex-start;
    margin-right: auto;
}

.chat-user-label {
    font-size: 0.85rem;
    color: #1976d2;
    font-weight: bold;
    margin-bottom: 4px;
}

.chat-bubble.ai .chat-user-label {
    color: #333;
}

.chat-text {
    font-size: 1rem;
}

.chat-citations {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-input-bar-container {
    width: 408px;
    max-width: 500px;
    min-width: 408px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    width: 100%;
}

.chat-input {
    width: 300px;
    min-width: 200px;
    max-width: 400px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    flex: none;
}

.chat-input:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px #1976d233;
    outline: none;
}

.chat-send-btn {
    width: 100px;
    min-width: 80px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    flex: none;
}

.chat-send-btn:hover {
    background: #1565c0;
}

.chat-send-btn:focus {
    background: #1565c0;
    outline: 2px solid #1976d2;
}

.chat-send-btn:active {
    background: #0d47a1;
}

.input-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.chat-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245,245,245,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 8px;
}

.chat-empty {
    color: #888;
    font-size: 1rem;
    margin-bottom: 16px;
}

.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.loader {
    width: 24px;
    height: 24px;
    border: 4px solid #1976d2;
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 600;
}

    h1:focus {
        outline: none;
    }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.btn-default {
    display: flex;
    padding: 0.25rem 0.75rem;
    gap: 0.25rem;
    align-items: center;
    border-radius: 0.25rem;
    border: 1px solid #9CA3AF;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    background-color: #D1D5DB;
}

    .btn-default:hover {
        background-color: #E5E7EB;
    }

.btn-subtle {
    display: flex;
    padding: 0.25rem 0.75rem;
    gap: 0.25rem;
    align-items: center;
    border-radius: 0.25rem;
    border: 1px solid #D1D5DB;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

    .btn-subtle:hover {
        border-color: #93C5FD;
        background-color: #DBEAFE;
    }

.page-width {
    max-width: 1024px;
    margin: auto;
}

/* --- Estilos Chat AI --- */
.chat-page {
    min-width: 320px;         /* Mínimo para móviles */
    max-width: 700px;         /* Máximo para escritorio */
    min-height: 400px;        /* Altura mínima */
    width: 100%;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 8px;
}

    .chat-header h2 {
        margin: 0;
        font-size: 1.5rem;
    }

.chat-subtitle {
    color: #888;
    font-size: 1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
}

.chat-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    margin-bottom: 10px;
    max-width: 80%;
    word-break: break-word;
    position: relative;
}

    .chat-bubble.user {
        background: #e3f2fd;
        align-self: flex-end;
        margin-left: auto;
    }

    .chat-bubble.ai {
        background: #f5f5f5;
        align-self: flex-start;
        margin-right: auto;
    }

.chat-user-label {
    font-size: 0.85rem;
    color: #1976d2;
    font-weight: bold;
    margin-bottom: 4px;
}

.chat-bubble.ai .chat-user-label {
    color: #333;
}

.chat-text {
    font-size: 1rem;
}

.chat-citations {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.chat-input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.chat-send-btn {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

    .chat-send-btn:hover {
        background: #1565c0;
    }

.chat-empty {
    color: #888;
    font-size: 1rem;
    margin-bottom: 16px;
}
.chat-bubble {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 18px;
    border-radius: 18px;
    margin-bottom: 10px;
    word-break: break-word;
    position: relative;
}
.chat-input-bar-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.chat-input-bar {
    display: flex;
    width: 100%;
    gap: 8px;
    margin-top: 12px;
    position: relative; /* Necesario para el overlay */
}

.chat-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Ocupa el alto de la barra de entrada */
    background: rgba(245,245,245,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 8px;
    pointer-events: all;
}
.chat-input-bar-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.chat-input-bar {
    display: flex;
    width: 100%;
    gap: 8px;
    margin-top: 12px;
    position: relative;
}

.chat-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245,245,245,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 8px;
    pointer-events: all;
}

/* Indicador circular centrado y grande */
.chat-progress-indicator {
    width: 48px;
    height: 48px;
    border: 6px solid #1976d2;
    border-top: 6px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.chat-input-bar-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.chat-input-bar {
    display: flex;
    width: 100%;
    gap: 8px;
    margin-top: 12px;
    position: relative; /* Necesario para el overlay */
}

.chat-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Ocupa el alto de la barra de entrada */
    background: rgba(245,245,245,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 8px;
    pointer-events: all;
}

.chat-progress-indicator {
    width: 40px;
    height: 40px;
    border: 5px solid #1976d2;
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.chat-page {
    max-width: 480px; /* Ajusta según tu preferencia visual */
    width: 100%;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    align-items: center;
}

.chat-header,
.chat-messages,
.chat-input-bar-container {
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    width: 100%;
}

.chat-input {
    flex: 1 1 0;
    min-width: 120px;
    max-width: 340px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.chat-send-btn {
    flex: 0 0 auto;
    min-width: 80px;
    max-width: 120px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

@media (max-width: 600px) {
    .chat-page,
    .chat-header,
    .chat-messages,
    .chat-input-bar-container {
        max-width: 98vw;
        padding: 8px;
    }
    .chat-input-bar {
        gap: 4px;
    }
    .chat-input {
        min-width: 60px;
        max-width: 200px;
        font-size: 0.95rem;
    }
    .chat-send-btn {
        min-width: 60px;
        max-width: 90px;
        font-size: 0.95rem;
        padding: 0 12px;
    }
}
.chat-page {
    min-width: 360px;         /* Más ancho en escritorio */
    max-width: 600px;         /* Ajusta según tu preferencia */
    width: 100%;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    align-items: center;
}

.chat-header,
.chat-messages,
.chat-input-bar-container {
    width: 100%;
    max-width: 600px;
    min-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    width: 100%;
}

.chat-input {
    flex: 1 1 0;
    min-width: 180px;
    max-width: 440px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.chat-send-btn {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 140px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
@media (max-width: 600px) {
    .chat-page,
    .chat-header,
    .chat-messages,
    .chat-input-bar-container {
        max-width: 98vw;
        min-width: 0;
        padding: 8px;
    }
    .chat-input-bar {
        gap: 4px;
    }
    .chat-input {
        min-width: 60px;
        max-width: 200px;
        font-size: 0.95rem;
    }
    .chat-send-btn {
        min-width: 60px;
        max-width: 90px;
        font-size: 0.95rem;
        padding: 0 12px;
    }
}
.chat-input-bar {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    position: relative;
    height: 48px; /* Ajusta este valor al alto real del input y botón */
    align-items: stretch;
}

.chat-input {
    flex: 1 1 0;
    min-width: 180px;
    max-width: 440px;
    height: 100%; /* Ocupa todo el alto de la barra */
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    box-sizing: border-box;
}

.chat-send-btn {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 140px;
    height: 100%; /* Ocupa todo el alto de la barra */
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
}

.chat-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Igual al alto de la barra */
    background: rgba(245,245,245,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 8px;
    pointer-events: all;
}
