/* ══════════════════════════════════════
   TM INFINITY — PREMIUM V3
   Fonte: Bebas Neue + DM Sans
   Paleta: #000 → #1a0000 → #E50914
══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --red:       #E50914;
    --red-mid:   #b30710;
    --red-glow:  rgba(229,9,20,.4);
    --red-dim:   rgba(229,9,20,.12);
    --red-faint: rgba(229,9,20,.06);
    --bg0:  #060606;
    --bg1:  #0e0e0e;
    --bg2:  #161616;
    --bg3:  #1e1e1e;
    --bg4:  #262626;
    --bd:   rgba(255,255,255,.07);
    --bd2:  rgba(255,255,255,.13);
    --t0:   #f2f2f2;
    --t1:   #a0a0a0;
    --t2:   #555;
    --font-d: 'Bebas Neue', sans-serif;
    --font-b: 'DM Sans', sans-serif;
    --r:    10px;
    --player-h: 84px;
    --sb-w: 260px;
    --ease: cubic-bezier(.4,0,.2,1);
}

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

html, body { height: 100%; overflow: hidden; background: var(--bg0); color: var(--t0); font-family: var(--font-b); }

button { font-family: var(--font-b); cursor: pointer; border: none; background: none; color: inherit; }
a { cursor: pointer; text-decoration: none; color: inherit; }
input { font-family: var(--font-b); }

/* ── APP SHELL ── */
.app { display: flex; height: 100vh; width: 100vw; position: relative; }

/* ══ SIDEBAR ══ */
.sidebar {
    width: var(--sb-w);
    background: var(--bg1);
    border-right: 1px solid var(--bd);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    transition: transform .3s var(--ease);
    z-index: 200;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--bd);
    flex-shrink: 0;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-bolt {
    width: 34px; height: 34px;
    background: var(--red);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: #fff;
    box-shadow: 0 0 18px var(--red-glow);
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.l1 { font-family: var(--font-d); font-size: 20px; color: var(--red); letter-spacing: 2px; }
.l2 { font-family: var(--font-d); font-size: 10px; color: var(--t2); letter-spacing: 4px; }

.sidebar-close { display: none; color: var(--t1); font-size: 18px; padding: 4px 8px; border-radius: 6px; transition: color .2s; }
.sidebar-close:hover { color: var(--t0); }

/* Nav */
.snav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px 10px; flex-shrink: 0; }
.snav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    font-size: 13px; font-weight: 500; color: var(--t1);
    transition: background .2s, color .2s;
}
.snav-item i { width: 16px; text-align: center; font-size: 14px; }
.snav-item:hover { background: var(--bg3); color: var(--t0); }
.snav-item.active { background: var(--red-dim); color: var(--red); border: 1px solid rgba(229,9,20,.2); }

.snav-label {
    padding: 8px 22px 6px;
    font-size: 10px; letter-spacing: 2px; font-weight: 700;
    color: var(--t2); flex-shrink: 0;
}

/* Category scroll */
.cat-scroll { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.cat-scroll::-webkit-scrollbar { width: 4px; }
.cat-scroll::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

.cat-group { border-bottom: 1px solid var(--bd); }
.cat-group:last-child { border-bottom: none; }

.cat-group-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 10px; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: var(--t1);
    transition: background .2s, color .2s;
    user-select: none;
}
.cat-group-hd:hover { background: var(--bg3); color: var(--t0); }
.cat-group-hd i { font-size: 10px; transition: transform .25s var(--ease); }
.cat-group.open .cat-group-hd i { transform: rotate(90deg); }
.cat-group.open .cat-group-hd { color: var(--red); }

.cat-group-body {
    display: flex; flex-direction: column; gap: 1px;
    max-height: 0; overflow: hidden;
    transition: max-height .3s var(--ease);
}
.cat-group.open .cat-group-body { max-height: 500px; }
.cat-group-body a {
    padding: 8px 10px 8px 22px;
    font-size: 12px; color: var(--t2); border-radius: 6px;
    transition: background .15s, color .15s;
}
.cat-group-body a:hover { background: var(--bg3); color: var(--t0); }
.cat-group-body a.active { color: var(--red); background: var(--red-faint); }

/* Overlay */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.7); z-index: 199;
    backdrop-filter: blur(3px);
}
.sidebar-overlay.open { display: block; }

/* ══ MAIN ══ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Top bar */
.topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px;
    background: rgba(6,6,6,.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bd);
    flex-shrink: 0;
    position: sticky; top: 0; z-index: 10;
}

