/* ========================================
   PROTECTED MUSIC PLAYER - COMPLETE CSS
   All fixes applied
   ======================================== */

:root {
    --primary-color: #1db954;
    --bg-dark: #121212;
    --bg-darker: #181818;
    --bg-light: #282828;
    --hover-bg: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --link-color: #4dabf7; /* BRIGHT BLUE for links */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
}

/* Links - BRIGHT COLOR */
a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========================================
   APP LAYOUT
   ======================================== */

.app-container {
    display: flex;
    height: 100vh;
}

/* ========================================
   SIDEBAR - FIXED WITH SCROLLING
   ======================================== */

.sidebar {
    width: 280px;
    background: var(--bg-darker);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.1);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.user-info {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.btn-logout {
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
}

.sidebar-nav {
    padding: 20px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.nav-item {
    display: block;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-light);
    text-decoration: none;
}

.nav-item.active {
    color: var(--text-primary);
    background: var(--bg-light);
}

/* Albums List - SCROLLABLE */
.albums-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
}

/* Custom scrollbar */
.albums-list::-webkit-scrollbar {
    width: 8px;
}

.albums-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.albums-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.albums-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.album-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background 0.2s;
}

.album-item:hover {
    background: var(--bg-light);
}

.album-item.active {
    background: var(--bg-light);
}

.album-item img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    margin-right: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.album-info {
    flex: 1;
    overflow: hidden;
}

.album-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}

.empty-state a {
    color: var(--link-color);
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    overflow-y: auto;
    padding-bottom: 100px;
    margin-left: 280px;
}

.now-playing-header {
    display: flex;
    align-items: center;
    padding: 40px;
    background: linear-gradient(180deg, #282828 0%, var(--bg-dark) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.now-playing-header img {
    width: 200px;
    height: 200px;
    min-width: 200px;
    min-height: 200px;
    border-radius: 8px;
    margin-right: 30px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    object-fit: cover;
    flex-shrink: 0;
}

.album-header-info {
    flex: 1;
}

.album-header-info h1 {
    font-size: 48px;
    margin-bottom: 10px;
    font-weight: 700;
}

.album-header-info p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Track List */
.track-list-container {
    padding: 30px 40px;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.track-item:hover {
    background: var(--bg-light);
}

.track-item.active {
    background: var(--bg-light);
    color: var(--primary-color);
}

.track-number {
    width: 40px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.track-details {
    flex: 1;
}

.track-name {
    font-size: 15px;
    margin-bottom: 4px;
}

.track-duration {
    width: 80px;
    text-align: right;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   PLAYER CONTROLS - NO COLORED BACKGROUNDS
   ======================================== */

.player-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-darker);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
    z-index: 50;
}

.track-info {
    margin-bottom: 8px;
}

.track-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.track-artist {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 8px;
}

.progress-bar {
    height: 5px;
    background: #404040;
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 5px;
    position: relative;
    transition: height 0.2s;
}

.progress-bar:hover {
    height: 7px;
}

.progress-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: 3px;
    width: 0;
    transition: width 0.1s;
    pointer-events: none;
    position: relative;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    left: 0;
}

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

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Control Buttons - CLEAN NO BACKGROUNDS */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.controls button {
    background: none !important; /* NO BACKGROUNDS */
    border: none;
    color: #b3b3b3;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.controls button:hover {
    color: white !important;
    background: rgba(255,255,255,0.1) !important; /* Subtle hover only */
    transform: scale(1.1);
}

.controls button:active {
    transform: scale(0.95);
}

/* Play/Pause - Slightly Larger */
.btn-play-pause {
    width: 48px !important;
    height: 48px !important;
    font-size: 28px !important;
    color: white !important;
}

.btn-play-pause:hover {
    transform: scale(1.15) !important;
}

/* Loop button when active */
#btnLoop[style*="--primary-color"] {
    color: var(--primary-color) !important;
}

/* Equalizer button when active */
.btn-equalizer.active {
    color: var(--primary-color) !important;
}

/* Volume */
.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* ========================================
   EQUALIZER PANEL
   ======================================== */

.equalizer-panel {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: var(--bg-darker);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    z-index: 1000;
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.equalizer-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.equalizer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.equalizer-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-eq {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-eq:hover {
    background: rgba(255,255,255,0.2);
}

.preset-section {
    margin-bottom: 20px;
}

.preset-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.equalizer-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    padding: 8px 14px;
    background: var(--bg-light);
    border: 1px solid transparent;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: Arial, sans-serif;
}

.preset-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.preset-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.eq-save-section {
    margin-bottom: 24px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.preset-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
}

.preset-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-save-preset {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    font-family: Arial, sans-serif;
}

.btn-save-preset:hover {
    background: #1ed760;
}

.custom-preset {
    position: relative;
    display: inline-flex;
}

.btn-delete-preset {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #dc3545;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.custom-preset:hover .btn-delete-preset {
    display: flex;
}

.equalizer-sliders {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 24px;
    padding: 20px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    min-height: 180px;
}

.eq-band {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.eq-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 6px;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.eq-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.eq-label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}

.equalizer-visual {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100px;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    gap: 4px;
}

.eq-bar {
    flex: 1;
    height: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.eq-bar-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, var(--primary-color), #1ed760);
    transition: height 0.05s ease-out;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
}

/* ========================================
   STORE PAGE
   ======================================== */

.store-container {
    padding: 40px;
}

.store-container h1 {
    font-size: 36px;
    margin-bottom: 30px;
}

.store-filters {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.filter-select {
    padding: 8px 12px;
    background: var(--bg-darker);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.grid-size-selector {
    margin-left: auto;
    display: flex;
    gap: 5px;
    align-items: center;
}

.grid-btn {
    padding: 8px 12px;
    background: var(--bg-darker);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    font-family: Arial, sans-serif;
}

.grid-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.grid-btn:hover {
    border-color: var(--primary-color);
}

.results-count {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Store Grid */
.store-grid {
    display: grid;
    gap: 24px;
}

.store-grid.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.store-grid.grid-5 {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.store-grid.grid-6 {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.store-item {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    transition: background 0.2s;
    cursor: pointer;
}

.store-item:hover {
    background: var(--hover-bg);
}

.store-item-cover {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 16px;
}

.store-item-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.owned-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.store-item-info {
    text-align: left;
}

.store-item-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-item-artist {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.store-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-primary, .btn-secondary {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    font-family: Arial, sans-serif;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1ed760;
    transform: scale(1.05);
    text-decoration: none;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
}

.btn-small {
    padding: 6px 16px;
    font-size: 12px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .now-playing-header img {
        width: 150px;
        height: 150px;
        min-width: 150px;
        min-height: 150px;
    }
    
    .album-header-info h1 {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .now-playing-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .now-playing-header img {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .album-header-info h1 {
        font-size: 28px;
    }
    
    .store-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    }
    
    .grid-size-selector {
        display: none;
    }
    
    .equalizer-panel {
        bottom: 90px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .controls {
        gap: 4px;
    }
    
    .controls button {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .btn-play-pause {
        width: 44px !important;
        height: 44px !important;
        font-size: 24px !important;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .store-container {
        padding: 20px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}