/* ranking.css - Responsive styles for Ranking pages */

.hero-ranking {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 0 0 32px 32px;
    margin-bottom: 40px;
}

.hero-ranking h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    margin-bottom: 16px;
    color: #f8fafc;
    line-height: 1.2;
}

.hero-ranking p {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 700px;
    margin: 0 auto 24px auto;
    line-height: 1.6;
}

.rank-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.9rem;
    color: #e2e8f0;
}

/* Fuel Selector Bar */
.fuel-selector-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: -30px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
    padding: 0 10px;
}

.fuel-tab {
    background: white;
    padding: 10px 20px;
    border-radius: 99px;
    text-decoration: none;
    color: #475569;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.fuel-tab:hover {
    transform: translateY(-2px);
}

.fuel-tab.active {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

/* Summary Cards */
.summary-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.summary-card.gold {
    border-top: 4px solid #eab308;
}

.summary-card.red {
    border-top: 4px solid #ef4444;
}

.summary-card.blue {
    border-top: 4px solid #3b82f6;
}

.sc-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sc-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.sc-price {
    font-size: 2rem;
    font-weight: 900;
    color: #0f172a;
}

.sc-sub {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 8px;
}

/* Text Block */
.summary-text-block {
    background: #f8fafc;
    padding: 24px;
    border-left: 4px solid #3b82f6;
    color: #334155;
    margin-bottom: 40px;
    border-radius: 0 12px 12px 0;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Table Section */
.ranking-table-section {
    margin-bottom: 60px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #3b82f6;
    margin-top: 8px;
    border-radius: 2px;
}

.table-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    border: 1px solid #e2e8f0;
}

.rank-main-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.rank-main-table th {
    background: #f8fafc;
    padding: 18px 20px;
    text-align: left;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.rank-main-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.rank-main-table tr:hover td {
    background: #f8fafc;
}

.pos-badge {
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #64748b;
    font-size: 0.95rem;
}

.pos-badge.top-3 {
    background: transparent;
    font-size: 1.6rem;
}

.prov-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.05rem;
}

/* Heatmap Wrapper for Ranking */
.heatmap-wrapper-rank {
    background: #fff;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.05);
}

.heatmap-legend-rank {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
}

.legend-gradient-rank {
    width: 120px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #16a34a, #84cc16, #fbbf24, #ef4444);
}

.spain-heatmap-rank {
    width: 100%;
    height: 500px;
    position: relative;
}

@media (max-width: 768px) {
    .spain-heatmap-rank {
        height: 350px;
    }
}

/* Stats */
.agg-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 60px;
}

.stat-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

.stat-box h3 {
    color: #94a3b8;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    margin-bottom: 20px;
}

.big-num {
    font-size: clamp(2.5rem, 8vw, 3.8rem);
    font-weight: 900;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1;
}

/* FAQ */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.faq-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.faq-card:hover {
    transform: translateY(-3px);
    border-color: #cbd5e1;
}

.faq-card h4 {
    color: #0f172a;
    margin-bottom: 12px;
    font-size: 1.15rem;
    font-weight: 800;
}

/* UI Helpers */
.text-green {
    color: #16a34a;
    font-weight: 800;
}

.text-muted {
    color: #64748b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .hero-ranking {
        padding: 40px 15px;
        border-radius: 0 0 24px 24px;
    }

    .agg-stats {
        grid-template-columns: 1fr;
    }

    .summary-text-block {
        font-size: 1rem;
        padding: 18px;
    }

    .ranking-table-section .section-title {
        font-size: 1.5rem;
    }

    .fuel-selector-bar {
        margin-top: -20px;
        margin-bottom: 30px;
    }

    .fuel-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}