:root {
    --bg-dark: #0a0a0c;
    --bg-panel: rgba(255, 255, 255, 0.03);
    --bg-panel-hover: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.05);

    --accent: #5e35b1;
    --accent-glow: rgba(94, 53, 177, 0.5);
    --accent-secondary: #00e5ff;

    --text-main: #ffffff;
    --text-muted: #8b8b9d;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --player-height: 90px;
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    padding-bottom: calc(var(--player-height) + 30px);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
}

.brand {
    margin-bottom: 3rem;
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand p {
    color: var(--accent-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.2rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: var(--bg-panel);
    color: var(--text-main);
}

.nav-item.active {
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--accent-secondary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--accent-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 4rem;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--bg-panel-hover);
    border-radius: 4px;
}

/* Hero */
.hero {
    position: relative;
    padding: 4rem 3rem;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(20, 20, 25, 0.8), rgba(10, 10, 12, 0.9));
    border: 1px solid var(--border-glass);
    margin-bottom: 3rem;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* Filters */
.filters-section {
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    padding: 1rem 0;
    z-index: 5;
}

.tags-container {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--bg-panel-hover);
    color: var(--text-main);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--text-main);
    color: var(--bg-dark);
    border-color: var(--text-main);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Tracks List */
.tracks-section {
    width: 100%;
}

.tracks-header {
    display: grid;
    grid-template-columns: 50px 2fr 1.5fr 80px;
    gap: 1rem;
    padding: 0 1rem 1rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.track-row {
    display: grid;
    grid-template-columns: 50px 2fr 1.5fr 80px;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.track-row:hover {
    background: var(--bg-panel);
    border-color: var(--border-glass);
}

.track-row.playing {
    background: rgba(94, 53, 177, 0.1);
    border-color: var(--accent);
}

.track-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-panel-hover);
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.track-row:hover .track-play-btn {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.track-row.playing .track-play-btn {
    background: var(--accent-secondary);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.track-title {
    font-weight: 600;
    font-size: 1rem;
}

.track-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.track-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.track-duration {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Floating Player */
.player-bar {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 100%;
    height: var(--player-height);
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(30px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 300px;
}

.player-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bg-panel-hover), var(--accent-glow));
}

.player-meta h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.player-meta p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-controls-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.ctrl-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover {
    color: var(--text-main);
}

.play-pause-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--bg-dark);
}

.play-pause-btn:hover {
    transform: scale(1.05);
    background: var(--accent-secondary);
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-panel);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent-secondary);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.player-extra {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 200px;
    justify-content: flex-end;
    color: var(--text-muted);
}

.volume-slider-container {
    width: 100px;
    height: 6px;
    background: var(--bg-panel);
    border-radius: 3px;
    position: relative;
    display: flex;
    align-items: center;
}

#volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 700px;
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.modal-cover {
    width: 250px;
    height: 250px;
    border-radius: 16px;
    background: var(--bg-panel);
    flex-shrink: 0;
}

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#modal-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.modal-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.modal-desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
    flex: 1;
}

.modal-links {
    display: flex;
    gap: 1rem;
}

.glass-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

#link-spotify {
    border-color: rgba(30, 215, 96, 0.5);
    color: #1DB954;
}

#link-spotify:hover {
    background: rgba(30, 215, 96, 0.1);
    box-shadow: 0 4px 15px rgba(30, 215, 96, 0.2);
}

#link-apple {
    border-color: rgba(250, 36, 60, 0.5);
    color: #fa243c;
}

#link-apple:hover {
    background: rgba(250, 36, 60, 0.1);
    box-shadow: 0 4px 15px rgba(250, 36, 60, 0.2);
}

/* Make player cover clickable */
.player-cover {
    cursor: pointer;
    transition: transform 0.2s;
}

.player-cover:hover {
    transform: scale(1.05);
}

/* Legal Footer */
.legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    z-index: 1000;
    border-top: 1px solid var(--border-glass);
}

.legal-footer p {
    margin: 0;
    padding: 0;
}

.legal-footer strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Responsive Design for Mobile Elements (Max Width 768px) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        padding-bottom: calc(70px + 30px + 20px); /* player-height(70) + footer(30) + extra */
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.8rem 1.2rem;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }

    .brand {
        margin-bottom: 0;
    }

    .brand h1 {
        font-size: 1.2rem;
    }

    .nav-menu {
        flex-direction: row;
        gap: 1rem;
    }

    .nav-item {
        padding: 0.5rem;
    }

    .nav-item span {
        display: none;
        /* Hide text, only show icons */
    }
    
    .references-section {
        display: none;
        /* Hide references section so it doesn't break the row layout */
    }

    .nav-item.active::before {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        transform: none;
        border-radius: 4px 4px 0 0;
    }

    .main-content {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h2 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Horizontal scrolling for tags */
    .filters-section {
        padding: 0.5rem 0;
    }
    
    .tags-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }
    
    .tags-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari and Opera */
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Hide the grid header */
    .tracks-header {
        display: none;
    }

    /* Simplify the track row for mobile */
    .track-row {
        grid-template-columns: 40px 1fr 40px;
        padding: 0.8rem 0.5rem;
        gap: 0.5rem;
    }
    
    .track-title {
        font-size: 0.9rem;
    }

    .track-tags {
        display: none;
    }

    /* Mobile Player */
    .player-bar {
        flex-direction: row;
        height: 70px;
        padding: 0 1rem;
        gap: 0.8rem;
        align-items: center;
        justify-content: space-between;
        bottom: 30px; /* stay above footer */
    }

    .player-info {
        width: auto;
        max-width: 50%;
        flex: 1;
        gap: 0.8rem;
    }

    .player-cover {
        width: 44px;
        height: 44px;
    }
    
    .player-meta h4 {
        font-size: 0.9rem;
        margin-bottom: 0.1rem;
    }

    .player-controls-container {
        width: auto;
        max-width: none;
        flex: 0;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
    }
    
    .player-controls {
        margin-bottom: 0;
        gap: 1rem;
    }

    .player-progress {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 2px;
        gap: 0;
    }
    
    #time-current, #time-total {
        display: none;
    }
    
    .progress-bar-container {
        height: 2px;
        border-radius: 0;
    }
    
    .progress-bar {
        border-radius: 0;
    }
    
    .play-pause-btn {
        width: 40px;
        height: 40px;
    }

    .player-extra {
        display: none;
        /* Hide volume UI on mobile to save space */
    }

    /* Admin Overrides */
    .admin-container {
        padding: 1rem;
        margin: 1rem auto;
    }
}