/*
 * Charts page styles, linked in <head> via $GLOBALS['page_stylesheets'] (includes/header.php).
 *
 * Moved verbatim from an inline <style> block in charts.php on 2026-10-24. Emitted
 * after the content it styles, it let the browser paint that content without
 * these rules and then reflow it whenever the HTML arrived in more than one
 * piece: the desktop CLS class fixed for gig pages in #1782 (see gig.css).
 */

/* Charts Hero */
.charts-hero {
    padding: 60px 0 40px;
    text-align: center;
}

.charts-hero h1 {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    margin: 0 0 10px;
    position: relative;
    letter-spacing: 2px;
}

.hero-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin: 0 0 30px;
    position: relative;
}

/* Chart Tabs */
.chart-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
}

.chart-tab {
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 25px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.chart-tab:hover {
    background: rgba(255,255,255,0.25);
}

.chart-tab.active {
    background: white;
    color: #764ba2;
}

/* Layout */
.charts-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    padding: 40px 0;
}

/* Sidebar */
.charts-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
}

.filter-card h3 {
    font-size: 1rem;
    margin: 0 0 15px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.city-filters, .genre-filters {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.year-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.year-filter {
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-color);
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.year-filter:hover {
    background: rgba(255,255,255,0.15);
}

.year-filter.active {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    font-weight: 600;
}

.city-filter, .genre-filter {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.2s;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.city-filter:hover, .genre-filter:hover {
    background: rgba(255,255,255,0.1);
}

.city-filter.active, .genre-filter.active {
    background: var(--pink);
    color: white;
    font-weight: 600;
}

.chart-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 10px;
}

.chart-updated {
    font-size: 0.8rem !important;
    color: var(--pink) !important;
}

/* Main Chart */
.chart-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.chart-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.chart-location {
    padding: 5px 15px;
    background: var(--pink);
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.chart-year {
    padding: 5px 15px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Chart List */
.chart-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.chart-item:hover {
    background: var(--card-hover);
    transform: translateX(5px);
}

.chart-position {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-muted);
    flex-shrink: 0;
}

.chart-position.top-three {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    border-radius: 10px;
}

.chart-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.chart-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chart-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: rgba(255,255,255,0.5);
}

.chart-info {
    flex: 1;
    min-width: 0;
}

.chart-name {
    font-size: 1.1rem;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-genre {
    padding: 2px 8px;
    background: rgba(131, 56, 236, 0.2);
    color: var(--purple);
    border-radius: 10px;
    font-size: 0.75rem;
}

.chart-stats {
    display: flex;
    gap: 20px;
}

.chart-stats .stat {
    text-align: center;
}

.chart-stats .stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
}

.chart-stats .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.chart-stats .stat.new-entry .stat-value {
    color: var(--teal);
}

.chart-stats .stat.rising .stat-value {
    color: #4CAF50;
}

.chart-stats .stat.peak .stat-value {
    color: var(--yellow);
}

.chart-stats .stat.upcoming .stat-value {
    color: var(--pink);
}

.chart-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Genre Grid */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.genre-card {
    padding: 30px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.genre-card:hover {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    transform: translateY(-3px);
}

.genre-name {
    font-weight: 600;
    text-transform: capitalize;
}

/* Venue Chart */
.venue-item .chart-info h3 {
    font-size: 1rem;
}

.venue-item .capacity {
    padding: 2px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 0.75rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results .btn {
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .charts-layout {
        grid-template-columns: 1fr;
    }

    .charts-sidebar {
        order: 1;
    }

    .charts-main {
        order: 0;
    }

    .city-filters, .genre-filters {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .charts-hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 600px) {
    .chart-tabs {
        gap: 5px;
    }

    .chart-tab {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .chart-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .chart-stats {
        width: 100%;
        justify-content: flex-end;
        padding-left: 55px;
    }

    .chart-arrow {
        display: none;
    }
}

/* ===== Light Mode Overrides ===== */
[data-theme="light"] .charts-page { background: #f5f0ff; }
[data-theme="light"] .charts-hero h1 { color: #fff !important; }
[data-theme="light"] .charts-hero p { color: rgba(255,255,255,0.9) !important; }
[data-theme="light"] .chart-item { background: #fff !important; border-color: rgba(0,0,0,0.08) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important; }
[data-theme="light"] .chart-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important; }
[data-theme="light"] .chart-name { color: #1a1a2e !important; }
[data-theme="light"] .chart-info p,
[data-theme="light"] .chart-meta,
[data-theme="light"] .chart-location,
[data-theme="light"] .chart-year,
[data-theme="light"] .chart-genre { color: #555 !important; }
[data-theme="light"] .chart-stats { color: #666 !important; }
[data-theme="light"] .chart-position { color: #8338EC !important; }
[data-theme="light"] .chart-tab { color: #555 !important; background: #fff !important; border-color: rgba(0,0,0,0.08) !important; }
[data-theme="light"] .chart-tab.active { color: #fff !important; background: #8338EC !important; border-color: #8338EC !important; }
[data-theme="light"] .chart-header { color: #1a1a2e !important; }
[data-theme="light"] .chart-updated { color: #666 !important; }
[data-theme="light"] .charts-sidebar { background: #fff !important; border-color: rgba(0,0,0,0.08) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important; }
[data-theme="light"] .charts-sidebar h3 { color: #1a1a2e !important; }
[data-theme="light"] .city-filter,
[data-theme="light"] .city-filters a,
[data-theme="light"] .city-filters button { color: #555 !important; }
[data-theme="light"] .city-filters a.active,
[data-theme="light"] .city-filters button.active { color: #8338EC !important; }
[data-theme="light"] .chart-arrow { color: #666 !important; }
[data-theme="light"] .charts-page a { color: #8338EC !important; }
[data-theme="light"] .chart-image-placeholder { background: rgba(131,56,236,0.08) !important; }

/* Filter buttons that replaced <a> links — same look, no crawlable href */
.chart-tabs button.chart-tab,
.city-filters button.city-filter,
.year-filters button.year-filter,
.genre-filters button.genre-filter,
.genre-grid button.genre-card {
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}