.burger {
    font-size: 18px; color: var(--t1); padding: 6px 8px;
    border-radius: 8px; transition: color .2s, background .2s; flex-shrink: 0;
    display: none;
}
.burger:hover { color: var(--t0); background: var(--bg3); }

.search-wrap {
    flex: 1; max-width: 460px;
    display: flex; align-items: center; gap: 10px;
    background: var(--bg2); border: 1px solid var(--bd);
    border-radius: 50px; padding: 0 6px 0 16px;
    transition: border-color .2s, box-shadow .2s;
}
.search-wrap:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.search-wrap i { color: var(--t2); font-size: 13px; flex-shrink: 0; }
.search-wrap input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--t0); font-size: 14px; padding: 10px 0;
}
.search-wrap input::placeholder { color: var(--t2); }
.search-wrap button {
    background: var(--red); color: #fff;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    transition: background .2s, transform .1s;
}
.search-wrap button:hover { background: #ff1f1f; transform: scale(1.05); }

.topbar-right { margin-left: auto; flex-shrink: 0; }
.now-chip {
    font-size: 11px; color: var(--t1); white-space: nowrap;
    max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}

/* ══ PAGE SCROLL ══ */
.page-scroll {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding-bottom: calc(var(--player-h) + 16px);
}
.page-scroll::-webkit-scrollbar { width: 6px; }
.page-scroll::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }
.page-scroll::-webkit-scrollbar-thumb:hover { background: var(--red); }

.hidden { display: none !important; }

/* ══ HERO ══ */
.hero {
    position: relative; overflow: hidden;
    min-height: 260px;
    display: flex; align-items: flex-end;
    padding: 0 28px 32px;
}
.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 60% at 20% 40%, rgba(229,9,20,.25) 0%, transparent 70%),
                linear-gradient(180deg, #1a0000 0%, #0a0000 60%, var(--bg0) 100%);
}
.hero-bg::after {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(229,9,20,.06) 1px, transparent 1px);
    background-size: 28px 28px;
}
.hero-content { position: relative; z-index: 1; }
.hero-logo {
    width: 52px; height: 52px; background: var(--red);
    border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
    box-shadow: 0 0 32px var(--red-glow);
    margin-bottom: 16px;
    animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%,100% { box-shadow: 0 0 24px var(--red-glow); }
    50%      { box-shadow: 0 0 48px var(--red-glow), 0 0 80px rgba(229,9,20,.2); }
}
.hero-content h1 {
    font-family: var(--font-d); font-size: 52px; line-height: 1;
    color: var(--t0); letter-spacing: 2px; margin-bottom: 8px;
}
.hero-content h1 span { color: var(--red); }
.hero-content p { font-size: 14px; color: var(--t1); margin-bottom: 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
    background: var(--red); color: #fff;
    padding: 10px 22px; border-radius: 50px;
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 4px 20px var(--red-glow);
}
.btn-primary:hover { background: #ff1f1f; transform: translateY(-1px); box-shadow: 0 8px 28px var(--red-glow); }
.btn-ghost {
    background: rgba(255,255,255,.08); color: var(--t0);
    padding: 10px 22px; border-radius: 50px;
    font-size: 13px; font-weight: 600; border: 1px solid var(--bd2);
    display: flex; align-items: center; gap: 8px;
    transition: background .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,.14); }

/* ══ SHELVES ══ */
.shelves { padding: 24px 0 0; }

.shelf { margin-bottom: 32px; }
.shelf-hd {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 0 24px 14px;
}
.shelf-title { font-family: var(--font-d); font-size: 22px; letter-spacing: .5px; }
.shelf-more { font-size: 12px; color: var(--red); font-weight: 600; }
.shelf-more:hover { text-decoration: underline; }

