/* Estilos de index.php
   (antes embebidos en <style>; se pasaron a este archivo el 25/09/2026 sin cambiar reglas)
*/

/* Estilos adicionales para mejorar el encabezado */
body, html {
    margin: 0 !important;
    padding: 0 !important;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-active));
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
}

.logo-left {
    flex: 0 0 auto;
}

.logo-left img {
    max-width: 180px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.name-column {
    flex: 1;
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.logo-right {
    flex: 0 0 auto;
}

.logo-right img {
    max-width: 330px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Ocultar imagen si falla la carga */
.logo-right img.hidden {
    display: none;
}

/* Contenedor principal con padding */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5px;
}

/* Estilos para el iframe */
#content-iframe {
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
    transition: all var(--transition-speed) ease;
    display: none; /* Oculto por defecto */
}

#content-iframe.show {
    display: block;
}

/* Cache status indicator */
.cache-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.cache-indicator.show {
    display: block;
}

.cache-indicator.cached {
    background: rgba(0, 128, 0, 0.7);
}

.cache-indicator.fresh {
    background: rgba(255, 165, 0, 0.7);
}

/* Footer personalizable - oculto por defecto */
.custom-footer {
    display: none;
    margin-top: 20px;
    padding: 0;
    min-height: 0;
}

.custom-footer.show {
    display: block;
}

/* Loading overlay optimizado */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: #333;
}

/* Los estilos del pie de página se encuentran en style1.css */

/* Burbuja flotante del chat */
.chat-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    background: var(--primary-color, #1a6bb5);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.chat-float-btn i { color: white; font-size: 26px; }

/* Panel de chat inline */
.chat-panel {
    position: fixed;
    bottom: 94px;
    right: 24px;
    width: 340px;
    height: 480px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 9997;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: bottom right;
}
.chat-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}
.chat-panel-header {
    background: var(--primary-color, #1a6bb5);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.chat-panel-header i { font-size: 18px; }
.chat-panel-header span { font-size: 14px; font-weight: 600; flex: 1; }
.chat-panel-header a {
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    white-space: nowrap;
}
.chat-panel-header a:hover { color: white; text-decoration: underline; }
.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f0f2f5;
}
.cp-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.cp-msg-bot {
    background: white;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.cp-msg-user {
    background: var(--primary-color, #1a6bb5);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}
.cp-msg-typing { color: #999; font-style: italic; }
.chat-panel-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e0e0e0;
    background: white;
    flex-shrink: 0;
}
.chat-panel-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    outline: none;
}
.chat-panel-input input:focus { border-color: var(--primary-color, #1a6bb5); }
.cp-send-btn {
    width: 34px;
    height: 34px;
    background: var(--primary-color, #1a6bb5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-send-btn:disabled { background: #ccc; cursor: default; }
@media (max-width: 400px) {
    .chat-panel { width: calc(100vw - 24px); right: 12px; }
}
