/* trends-enhanced.css - Tarjetas de Tendencias Mejoradas */

/* ========================================
   SECCIÓN DE TENDENCIAS PRINCIPAL
   ======================================== */
.trends-section {
    padding: 2.5rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin: 2rem 0;
    border-radius: 20px;
}

.trends-header {
    text-align: center;
    margin-bottom: 2rem;
}

.trends-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.trends-header h3::before {
    content: '📊';
    font-size: 1.5rem;
}

.trends-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* ========================================
   GRID DE TARJETAS
   ======================================== */
.trends-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 0 1rem;
}

@media (max-width: 1024px) {
    .trends-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .trends-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TARJETA DE TENDENCIA - BASE
   ======================================== */
.trend-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.trend-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--fuel-color-1) 0%, var(--fuel-color-2) 100%);
}

.trend-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Iconos de combustible antes del título */
.trend-card .trend-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--fuel-color-1) 0%, var(--fuel-color-2) 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.trend-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trend-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--fuel-color-1) 0%, var(--fuel-color-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.trend-unit {
    font-size: 0.9rem;
    font-weight: 500;
    color: #94a3b8;
    margin-left: 0.25rem;
}

/* Área del gráfico */
.chart-wrapper {
    margin-top: 1rem;
    height: 60px;
    position: relative;
}

.chart-wrapper.small-chart {
    height: 40px;
}

/* ========================================
   COLORES POR TIPO DE COMBUSTIBLE
   ======================================== */

/* Gasolina 95 - Verde esmeralda */
.trend-card[data-fuel="gasolina95"],
.trend-card:nth-child(1) {
    --fuel-color-1: #10b981;
    --fuel-color-2: #059669;
}

/* Diésel A - Azul oscuro */
.trend-card[data-fuel="diesel"],
.trend-card:nth-child(2) {
    --fuel-color-1: #3b82f6;
    --fuel-color-2: #1d4ed8;
}

/* Gasolina 98 - Naranja */
.trend-card[data-fuel="gasolina98"],
.trend-card:nth-child(3) {
    --fuel-color-1: #f97316;
    --fuel-color-2: #ea580c;
}

/* Diésel + - Púrpura */
.trend-card[data-fuel="diesel_plus"],
.trend-card:nth-child(4) {
    --fuel-color-1: #8b5cf6;
    --fuel-color-2: #7c3aed;
}

/* Diésel B - Marrón */
.trend-card[data-fuel="diesel_b"],
.trend-card:nth-child(5) {
    --fuel-color-1: #a16207;
    --fuel-color-2: #854d0e;
}

/* Biodiésel - Verde lima */
.trend-card[data-fuel="biodiesel"],
.trend-card:nth-child(6) {
    --fuel-color-1: #84cc16;
    --fuel-color-2: #65a30d;
}

/* GLP - Turquesa */
.trend-card[data-fuel="glp"],
.trend-card:nth-child(7) {
    --fuel-color-1: #14b8a6;
    --fuel-color-2: #0d9488;
}

/* GNC - Cian */
.trend-card[data-fuel="gnc"],
.trend-card:nth-child(8) {
    --fuel-color-1: #06b6d4;
    --fuel-color-2: #0891b2;
}

/* Tarjetas pequeñas en segunda fila */
.trend-card.small-card {
    padding: 1rem;
}

.trend-card.small-card .trend-value {
    font-size: 1.5rem;
}

.trend-card.small-card .trend-title {
    font-size: 0.75rem;
}

/* ========================================
   INDICADOR DE CAMBIO
   ======================================== */
.trend-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.trend-change.up {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.trend-change.down {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.trend-change.stable {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.trend-change i {
    font-size: 0.65rem;
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.trend-card.loading .trend-value {
    background: linear-gradient(90deg,
            #e2e8f0 25%,
            #f1f5f9 50%,
            #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 2rem;
    width: 80px;
}

/* ========================================
   MODO OSCURO
   ======================================== */
body.theme-dark .trends-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body.theme-dark .trends-header h3 {
    color: #f1f5f9;
}

body.theme-dark .trend-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

body.theme-dark .trend-title {
    color: #94a3b8;
}

body.theme-dark .trend-unit {
    color: #64748b;
}

/* ========================================
   ESTILOS ADICIONALES PARA SPARKLINE
   ======================================== */
.sparkline-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.sparkline-container canvas {
    width: 100% !important;
    height: 100% !important;
}