/* 
 * Estilos para el plugin Tangold - Versión Mejorada
 * Diseño minimalista alineado según mockup aprobado
 */

.tangold-container {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    color: #333333;
    padding: 20px;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.tangold-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tangold-welcome {
    font-size: 20px;
    font-weight: 500;
    color: #333333;
    margin: 0;
}

.tangold-config-button {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.tangold-config-button:hover {
    background-color: #e9ecef;
    text-decoration: none;
    color: #333;
}

.tangold-layout {
    display: flex;
    flex-direction: column;
    gap: 30px; /* Aumentado para evitar solapamiento */
}

.tangold-chart-container {
    width: 100%;
    height: 180px;
    position: relative;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.tangold-progress-container {
    display: flex;
    gap: 20px;
}

.tangold-progress-box {
    flex: 1;
}

.tangold-progress-title {
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tangold-progress-title span {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.tangold-barra {
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    height: 24px;
    margin-bottom: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.tangold-barra > div {
    height: 100%;
    padding: 0 10px;
    color: white;
    text-align: right;
    line-height: 24px;
    font-size: 14px;
    font-weight: 500;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.tangold-barra > div::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.tangold-barra-mensual {
    background: linear-gradient(to right, #d35400, #e67e22);
}

.tangold-barra-total {
    background: linear-gradient(to right, #f1c40f, #f39c12);
}

.tangold-barra-excedente {
    background: linear-gradient(to right, #7f8c8d, #95a5a6);
}

.tangold-barra-historico {
    background: linear-gradient(to right, #3498db, #2980b9);
    width: 100%;
    height: 10px;
    border-radius: 5px;
}

.tangold-info {
    font-size: 14px;
    color: #666666;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

.tangold-info-highlight {
    color: #FF6600;
    font-weight: 500;
}

.tangold-empty-message {
    position: absolute;
    left: 10px;
    color: #666;
    font-size: 12px;
    line-height: 24px;
}

.tangold-bottom-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tangold-historico-section {
    margin-top: 10px;
}

.tangold-historico-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tangold-historico-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.tangold-historico-toggle {
    background: none;
    border: none;
    color: #FF6600;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tangold-historico-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.tangold-historico-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tangold-historico-mes {
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.tangold-historico-valor {
    font-size: 13px;
    color: #666;
}

.tangold-historico-barra {
    margin-top: 5px;
}

.tangold-historico-empty {
    grid-column: span 3;
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

@media (max-width: 768px) {
    .tangold-progress-container {
        flex-direction: column;
    }
    
    .tangold-historico-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tangold-historico-empty {
        grid-column: span 2;
    }
}

/* Estilos para estados del ciclo */
.tangold-estado-ciclo {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tangold-estado-ciclo.tangold-estado-extendido {
    background-color: #fff3e0;
    border-color: #ffcc02;
    color: #ef6c00;
}

.tangold-estado-ciclo.tangold-estado-transferido {
    background-color: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.tangold-estado-ciclo.tangold-estado-esperando {
    background-color: #fce4ec;
    border-color: #f48fb1;
    color: #c2185b;
}

.tangold-alerta-ciclo {
    background-color: #fff8e1;
    border: 1px solid #ffcc02;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 13px;
    color: #f57c00;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tangold-estado-ciclo i,
.tangold-alerta-ciclo i {
    font-size: 14px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .tangold-historico-grid {
        grid-template-columns: 1fr;
    }
    
    .tangold-historico-empty {
        grid-column: span 1;
    }
    
    .tangold-estado-ciclo,
    .tangold-alerta-ciclo {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* === NUEVOS ESTILOS PARA LÓGICA CORREGIDA === */

/* Barra de objetivo completado */
.tangold-barra-total.tangold-completado {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    color: white;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Barra de progreso hacia objetivo */
.tangold-barra-progreso {
    background: linear-gradient(90deg, #ff6600 0%, #ff8533 100%);
    color: white;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Título actualizado para estados */
.tangold-progress-title .tangold-estado-completado {
    color: #28a745;
    font-weight: 600;
}

.tangold-progress-title .tangold-estado-progreso {
    color: #ff6600;
    font-weight: 600;
}

/* Información mejorada para excedentes */
.tangold-info-excedente {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
}

.tangold-info-excedente .tangold-excedente-valor {
    color: #28a745;
    font-weight: 600;
}

/* Alerta de ciclo mejorada para nuevo sistema */
.tangold-alerta-ciclo.tangold-ciclo-sin-objetivo {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.tangold-alerta-ciclo.tangold-ciclo-objetivo-completado {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Animación sutil para estado completado */
.tangold-completado {
    animation: completado-pulse 2s ease-in-out infinite;
}

@keyframes completado-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}
