html, body {
    height: 100%;
}

app {
    display: block;
    height: 100%;
}

.logon-template-header .header-logo {
    flex-shrink: 0;
    background-image: url('../images/toplogo.png');
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    width: 500px;
    height: 24px;
}

.header-logo {
    flex-shrink: 0;
    background-image: url('../images/Logo.png');
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    width: 180px;
    height: 24px;
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

#logon-template-component {
    /* background: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.5)), url("/images/portada.jpg");*/
    background: url('/images/background2.png') ;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.header {
    background-color: #213b52;
    color: #ffffff;
}

    .header .xaf-caption-icon-container {
        background-color: #eeeeee;
    }


.card, .dxbl-tabs-top, .dxbl-tabs, .dxbl-group, dxbl-tabs-tablist {
    background-color: #ffffff82;
}

.table {
    --bs-table-bg: ffffff82;
}

.dxbl-scheduler {
    --dxbl-scheduler-background-color: #ffffff82;
}
/*#main-window-template-component*/
#main-window-template-component .xaf-flex-auto {
    /*    background: url('/images/background3.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;*/
    background: linear-gradient(180deg, #CAE9FF 0.01%, #F2F4FE 100.01%);
}

.welcome-pdf-viewer {
    width: 100%;
    height: 500px;
}

    .welcome-pdf-viewer .dxbrv-toolbar {
        height: 2rem;
    }

.pe-pdf-viewer .dxbrv-toolbar {
    height: 2rem;
}

.pe-pdf-viewer {
    width: 300px;
    height: 100vh;
}

/* Estilos para el chatbot */

/* Contenedor del chatbot */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

    .chatbot-container.closed {
        display: block;
    }

    .chatbot-container.open {
        display: block;
    }

/* Botón flotante para abrir/cerrar */
.chatbot-button {
    background-color: #3b82f6;
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

    .chatbot-button:hover {
        background-color: #2563eb;
    }

/* Marco del chatbot */
.chatbot-frame {
    width: 400px; /* Default width for larger screens */
    height: 600px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 80px;
    right: 20px;
}

/* Media query for screens with a maximum width of 768px (common breakpoint for tablets/phones) */
@media (max-width: 768px) {
    .chatbot-frame {
        width: 90%; /* Occupy 90% of the screen width */
        right: 5%; /* Adjust right position to center it roughly (100% - 90% = 10%, half of that is 5%) */
        left: 5%; /* Add left position to ensure centering */
        bottom: 80px; /* You might want to adjust bottom for smaller screens */
        height: 500px; /* Allow height to adjust based on content, or set a max-height */
        max-height: 80vh; /* Example: limit height to 80% of viewport height */
    }
}

/* Optional: Further adjustments for very small screens (e.g., phones in portrait) */
@media (max-width: 480px) {
    .chatbot-frame {
        right: 5%;
        left: 5%;
        bottom: 80px;
        max-height: 90vh;
    }
}

/* Encabezado del chatbot */
.chatbot-header {
    background-color: #213b52;
    padding: 12px;
    border-bottom: 1px solid #d1d5db;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: move;
    font-weight: 900;
    color: #fff;
}

/* Contenedor principal dentro del frame */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 5px;
    overflow: hidden;
    background: linear-gradient(150.64deg,#d9f5fd 27.7%,#ffebf5 50.8%,#fbebff);
}

/* Área de conversación (historial) */
.conversation {
    flex: 1;
    max-height: calc(100% - 100px);
    /*    border: 1px solid #d1d5db;*/
    border-radius: 4px;
    padding: 2px;
    overflow-y: auto;
    margin-bottom: 5px;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mensajes */
.message {
    display: flex;
    flex-direction: column;
    max-width: 95%;
    word-wrap: break-word;
}

.message-user,
.message-assistant {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.message-user {
    align-self: flex-end;
    background-color: #d7e8f7;
    border: 1px solid #e0e0e0;
    color: #333;
}

.message-assistant {
    align-self: flex-start;
    background-color: #337ab70f; /*#e6e1f5;*/ /* Morado claro */
    color: #333;
}

.message .label {
    font-size: 10px;
    color: #213b52;
    margin-bottom: 2px;
    font-weight: 700;
}

.message-empty {
    color: #6b7280;
}

/* Estilos para Markdown renderizado */
.message div ul,
.message div ol {
    margin: 4px 0;
    padding-left: 15px;
}

.message div p {
    margin: 4px 0;
}

.message div strong {
    font-weight: 700;
}

/* Área del textarea */
/*.textarea-container {
  
    flex-shrink: 0;
    position: relative;
}

.textarea {
    width: 100%;
    padding: 0px 33px 0px 5px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    resize: none;
    height: 80px;
}*/

.input-row {
    display: flex;
    align-items: stretch; /* Para que textarea y botones tengan la misma altura */
    gap: 8px;
}

.textarea-container {
    flex: 1; /* Que el textarea ocupe todo el espacio posible */
    position: relative;
}

.textarea {
    width: 100%;
    height: 100%;
    resize: none;
}
/* Indicador de carga */
.loading-indicator {
    position: absolute;
    right: 40%;
    top: 30%;
    transform: translateY(-50%);
    color: #007bff;
    font-size: 120px;
}

.init-indicator {
    position: absolute;
    right: 40%;
    top: 30%;
    transform: translateY(-50%);
    color: #007bff;
    font-size: 120px;
}

/* Contenedor de botones */
.button-container {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Estilo de botones */
.button {
    padding: 8px 16px;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.button-primary {
    background-color: #3b82f6;
    flex: 0 0 70%;
}

    .button-primary:hover {
        background-color: #2563eb;
    }

.button-danger {
    background-color: #ef4444;
    flex: 0 0 30%;
}

    .button-danger:hover {
        background-color: #dc2626;
    }

.button-container-vertical {
    display: flex;
    flex-direction: column; /* Uno debajo del otro */
    gap: 8px;
}

    .button-container-vertical .button {
        flex: 1; /* Que ocupen el mismo alto */
    }


/* Manija de redimensionamiento */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background-color: #d1d5db;
    background: url('../images/resize2.svg');
}
