/**
 * Estilos para el shortcode de devaluación en el frontend
 */

/* Widget base */
.bcv-devaluation-widget {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bcv-devaluation-widget h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.bcv-devaluation-widget p {
    margin: 0;
    color: #7f8c8d;
    text-align: center;
    padding: 20px 0;
}

/* Resumen de devaluación */
.bcv-devaluation-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.bcv-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.bcv-info-item label {
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.bcv-info-item .rate {
    font-weight: bold;
    color: #2980b9;
    font-size: 16px;
}

.bcv-info-item .devaluation {
    font-weight: bold;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
}

.bcv-info-item .devaluation.normal {
    color: #27ae60;
    background: #d5f4e6;
}

.bcv-info-item .devaluation.high {
    color: #e74c3c;
    background: #fadbd8;
}

.bcv-info-item .adjustment {
    font-weight: bold;
    color: #f39c12;
    background: #fef9e7;
    padding: 4px 8px;
    border-radius: 4px;
}

.bcv-info-item .period {
    color: #7f8c8d;
    font-size: 14px;
}

/* Último período */
.bcv-period-details {
    space-y: 15px;
}

.bcv-period-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
}

.period-dates {
    font-weight: 600;
    font-size: 16px;
}

.devaluation-badge {
    font-weight: bold;
    font-size: 18px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
}

.devaluation-badge.high {
    background: rgba(231, 76, 60, 0.9);
}

.devaluation-badge.normal {
    background: rgba(39, 174, 96, 0.9);
}

.bcv-period-rates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.rate-item {
    padding: 12px;
    background: #ecf0f1;
    border-radius: 6px;
    text-align: center;
}

.rate-item label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 14px;
}

.rate-item span {
    font-weight: bold;
    color: #2980b9;
    font-size: 16px;
}

.bcv-adjustment-info {
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    text-align: center;
}

.adjustment-label {
    color: #856404;
    font-weight: 600;
    margin-right: 8px;
}

.adjustment-value {
    color: #f39c12;
    font-weight: bold;
    font-size: 16px;
}

/* Estadísticas */
.bcv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.bcv-stat-item {
    text-align: center;
    padding: 20px 15px;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.bcv-stat-item:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Gráficos */
.bcv-chart-container {
    position: relative;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.bcv-chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* Aviso */
.bcv-devaluation-notice {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    text-align: center;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .bcv-devaluation-widget {
        padding: 15px;
        margin: 15px 0;
    }
    
    .bcv-devaluation-info {
        grid-template-columns: 1fr;
    }
    
    .bcv-period-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .bcv-period-rates {
        grid-template-columns: 1fr;
    }
    
    .bcv-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bcv-info-item {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .bcv-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .bcv-devaluation-widget h3 {
        font-size: 16px;
    }
}

/* Animaciones */
.bcv-devaluation-widget {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de carga */
.bcv-loading {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.bcv-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #3498db;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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