.shelf-row {
    display: flex; gap: 14px;
    overflow-x: auto; padding: 0 24px 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.shelf-row::-webkit-scrollbar { height: 0; }

/* ══ MUSIC CARD (shelf) ══ */
.mcard {
    flex-shrink: 0; width: 148px;
    scroll-snap-align: start;
    cursor: pointer;
    animation: fadeUp .4s var(--ease) both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mcard-img {
    width: 148px; height: 148px;
    border-radius: 10px;
    background: var(--bg3);
    position: relative; overflow: hidden;
    background-size: cover; background-position: center;
    margin-bottom: 10px;
    transition: transform .25s var(--ease);
}
.mcard:hover .mcard-img { transform: scale(1.03); }
.mcard-img-ph {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; color: var(--red); opacity: .3;
    background: linear-gradient(135deg,#1a0303,#1e1e1e);
}
.mcard-play {
    position: absolute; bottom: 8px; right: 8px;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--red); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    opacity: 0; transform: translateY(8px) scale(.85);
    transition: opacity .2s, transform .2s;
    box-shadow: 0 4px 16px var(--red-glow);
}
.mcard:hover .mcard-play { opacity: 1; transform: translateY(0) scale(1); }
.mcard.playing .mcard-play { opacity: 1; transform: translateY(0) scale(1); background: var(--red); }
.mcard-play.is-playing { opacity: 1 !important; transform: translateY(0) scale(1) !important; }

.mcard-name {
    font-size: 13px; font-weight: 600; color: var(--t0);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 3px;
}
.mcard-artist { font-size: 12px; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mcard.playing .mcard-name { color: var(--red); }

/* ══ SHELF SKELETON ══ */
.shelf-skeleton { margin-bottom: 32px; padding: 0 24px; }
.shelf-skeleton::before {
    content: '';
    display: block; height: 22px; width: 140px; border-radius: 6px;
    margin-bottom: 16px;
    background: linear-gradient(90deg,#1a1a1a 25%,#252525 50%,#1a1a1a 75%);
    background-size: 400px 100%;
    animation: shimmer 1.4s infinite linear;
}
.shelf-sk-row { display: flex; gap: 14px; }
.shelf-sk-card { flex-shrink: 0; width: 148px; }
.sk-img { width: 148px; height: 148px; border-radius: 10px; margin-bottom: 10px; background: linear-gradient(90deg,#1a1a1a 25%,#252525 50%,#1a1a1a 75%); background-size: 400px 100%; animation: shimmer 1.4s infinite linear; }
.sk-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg,#1a1a1a 25%,#252525 50%,#1a1a1a 75%); background-size: 400px 100%; animation: shimmer 1.4s infinite linear; margin-bottom: 7px; }
.sk-line.s { width: 70%; }
@keyframes shimmer { 0%{background-position:-400px 0} 100%{background-position:400px 0} }

/* ══ LIST VIEW ══ */
.list-view { padding: 20px 20px 0; animation: fadeIn .3s var(--ease); }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.list-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.back-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg3); color: var(--t1); font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background .2s, color .2s;
}
.back-btn:hover { background: var(--bg4); color: var(--t0); }
.list-header h2 { font-family: var(--font-d); font-size: 26px; letter-spacing: .5px; }
.list-count { font-size: 12px; color: var(--t2); margin-top: 2px; display: block; }

/* Grid list — 2 cols mobile, auto fill desktop */
.music-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 16px;
}

/* Card in list view */
.lcard {
    cursor: pointer;
    animation: fadeUp .35s var(--ease) both;
}
.lcard-img {
    width: 100%; aspect-ratio: 1;
    border-radius: 10px; background: var(--bg3);
    position: relative; overflow: hidden;
    background-size: cover; background-position: center;
    margin-bottom: 10px;
    transition: transform .25s var(--ease);
}
.lcard:hover .lcard-img { transform: scale(1.03); }
.lcard-img-ph {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: var(--red); opacity: .3;
    background: linear-gradient(135deg,#1a0303,#1e1e1e);
}
.lcard-play {
    position: absolute; bottom: 8px; right: 8px;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--red); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
    opacity: 0; transform: translateY(8px) scale(.85);
    transition: opacity .2s, transform .2s;
    box-shadow: 0 4px 14px var(--red-glow);
}
.lcard:hover .lcard-play { opacity: 1; transform: translateY(0) scale(1); }
.lcard.playing .lcard-play { opacity: 1; transform: none; }
.lcard.playing .lcard-name { color: var(--red); }

.lcard-name { font-size: 13px; font-weight: 600; color: var(--t0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.lcard-artist { font-size: 12px; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.lcard-dur { font-size: 11px; color: var(--t2); }
.fav-btn-sm {
    background: none; border: none; color: var(--t2); font-size: 13px; cursor: pointer;
    padding: 2px; transition: color .2s, transform .15s;
}
.fav-btn-sm:hover { color: var(--red); transform: scale(1.2); }
.fav-btn-sm.active { color: var(--red); }

/* Status msg */
.status-msg { margin-top: 20px; padding: 14px 18px; background: var(--bg2); border-left: 3px solid var(--red); border-radius: 6px; font-size: 13px; color: var(--t1); display: none; }
.status-msg a { color: var(--red); }

/* Grid skeleton in list view */
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px,1fr)); gap: 16px; }
.sk-card-l .sk-img { width: 100%; height: 0; padding-bottom: 100%; border-radius: 10px; margin-bottom: 10px; }

/* ══ PLAYER ══ */
.player {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--player-h);
    background: rgba(8,8,8,.96);
    backdrop-filter: blur(24px);
    border-top: 1px solid var(--bd2);
    display: flex; align-items: center; gap: 16px;
    padding: 0 20px; z-index: 100;
}

.player-thumb {
    width: 50px; height: 50px; border-radius: 8px;
    background: var(--bg3); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--t2);
    background-size: cover; background-position: center; overflow: hidden;
}

.player-meta { flex: 0 0 22%; min-width: 0; }
.player-meta p:first-child { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta p:last-child  { font-size: 11px; color: var(--t1); margin-top: 2px; }

.p-btn { color: var(--t1); font-size: 16px; padding: 4px; border-radius: 6px; transition: color .2s, transform .1s; }
.p-btn:hover { color: var(--t0); }

.fav-btn { font-size: 15px !important; }
.fav-btn.active { color: var(--red) !important; }

.play-btn {
    width: 38px !important; height: 38px !important;
    background: #fff !important; color: #000 !important;
    border-radius: 50% !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    font-size: 14px !important;
    box-shadow: 0 2px 12px rgba(255,255,255,.15);
    transition: transform .15s, box-shadow .2s !important;
}
.play-btn:hover { transform: scale(1.08) !important; box-shadow: 0 4px 20px rgba(255,255,255,.25) !important; }

.player-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.p-btns { display: flex; align-items: center; gap: 18px; }

.progress-row { width: 100%; display: flex; align-items: center; gap: 8px; }
.progress-row span { font-size: 11px; color: var(--t2); min-width: 30px; font-variant-numeric: tabular-nums; }
.progress-track {
    flex: 1; height: 4px; background: var(--bg4);
    border-radius: 99px; position: relative; cursor: pointer;
}
.progress-fill {
    position: absolute; left: 0; top: 0;
    height: 100%; background: var(--red);
    border-radius: 99px; width: 0%;
    pointer-events: none; transition: width .1s linear;
}
.progress-track:hover .progress-fill { background: #ff2020; }
.progress-track input[type=range] {
    position: absolute; inset: -8px 0;
    width: 100%; opacity: 0; cursor: pointer; height: 20px;
}

.vol-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.vol-wrap i { color: var(--t2); font-size: 13px; }
.vol-track { width: 80px; height: 4px; background: var(--bg4); border-radius: 99px; position: relative; cursor: pointer; }
.vol-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--t1); border-radius: 99px; pointer-events: none; }
.vol-track input[type=range] { position: absolute; inset: -8px 0; width: 100%; opacity: 0; cursor: pointer; height: 20px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 820px) {
    :root { --sb-w: 280px; }
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100%;
        transform: translateX(-100%);
        display: flex !important;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 6px 0 40px rgba(0,0,0,.8); }
    .sidebar-close { display: block; }
    .burger { display: flex; }
    
    /* Player Responsivo */
    .player { padding: 0 12px; gap: 10px; }
    .player-thumb { width: 42px; height: 42px; }
    .player-meta { display: flex; flex: 1; }
    .player-meta p:first-child { font-size: 12px; max-width: 120px; }
    .player-meta p:last-child { font-size: 10px; }
    .p-btn.fav-btn { display: none; }
    .player-center { flex: none; width: auto; margin-left: auto; }
    .p-btns { gap: 12px; }
    .progress-row { display: none; } /* Esconde barra de progresso em telas pequenas para focar nos controles */
    .vol-wrap { display: none; }
    
    .topbar { padding: 10px 14px; }
    .search-wrap { max-width: none; }
    .now-chip { display: none; }
    
    .hero { padding: 0 16px 24px; min-height: 200px; align-items: center; text-align: center; }
    .hero-content { width: 100%; }
    .hero-logo { margin: 0 auto 16px; }
    .hero-content h1 { font-size: 32px; }
    .hero-actions { justify-content: center; }
    
    .shelves { padding-top: 16px; }
    .shelf-hd, .shelf-row { padding-left: 16px; padding-right: 16px; }
    .shelf-title { font-size: 18px; }
    
    .list-view { padding: 16px 14px 0; }
    .music-grid-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .lcard-name { font-size: 12px; }
}

@media (max-width: 480px) {
    .music-grid-list { grid-template-columns: repeat(2, 1fr); }
    .mcard { width: 130px; }
    .mcard-img { width: 130px; height: 130px; }
    .hero-content h1 { font-size: 28px; }
    .btn-primary, .btn-ghost { padding: 8px 16px; font-size: 12px; }
}