@charset "UTF-8";

:root {
    --bg-color: #121212;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #1db954;
    --accent-glow: rgba(29, 185, 84, 0.4);
    --glass-blur: 10px;
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Glow Effect */
.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(29, 185, 84, 0.08) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #fff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.back-btn {
    text-decoration: none;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--card-border);
}

.back-btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
    border-color: var(--accent-color);
}

/* Cards Common Styles */
.card,
.now-playing-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover,
.now-playing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Now Playing */
.now-playing-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.np-img {
    width: 150px;
    height: 150px;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    object-fit: cover;
}

.np-info {
    flex: 1;
}

.np-info h2 {
    color: var(--accent-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.np-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.np-artist {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.np-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.np-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    width: 0%;
    transition: width 1s linear;
    box-shadow: 0 0 10px var(--accent-glow);
}

.np-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Grid Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.card h2 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Term Selector */
.term-selector {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 2rem;
    display: flex;
    gap: 4px;
}

.term-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 1.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.term-btn:hover {
    color: var(--text-primary);
}

.term-btn.active {
    background: var(--card-border);
    color: var(--text-primary);
}

/* Lists */
.item-list {
    list-style: none;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.item-list::-webkit-scrollbar {
    width: 6px;
}

.item-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.item-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.item-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 0.8rem;
    transition: background 0.2s ease;
    margin-bottom: 0.5rem;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.art-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.info {
    flex: 1;
    min-width: 0;
}

.title {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 0.2rem;
}

.artist {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.genre-tag {
    display: inline-block;
    background: rgba(29, 185, 84, 0.1);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-top: 4px;
    margin-right: 4px;
    border: 1px solid rgba(29, 185, 84, 0.2);
}

.played-at {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 1rem;
    white-space: nowrap;
    opacity: 0.7;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .now-playing-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .np-img {
        width: 200px;
        height: 200px;
    }

    .card h2 {
        flex-direction: column;
        align-items: flex-start;
    }

    .term-selector {
        width: 100%;
        justify-content: space-between;
    }

    .term-btn {
        flex: 1;
        text-align: center;
        padding: 0.6rem;
    }
}