/* ===== CSS VARIABLES ===== */
:root {
    --bg-dark: #0a0a0b;
    --bg-card: #111113;
    --bg-card-hover: #18181b;
    --accent: #c8ff00;
    --accent-dim: #8aad00;
    --text-primary: #e8e8ec;
    --text-secondary: #6b6b76;
    --text-muted: #3a3a42;
    --border: #1e1e22;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== NOISE OVERLAY ===== */
.noise-overlay {
    position: fixed;
    inset: 0;
    opacity: 0.012;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1000;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ===== CONTAINER ===== */
.player-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    margin-bottom: 24px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: visible;
}

.logo-img {
    height: 120px;
    width: auto;
    margin: -40px 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    flex: 1;
}

/* ===== PLAYER MAIN ===== */
.player-main {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ===== VISUALIZER ===== */
.visualizer-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

#visualizer {
    width: 100%;
    height: 100%;
    display: block;
}

.now-playing {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(10, 10, 11, 0.95) 0%, transparent 100%);
    text-align: center;
}

.song-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.song-artist {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.8;
}

/* ===== VISUALIZER STYLE CONTROLS ===== */
.visualizer-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.visualizer-style-btn {
    width: 36px;
    height: 36px;
    background: rgba(10, 10, 11, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.visualizer-style-btn:hover {
    background: var(--bg-card-hover);
    border-color: #2a2a30;
    transform: translateY(-2px);
    color: var(--text-primary);
}

.visualizer-style-btn.active {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.visualizer-style-btn svg {
    width: 18px;
    height: 18px;
}

.visualizer-style-btn .hidden {
    display: none;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(10, 10, 11, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    z-index: 10;
}

.fullscreen-btn:hover {
    background: var(--bg-card-hover);
    border-color: #2a2a30;
    transform: translateY(-2px);
    color: var(--text-primary);
}

.fullscreen-btn .hidden {
    display: none;
}

/* Fullscreen styles */
.visualizer-container:fullscreen {
    background: var(--bg-dark);
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0;
    border: none;
}

.visualizer-container:fullscreen #visualizer {
    width: 100% !important;
    height: 100% !important;
}

.visualizer-container:fullscreen .visualizer-controls {
    top: 20px;
    right: 20px;
}

.visualizer-container:fullscreen .fullscreen-btn {
    bottom: 20px;
    right: 20px;
}

.visualizer-container:fullscreen .now-playing {
    padding: 50px;
}

.visualizer-container:fullscreen .song-title {
    font-size: 36px;
}

.visualizer-container:fullscreen .song-artist {
    font-size: 13px;
    letter-spacing: 3px;
}

/* ===== CONTROLS ===== */
.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.control-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.control-btn:hover {
    background: var(--bg-card-hover);
    border-color: #2a2a30;
    transform: translateY(-2px);
}

.control-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

.play-btn {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border: none;
    color: var(--bg-dark);
}

.play-btn:hover {
    transform: scale(1.08);
    background: #d4ff33;
}

.play-btn svg {
    transition: opacity 0.2s ease;
}

.play-btn .hidden {
    display: none;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-current,
.time-duration {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    border: none;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(200, 255, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

/* ===== VOLUME ===== */
.volume-container {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.volume-btn {
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
}

.volume-btn:hover {
    color: var(--accent);
}

.volume-btn .hidden {
    display: none;
}

.volume-slider {
    width: 120px;
    position: relative;
}

.volume-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: relative;
    border: none;
}

.volume-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 70%;
}

#volumeRange {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    opacity: 0;
    cursor: pointer;
}

/* ===== PLAYLIST ===== */
.playlist {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

/* TABS HEADER */
.tabs-header {
    display: flex;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    border-radius: 8px 8px 0 0;
}

.tab {
    flex: 1;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab:hover {
    background: rgba(200, 255, 0, 0.03);
    color: var(--text-secondary);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

.tab svg {
    width: 14px;
    height: 14px;
}

/* SEARCH CONTAINER */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 12px 12px 12px;
}

.search-container svg {
    position: absolute;
    left: 24px;
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: var(--accent);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

/* TAB CONTENT */
.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ARTIST/ALBUM LIST ITEMS */
.list-item {
    padding: 14px;
    margin-bottom: 6px;
    background: var(--bg-dark);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.list-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
    transform: translateX(4px);
}

.list-item.active {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.list-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-item-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.list-item.active .list-item-name {
    color: var(--accent);
}

.list-item-count {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: transparent;
    padding: 0;
}

.list-item.active .list-item-count {
    color: var(--accent-dim);
    background: transparent;
}

/* SCROLLBAR FOR TAB CONTENT */
.tab-content::-webkit-scrollbar {
    width: 4px;
}

.tab-content::-webkit-scrollbar-track {
    background: transparent;
}

.tab-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dim);
}

.playlist-items {
    flex: 1;
    overflow-y: auto;
    margin: 0 -8px;
    padding: 0 8px;
}

.playlist-item {
    padding: 12px;
    margin-bottom: 4px;
    background: var(--bg-dark);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.playlist-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
    transform: translateX(4px);
}

.playlist-item.active {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.playlist-item-number {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 25px;
    font-weight: 400;
}

.playlist-item.active .playlist-item-number {
    color: var(--accent);
}

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

.playlist-item-title {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.playlist-item.active .playlist-item-title {
    color: var(--accent);
}

.playlist-item-artist {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 24px;
    text-align: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.footer p {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .playlist {
        max-height: min(400px, 45vh);
    }
}

@media (max-width: 768px) {
    .player-container {
        padding: 12px;
    }

    .player-main {
        padding: 20px;
    }

    .visualizer-container {
        height: 200px;
    }

    .song-title {
        font-size: 18px;
    }

    .main-controls {
        gap: 10px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    .play-btn {
        width: 56px;
        height: 56px;
    }

    .logo h1 {
        font-size: 22px;
    }

    .playlist {
        padding: 16px;
    }

    .visualizer-controls {
        top: 10px;
        right: 10px;
        gap: 6px;
    }

    .visualizer-style-btn {
        width: 32px;
        height: 32px;
    }

    .visualizer-style-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .volume-container {
        flex-direction: column;
        gap: 10px;
    }

    .volume-slider {
        width: 100%;
    }

    .progress-container {
        flex-wrap: wrap;
    }

    .time-current,
    .time-duration {
        font-size: 10px;
    }

    .player-main {
        padding: 16px;
        gap: 16px;
    }

    .visualizer-container {
        height: 160px;
    }

    .song-title {
        font-size: 16px;
    }

    .control-btn {
        width: 38px;
        height: 38px;
    }

    .play-btn {
        width: 52px;
        height: 52px;
    }

    .logo-img {
        height: 65px;
        margin: -20px 0;
    }

    .playlist {
        max-height: 300px;
    }
}

@media (max-width: 360px) {
    .player-container {
        padding: 8px;
    }

    .player-main {
        padding: 12px;
        gap: 12px;
    }

    .visualizer-container {
        height: 130px;
    }

    .song-title {
        font-size: 14px;
    }

    .main-controls {
        gap: 6px;
    }

    .control-btn {
        width: 34px;
        height: 34px;
    }

    .play-btn {
        width: 46px;
        height: 46px;
    }

    .logo-img {
        height: 55px;
        margin: -16px 0;
    }

    .playlist {
        max-height: 250px;
        padding: 12px;
    }

    .visualizer-style-btn {
        width: 28px;
        height: 28px;
    }

    .visualizer-style-btn svg {
        width: 13px;
        height: 13px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.65;
    }
}

.playing .play-btn {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.playlist-item {
    animation: slideIn 0.3s ease-out;
}
