/* Charts Section */
#Charts {
    min-height: 95vh;
    animation: fadeIn 0.8s ease-out;
}

/* Stats Header */
.stats-header {
    text-align: center;
    margin-bottom: 50px;
}

.stats-header h2 {
    font-size: 3.5em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.stats-subtitle {
    color: var(--text-muted);
    font-size: 1.1em;
    margin: 0;
}

#streams {
    margin-bottom: 80px;
}

/* Chart Container - 2 columns for even distribution */
.chart-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    max-width: 100%;
}

/* Chart Cards */
.chart-card_charts {
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.9) 0%, rgba(15, 15, 22, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.6s ease-out backwards;
    position: relative;
}

/* Animated gradient border */
.chart-card_charts::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* Inner glow effect */
.chart-card_charts::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.chart-card_charts:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.15);
}

.chart-card_charts:hover::before {
    opacity: 1;
}

.chart-card_charts:hover::after {
    opacity: 1;
}

/* Platform-specific card styles */
#youtube_charts {
    border-color: rgba(255, 0, 0, 0.15);
    background: linear-gradient(145deg, rgba(255, 0, 0, 0.08) 0%, rgba(15, 15, 22, 0.95) 50%);
}
#youtube_charts::after {
    background: radial-gradient(ellipse at 20% 20%, rgba(255, 0, 0, 0.2) 0%, transparent 50%);
}
#youtube_charts:hover {
    border-color: rgba(255, 0, 0, 0.4);
    box-shadow: 
        0 25px 80px rgba(255, 0, 0, 0.2),
        0 0 40px rgba(255, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 0, 0, 0.1);
}

#instagram_charts {
    border-color: rgba(193, 53, 132, 0.15);
    background: linear-gradient(145deg, rgba(193, 53, 132, 0.08) 0%, rgba(247, 119, 55, 0.05) 30%, rgba(15, 15, 22, 0.95) 60%);
}
#instagram_charts::after {
    background: radial-gradient(ellipse at 20% 20%, rgba(193, 53, 132, 0.2) 0%, rgba(247, 119, 55, 0.1) 30%, transparent 50%);
}
#instagram_charts:hover {
    border-color: rgba(193, 53, 132, 0.4);
    box-shadow: 
        0 25px 80px rgba(193, 53, 132, 0.2),
        0 0 40px rgba(193, 53, 132, 0.1),
        inset 0 1px 0 rgba(193, 53, 132, 0.1);
}

#tiktok_charts {
    border-color: rgba(254, 44, 85, 0.15);
    background: linear-gradient(145deg, rgba(254, 44, 85, 0.08) 0%, rgba(0, 242, 234, 0.03) 30%, rgba(15, 15, 22, 0.95) 60%);
}
#tiktok_charts::after {
    background: radial-gradient(ellipse at 20% 20%, rgba(254, 44, 85, 0.2) 0%, rgba(0, 242, 234, 0.1) 40%, transparent 50%);
}
#tiktok_charts:hover {
    border-color: rgba(254, 44, 85, 0.4);
    box-shadow: 
        0 25px 80px rgba(254, 44, 85, 0.2),
        0 0 40px rgba(254, 44, 85, 0.1),
        inset 0 1px 0 rgba(254, 44, 85, 0.1);
}

#twitter_charts {
    border-color: rgba(29, 161, 242, 0.15);
    background: linear-gradient(145deg, rgba(29, 161, 242, 0.08) 0%, rgba(15, 15, 22, 0.95) 50%);
}
#twitter_charts::after {
    background: radial-gradient(ellipse at 20% 20%, rgba(29, 161, 242, 0.2) 0%, transparent 50%);
}
#twitter_charts:hover {
    border-color: rgba(29, 161, 242, 0.4);
    box-shadow: 
        0 25px 80px rgba(29, 161, 242, 0.2),
        0 0 40px rgba(29, 161, 242, 0.1),
        inset 0 1px 0 rgba(29, 161, 242, 0.1);
}

#spotify_charts {
    border-color: rgba(29, 185, 84, 0.15);
    background: linear-gradient(145deg, rgba(29, 185, 84, 0.08) 0%, rgba(15, 15, 22, 0.95) 50%);
}
#spotify_charts::after {
    background: radial-gradient(ellipse at 20% 20%, rgba(29, 185, 84, 0.2) 0%, transparent 50%);
}
#spotify_charts:hover {
    border-color: rgba(29, 185, 84, 0.4);
    box-shadow: 
        0 25px 80px rgba(29, 185, 84, 0.2),
        0 0 40px rgba(29, 185, 84, 0.1),
        inset 0 1px 0 rgba(29, 185, 84, 0.1);
}

/* Platform Header */
.platform-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 25px;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.platform-header i {
    font-size: 1.5em;
    filter: drop-shadow(0 0 8px currentColor);
}

