/* ===================================================================================
   TEMPLATE CSS - Mashup Descargable con Overlay Inline
   Versión: 3.1 - Estilo homologado para carga inicial
   =================================================================================== */

/* --- Estilos base del contenedor --- */
.container {
    padding-left: 40px !important;
    padding-right: 40px !important;
    width: 100%;
}

.mb-inter-filter {
    height: 80px !important;
    margin-top: -21px;
}

.qvtittle {
    height: 100px !important;
    text-align: center;
    margin: 15px 5px 15px 0;
}

.qvdate {
    height: 80px !important;
    margin-top: -21px;
    text-align: center;
    margin-left: 10px;
}

.qvgraphic1 {
    margin-top: 0;
    margin-bottom: 40px;
}

.qvobject2 {
    height: 440px;
    display: flex;
    align-items: center;
    flex-direction: column;
    box-sizing: border-box;
    z-index: 1;
    flex: 1 1 auto;
}

/* --- Responsive --- */
@media screen and (width: 360px) {
    .qvobject2 {
        height: 330px !important;
        width: 100%;
        display: flex;
    }
}

@media screen and (width: 375px) {
    .qvobject2 {
        height: 390px !important;
        width: 100%;
        display: flex;
    }
}

/* --- Botones --- */
#buttonID {
    font-size: 18px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 5px;
    border-style: solid;
    border-width: 1.5px;
    border-color: #e6e6e6;
    border-radius: 0px;
    background-color: #FFFFFF;
    color: #595959;
    margin: 0px 4px;
}

#buttonID2 {
    font-size: 13px;
    font-weight: bold;
    padding: 7px 10px 5px;
    margin-top: 10px;
    border-radius: 5px;
    border-style: solid;
    border-width: 1.5px;
    border-color: #e6e6e6;
    border-radius: 5px;
    background-color: #FFFFFF;
    color: #595959;
}

#buttonID3 {
    font-size: 13px;
    font-weight: bold;
    padding: 7px 10px 5px;
    margin-top: 10px;
    border-radius: 5px;
    border-style: solid;
    border-width: 1.5px;
    border-color: #e6e6e6;
    border-radius: 5px;
    background-color: #FFFFFF;
    color: #595959;
}

#qcmd {
    font-size: 18px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 5px;
    border-style: solid;
    border-width: 1.5px;
    border-color: #e6e6e6;
    border-radius: 0px;
    background-color: #FFFFFF;
    color: #595959;
    margin: 0px 4px;
}

#qcmd:hover {
    color: #99A3A4;
}

#buttonID:hover {
    color: #99A3A4;
}

/* --- Date picker --- */
#CDEesJ_content {
    font-weight: bold;
    font-size: 13px;
    display: flex;
    height: 88%;
    padding: 5px 10px;
    border-style: solid;
    border-width: 1.5px;
    border-color: #d9d9d9;
    border-radius: 3px;
}

#CDEesJ_content:hover {
    border-color: #595959;
}


/* ===================================================================================
   OVERLAY INLINE - Sistema de overlay para iframe
   =================================================================================== */

#inline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-left: 15%;
    padding-top: 0;
    backdrop-filter: blur(2px);
    overflow: visible;
}

#inline-overlay-content {
    width: 350px;
    max-width: 400px;
    padding: 5px 40px;
    text-align: center;
}

/* ===================================================================================
   ESTADO: CARGANDO INICIAL - Estilo homologado
   =================================================================================== */

.overlay-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 0;
}

/* Spinner estilo homologado - círculo completo con borde superior azul */
.overlay-loading .spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007ACC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Texto principal "Cargando datos..." - negro/gris oscuro */
.overlay-loading .loading-text {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 600;
    margin-top: 8px;
}

/* Subtexto "Aplicando filtros..." - gris claro */
.overlay-loading .loading-subtext {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

/* Contenedor de la barra de progreso con info a los lados */
.overlay-loading .progress-wrapper {
    width: 100%;
    margin-top: 15px;
}

/* Barra de progreso estilo homologado */
.overlay-loading .progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.overlay-loading .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007ACC, #00a8ff);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Info de progreso: "Preparando" a la izquierda, "0%" a la derecha */
.overlay-loading .progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.overlay-loading .progress-info .progress-label {
    color: #666;
}

.overlay-loading .progress-info .progress-percent {
    color: #666;
}

/* Botón cancelar - Estilo Ghost Button */
.overlay-loading .cancel-btn {
    padding: 6px 16px;
    background: transparent;
    color: #595959;
    border: 1px solid #999999;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 0px;
    transition: all 0.2s;
}

.overlay-loading .cancel-btn:hover {
    background: #f5f5f5;
    border-color: #666666;
}

/* ===================================================================================
   ESTADO: DESCARGANDO - Estilo homologado
   =================================================================================== */

.overlay-downloading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.overlay-downloading .download-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 4px;
}

.overlay-downloading .download-eta {
    font-size: 13px;
    color: #1F2937;
    margin: 0 0 8px 0;
}

.overlay-downloading .download-details {
    font-size: 12px;
    color: #666;
    margin: 4px 0 0 0;
}

.overlay-downloading .progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.overlay-downloading .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007ACC, #00a8ff);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.overlay-downloading .cancel-btn {
    padding: 6px 16px;
    background: transparent;
    color: #595959;
    border: 1px solid #999999;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    transition: all 0.2s;
}

.overlay-downloading .cancel-btn:hover {
    background: #f5f5f5;
    border-color: #666666;
}

/* ===================================================================================
   ESTADO: ÉXITO - Estilo homologado
   =================================================================================== */

.overlay-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.overlay-success .success-icon-circle {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.overlay-success .success-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.overlay-success .success-details {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.overlay-success .cancel-btn {
    padding: 6px 16px;
    background: transparent;
    color: #595959;
    border: 1px solid #999999;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    transition: all 0.2s;
}

.overlay-success .cancel-btn:hover {
    background: #f5f5f5;
    border-color: #666666;
}

/* ===================================================================================
   ESTADO: ERROR
   =================================================================================== */

.overlay-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.overlay-error .error-icon {
    font-size: 32px;
    color: #dc3545;
}

.overlay-error .error-title {
    font-size: 15px;
    font-weight: 600;
    color: #dc3545;
    margin: 0;
}

.overlay-error .error-message {
    font-size: 12px;
    color: #666;
    margin: 0;
    max-width: 300px;
}

.overlay-error .error-suggestions {
    font-size: 11px;
    color: #856404;
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
    text-align: left;
    margin-top: 5px;
    max-width: 300px;
}

.overlay-error .close-btn,
.overlay-nodata .close-btn {
    padding: 6px 20px;
    background: #007ACC;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

.overlay-error .close-btn:hover,
.overlay-nodata .close-btn:hover {
    background: #005a9e;
}

/* ===================================================================================
   ESTADO: SIN DATOS
   =================================================================================== */

.overlay-nodata {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.overlay-nodata .nodata-icon {
    font-size: 32px;
    color: #ffc107;
}

.overlay-nodata .nodata-title {
    font-size: 15px;
    font-weight: 600;
    color: #856404;
    margin: 0;
}

.overlay-nodata .nodata-message {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* ===================================================================================
   ANIMACIONES
   =================================================================================== */

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}