/* ============================================
   NOORUU OFFICIAL — Spotify-Inspired Player
   ============================================ */

/* ---------- Page Layout ---------- */
.music-page-body {
    padding-bottom: 80px;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

/* ---------- Top Bar ---------- */
.music-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Mobile hamburger for sidebar */
.mobile-browse-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.mobile-browse-btn span {
    width: 20px;
    height: 2px;
    background: var(--white);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-browse-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-browse-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-browse-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile sidebar overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.topbar-logo img {
    height: 42px;
    width: auto;
}

.topbar-search {
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 0 16px;
    transition: all 0.3s ease;
}

.topbar-search:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(212, 160, 23, 0.3);
}

.topbar-search svg {
    width: 18px;
    height: 18px;
    stroke: var(--gray);
    flex-shrink: 0;
}

.topbar-search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 10px 0;
    outline: none;
    cursor: text;
}

.topbar-search input::placeholder {
    color: var(--gray);
}

.topbar-nav {
    display: flex;
    gap: 20px;
}

.topbar-nav a {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s;
    letter-spacing: 0.5px;
}

.topbar-nav a:hover,
.topbar-nav a.active {
    color: var(--white);
}

/* ---------- Main Layout: Sidebar + Content ---------- */
.music-layout {
    display: flex;
    height: calc(100vh - 64px - 72px);
    height: calc(100dvh - 64px - 72px);
    margin-top: 64px;
    position: relative;
    z-index: 2;
}

/* ---------- Sidebar ---------- */
.music-sidebar {
    width: 240px;
    background: rgba(10, 10, 10, 0.6);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    padding: 20px 0;
    overflow-y: auto;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-header {
    padding: 0 20px 16px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--white);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: rgba(212, 160, 23, 0.2);
}

.sidebar-link svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar-link:hover,
.sidebar-link:active {
    color: var(--gold-light);
    background: rgba(212, 160, 23, 0.08);
}

.sidebar-link.active {
    color: var(--gold);
    background: rgba(212, 160, 23, 0.12);
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 16px 20px;
}

.sidebar-section {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    padding: 4px 12px 10px;
}

.sidebar-tag {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-left: 3px solid transparent;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: rgba(212, 160, 23, 0.2);
}

.sidebar-tag:hover,
.sidebar-tag:active {
    color: var(--gold-light);
    background: rgba(212, 160, 23, 0.08);
    border-left-color: var(--gold);
}

.sidebar-tag.active {
    color: var(--gold);
    background: rgba(212, 160, 23, 0.12);
    border-left-color: var(--gold);
    font-weight: 500;
}

/* ---------- Content Area ---------- */
.music-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px 40px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* ---------- Section Rows (Spotify-style horizontal rows) ---------- */
.section-row {
    margin-bottom: 40px;
}

.row-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}

.row-header h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
}

.row-count {
    font-size: 12px;
    color: var(--gray);
}

.row-show-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    letter-spacing: 1px;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.row-show-all:hover {
    color: var(--white);
}

/* Horizontal scroll row */
.tracks-row {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.tracks-row::-webkit-scrollbar {
    display: none;
}

/* Grid (for search results) */
.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 18px;
}

/* ---------- Track Card ---------- */
.track-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    min-width: 170px;
    max-width: 210px;
    flex-shrink: 0;
}

.tracks-grid .track-card {
    max-width: none;
}

.track-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.track-card.playing {
    border-color: rgba(212, 160, 23, 0.25);
    background: rgba(212, 160, 23, 0.05);
}

.track-art-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #111;
}

.track-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.track-card:hover .track-art {
    transform: scale(1.04);
}

.track-play-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.track-card:hover .track-play-overlay,
.track-card.playing .track-play-overlay {
    opacity: 1;
    transform: translateY(0);
}

.track-play-overlay svg {
    width: 16px;
    height: 16px;
    fill: var(--dark);
    margin-left: 2px;
}

.track-card.playing .track-play-overlay {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 16px rgba(212, 160, 23, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(212, 160, 23, 0.6); }
}

.track-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 11px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading & Empty */
.content-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 100px 0;
    color: var(--gray);
    font-size: 13px;
}

.loader {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(212, 160, 23, 0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--gray);
}

.no-results h3 {
    font-family: var(--font-display);
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--white);
}

/* ---------- Fixed Bottom Player Bar ---------- */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(212, 160, 23, 0.06);
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-bar.visible {
    transform: translateY(0);
}