/* Stats List - Simple Clean Layout */
.stats-list {
    padding: 8px 0;
    position: relative;
    z-index: 1;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row:hover {
    background: rgba(255, 255, 255, 0.03);
    padding-left: 30px;
}

.stat-row .stat-name {
    color: var(--text-secondary);
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.stat-row:hover .stat-name {
    color: var(--text-primary);
}

.stat-number {
    color: var(--text-primary);
    font-size: 1.15em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* Streams Container */
div#streamsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

section#streams {
    min-height: 54vh;
    padding: 40px 0;
}

#streams h1 {
    font-size: 2.8em;
    text-align: center;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
}

#streams h1 i {
    color: var(--highlight-twitch);
    margin-right: 15px;
    animation: pulse 2s infinite;
}

#streams .streams-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1em;
    margin-bottom: 40px;
}

/* Stream Cards - Modern Design */
.stream-card {
    position: relative;
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.95) 0%, rgba(15, 15, 22, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(145, 70, 255, 0.15);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: slideUp 0.6s ease-out backwards;
}

.stream-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top left, rgba(145, 70, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.stream-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--highlight-twitch);
    box-shadow: 
        0 25px 60px rgba(145, 70, 255, 0.25),
        0 0 40px rgba(145, 70, 255, 0.1),
        inset 0 1px 0 rgba(145, 70, 255, 0.2);
}

.stream-card:hover::before {
    opacity: 1;
}

/* Thumbnail Container */
.stream-card .thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.stream-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stream-card:hover img {
    transform: scale(1.08);
}

/* Live Badge */
.stream-card .live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    z-index: 2;
}

.stream-card .live-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Viewer Count on Thumbnail */
.stream-card .viewer-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2;
}

.stream-card .viewer-badge i {
    color: #ef4444;
    font-size: 0.8rem;
}

/* Game Category Badge */
.stream-card .game-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(145, 70, 255, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

/* Stream Info */
.stream-info {
    padding: 18px 20px;
    position: relative;
    z-index: 1;
}

.stream-info h2 {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stream-info h2 .streamer-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--highlight-twitch);
}

.stream-info h3 {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags - Updated Design */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags span {
    background: rgba(145, 70, 255, 0.12);
    color: #b794f6;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(145, 70, 255, 0.2);
    transition: all 0.3s ease;
}

.stream-card:hover .tags span {
    background: rgba(145, 70, 255, 0.25);
    border-color: rgba(145, 70, 255, 0.4);
    color: #d4bfff;
}

/* Old Viewers (hidden - replaced by badge) */
.viewers {
    display: none;
}

/* Artist Box */
.artist_box {
    display: flex;
    padding: 16px 20px;
    background: var(--bg-glass);
    border-radius: 14px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.artist_box:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    cursor: pointer;
    transform: translateX(5px);
}

.chart-card_charts a {
    color: var(--text-primary);
    text-decoration: none;
}

img.thumbnail_charts {
    width: 35px !important;
    height: 35px !important;
    border-radius: 8px;
    object-fit: cover;
}

.views_charts, .name_charts {
    margin-top: 0;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.name_charts {
    color: var(--text-primary);
    font-weight: 500;
}

/* Load More - Subtle Style */
p.loadMore {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 60px;
}

.loadMore a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.loadMore a:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.loadMore a i {
    font-size: 0.9em;
    transition: transform 0.3s ease;
}

.loadMore a:hover i {
    transform: rotate(90deg);
}

/* Chart Thumbnails */
.placement_charts {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 30px;
}

.thumbnail_charts {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.chart-card_charts .placement_charts,
.chart-card_charts .thumbnail_charts,
.chart-card_charts .views_charts {
    width: 60px;
}

/* Media Queries */
@media screen and (max-width: 1200px) {
    .chart-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    div#streamsContainer {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .stats-header h2 {
        font-size: 2.8em;
    }
}

@media screen and (max-width: 768px) {
    .chart-container {
        grid-template-columns: 1fr;
    }

    .artist_box {
        font-size: 0.9em;
        padding: 12px 15px;
    }

    .stats-header h2 {
        font-size: 2em;
    }
    
    .stats-subtitle {
        font-size: 0.95em;
    }
    
    .stats-header {
        margin-bottom: 30px;
    }
    
    .platform-header {
        padding: 16px 20px;
        font-size: 1.15em;
    }
    
    .stat-row {
        padding: 12px 20px;
    }

    /* Twitch Stream Cards - Mobile */
    div#streamsContainer {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stream-card {
        border-radius: 16px;
    }
    
    .stream-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .stream-info {
        padding: 15px;
    }
    
    .stream-info h2 {
        font-size: 1.05rem;
    }
    
    .stream-info h3 {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
    
    .stream-card .live-badge {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    
    .stream-card .viewer-badge {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .stream-card .game-badge {
        padding: 5px 10px;
        font-size: 0.7rem;
        max-width: 120px;
    }
    
    .tags span {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    
    #streams h1 {
        font-size: 2em;
    }
    
    #streams .streams-subtitle {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }
    
    .loadMore a {
        padding: 12px 24px;
        font-size: 0.95em;
    }
}

@media screen and (max-width: 480px) {
    div#streamsContainer {
        gap: 15px;
    }
    
    .stream-card .thumbnail-container {
        aspect-ratio: 16 / 9;
    }
    
    .stream-info h3 {
        -webkit-line-clamp: 1;
    }
    
    .stream-card .game-badge {
        display: none;
    }
    
    .tags span {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
}