.player-progress-bar {
    position: absolute;
    top: -3px;
    left: 0;
    width: 100%;
    height: 6px;
    cursor: pointer;
    padding: 2px 0;
}

.progress-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    border-radius: 2px;
}

.player-progress-bar:hover .progress-track {
    height: 5px;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 2px;
    width: 0%;
}

.progress-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 0 8px rgba(212, 160, 23, 0.4);
}

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

.player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 100%;
    gap: 20px;
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    max-width: 300px;
}

.player-album-art {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--dark-card);
    flex-shrink: 0;
}

.player-track-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.player-track-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist-name {
    font-size: 11px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctrl-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-btn:hover { color: var(--gold); transform: scale(1.1); }
.ctrl-btn svg { width: 20px; height: 20px; }

.play-btn {
    width: 44px;
    height: 44px;
    background: var(--gold);
    color: var(--dark);
}

.play-btn:hover {
    background: var(--gold-light);
    color: var(--dark);
    transform: scale(1.08);
}

.play-btn svg { width: 22px; height: 22px; }

.player-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: flex-end;
    max-width: 300px;
}

.player-time {
    font-size: 11px;
    color: var(--gray);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.volume-wrap { display: flex; align-items: center; gap: 8px; }
.volume-icon { width: 18px; height: 18px; stroke: var(--gray); flex-shrink: 0; }

.volume-slider {
    width: 90px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    outline: none;
}

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

/* ---------- Music Page Footer ---------- */
.music-footer {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid var(--dark-border);
}

.music-footer-inner {
    display: flex;
    gap: 60px;
    margin-bottom: 24px;
}

.music-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.music-footer-links a {
    font-size: 13px;
    color: var(--gray);
    transition: color 0.2s;
}

.music-footer-links a:hover {
    color: var(--gold);
}

.music-footer-copy {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .mobile-browse-btn {
        display: flex;
    }

    .mobile-sidebar-overlay {
        display: block;
    }

    .music-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        z-index: 999;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(16px);
        transition: left 0.3s ease;
        padding-top: 80px;
        width: 260px;
    }

    .music-sidebar.open {
        left: 0;
    }

    .music-content { padding: 20px; }
    .music-footer-inner { flex-direction: column; gap: 24px; }
}

@media (max-width: 768px) {
    .topbar-nav { display: none; }
    .topbar-search { max-width: none; flex: 1; }
    .topbar-logo img { height: 34px; }
    .music-content { padding: 16px; }

    .music-layout {
        height: calc(100vh - 64px - 72px);
        height: calc(100dvh - 64px - 72px);
    }

    .tracks-row {
        gap: 12px;
    }

    .track-card {
        min-width: 140px;
        max-width: 170px;
    }

    .tracks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tracks-grid .track-card { min-width: 0; }

    .row-header h2 {
        font-size: 18px;
    }

    .section-row {
        margin-bottom: 30px;
    }

    /* Mobile player — show time, hide volume */
    .volume-wrap { display: none; }
    .player-time { display: block; }
    .player-right { max-width: none; flex: 0; }
    .player-track-info { max-width: 140px; }
    .player-album-art { width: 40px; height: 40px; }
    .player-content { padding: 0 12px; height: 100%; gap: 12px; }
    .play-btn { width: 40px; height: 40px; }
    .ctrl-btn { width: 32px; height: 32px; }

    .cursor-dot, .cursor-outline { display: none; }
    body, a, button, input { cursor: auto; }
}

@media (max-width: 480px) {
    .music-topbar {
        padding: 0 12px;
        gap: 10px;
    }

    .topbar-logo img { height: 30px; }
    .topbar-search input { font-size: 13px; }
    .topbar-search { padding: 0 12px; }

    .music-content { padding: 12px; }

    .track-card {
        min-width: 120px;
        max-width: 150px;
    }

    .tracks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .tracks-grid .track-card { padding: 10px; border-radius: 8px; }

    .row-header h2 { font-size: 16px; }

    .player-track-info { max-width: 110px; }
    .player-album-art { width: 36px; height: 36px; }
    .player-track-name { font-size: 12px; }
    .player-artist-name { font-size: 10px; }
    .play-btn { width: 38px; height: 38px; }
    .ctrl-btn { width: 30px; height: 30px; }
    .ctrl-btn svg { width: 16px; height: 16px; }
    .player-content { padding: 0 8px; gap: 8px; }
    .player-time { font-size: 10px; }
}
