/**
 * MuzBox - Main Stylesheet
 * Light green theme
 */

:root {
    --green: #16a34a;
    --green-hover: #15803d;
    --green-light: #22c55e;
    --green-bg: #f0fdf4;
    --green-bg2: #dcfce7;
    --green-glow: rgba(22,163,74,.08);
    --green-border: rgba(22,163,74,.2);
    --bg: #f4f6f5;
    --white: #ffffff;
    --card: #ffffff;
    --hover: #f7faf8;
    --border: #e5e7eb;
    --border-light: #f0f1f0;
    --text: #111827;
    --text2: #6b7280;
    --text3: #9ca3af;
    --shadow: 0 1px 3px rgba(0,0,0,.05);
    --shadow-md: 0 4px 14px rgba(0,0,0,.07);
    --player-h: 70px;
}

body {
    background: var(--bg);
    color: var(--text);
    padding-bottom: 0; /* player hidden initially */
    transition: padding-bottom .3s;
}
body.player-active { padding-bottom: var(--player-h); }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-hover); }

/* ===== NAVBAR ===== */
.nav-top { background: var(--white) !important; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.nav-top .navbar-brand { font-weight: 800; font-size: 1.35rem; color: var(--green) !important; }
.nav-top .brand-icon { background: var(--green); color: #fff; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; font-size: 1rem; margin-right: 5px; }
.nav-top .nav-link { color: var(--text2) !important; font-size: .83rem; font-weight: 500; padding: .35rem .7rem !important; border-radius: 6px; transition: all .15s; }
.nav-top .nav-link:hover, .nav-top .nav-link.active { color: var(--green) !important; background: var(--green-glow); }

/* ===== SEARCH BAR ===== */
.search-bar { background: var(--white); border-bottom: 1px solid var(--border); padding: .6rem 0; position: sticky; top: 56px; z-index: 1035; }
.s-wrap { max-width: 680px; margin: 0 auto; position: relative; }
.s-wrap .form-control { background: var(--bg); border: 2px solid var(--border); border-radius: 12px; padding: .6rem .9rem .6rem 40px; font-size: .92rem; color: var(--text); transition: all .2s; }
.s-wrap .form-control::placeholder { color: var(--text3); }
.s-wrap .form-control:focus { background: #fff; border-color: var(--green); box-shadow: 0 0 0 4px var(--green-glow); }
.s-wrap .s-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 1rem; pointer-events: none; z-index: 2; }
.s-wrap .s-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: var(--green); border: none; color: #fff; border-radius: 8px; padding: .38rem .9rem; font-size: .82rem; font-weight: 600; z-index: 2; transition: background .15s; }
.s-wrap .s-btn:hover { background: var(--green-hover); }

/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, var(--green-bg), var(--green-bg2)); border: 1px solid var(--green-border); border-radius: 12px; padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; }
.hero h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: .5rem; }
.hero h1 span { color: var(--green); }
.hero p { color: var(--text2); font-size: .88rem; margin: 0; line-height: 1.65; }

/* ===== CARD ===== */
.crd { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.15rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }

/* ===== SECTION HEAD ===== */
.s-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; padding-bottom: .45rem; border-bottom: 2px solid var(--border-light); }
.s-head h2 { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 7px; }
.s-head h2 i { color: var(--green); }
.s-head .sa { font-size: .78rem; font-weight: 500; color: var(--text3); }
.s-head .sa:hover { color: var(--green); }

/* ===== TRACK ITEM ===== */
.t-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: background .12s; cursor: pointer; border-bottom: 1px solid var(--border-light); overflow: hidden; }
.t-item:last-child { border-bottom: none; }
.t-item:hover { background: var(--hover); }
.t-item.is-playing { background: var(--green-glow); }
.t-item.is-playing .t-name .t-artist-link { color: var(--green); }
.t-item.is-playing .t-title span { color: var(--green); }
.t-img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--border-light); }
.t-body { flex: 1; min-width: 0; }
.t-name { font-size: .88rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-name .t-artist-link { color: var(--text); text-decoration: none; font-weight: 700; }
.t-name .t-artist-link:hover { color: var(--green); }
.t-title { font-size: .8rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.t-title span { color: var(--text2); }
.t-dur { font-size: .78rem; color: var(--text3); flex-shrink: 0; min-width: 38px; text-align: right; }
.t-acts { display: flex; gap: 5px; flex-shrink: 0; }
.t-acts .btn { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: .82rem; transition: all .15s; cursor: pointer; }
.bp { background: var(--green-bg2); color: var(--green); border: 1px solid var(--green-border); }
.bp:hover { background: var(--green); color: #fff; border-color: var(--green); }
.bd { background: var(--bg); color: var(--text2); border: 1px solid var(--border); }
.bd:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* Wide track list (search results) */
.track-list-wide .t-item { padding: 12px 16px; gap: 14px; }
.track-list-wide .t-img { width: 60px; height: 60px; border-radius: 10px; }
.track-list-wide .t-name { font-size: .92rem; }
.track-list-wide .t-title { font-size: .84rem; }
.track-list-wide .t-acts .btn { width: 34px; height: 34px; font-size: .88rem; }
.track-list-wide .bp { }
.track-list-wide .bd { }
.search-results-card { padding: 1.25rem 1.5rem; }
.search-results-card .t-item:hover { background: var(--green-glow); }

/* ===== LOAD MORE ===== */
.btn-more { background: var(--white); border: 1px solid var(--border); color: var(--text2); font-size: .83rem; font-weight: 500; padding: .45rem 1.8rem; border-radius: 8px; transition: all .15s; box-shadow: var(--shadow); }
.btn-more:hover { border-color: var(--green); color: var(--green); background: var(--green-glow); }

/* ===== GENRES ===== */
.g-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .85rem; color: var(--text2); font-size: .83rem; font-weight: 500; transition: all .15s; }
.ch-tab { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .9rem; font-size: .82rem; font-weight: 500; color: var(--text2); transition: all .15s; }
.ch-tab.active, .ch-tab:hover { background: var(--green); color: #fff; border-color: var(--green); }
.ch-rank { min-width: 28px; text-align: center; font-weight: 700; font-size: .85rem; color: var(--text3); flex-shrink: 0; }
.ch-rank.t3 { color: var(--green); font-size: .95rem; }
.tu { color: var(--green); font-size: .75rem; }
.td { color: #ef4444; font-size: .75rem; }
.ts { color: var(--text3); font-size: .75rem; }
.g-chip:hover { border-color: var(--green); color: var(--green); background: var(--green-glow); }
.g-chip i { color: var(--green); }

/* ===== CHARTS ===== */
.ch-tabs .btn { font-size: .78rem; font-weight: 500; padding: .25rem .65rem; border: 1px solid var(--border); color: var(--text3); background: var(--white); border-radius: 6px; transition: all .15s; }
.ch-tabs .btn:hover, .ch-tabs .btn.active { border-color: var(--green); color: var(--green); background: var(--green-glow); }
.ch-rank { font-weight: 700; font-size: .83rem; min-width: 24px; text-align: center; flex-shrink: 0; color: var(--text3); }
.ch-rank.t3 { color: var(--green); }
.tu { color: var(--green); font-size: .73rem; flex-shrink: 0; }
.td { color: #ef4444; font-size: .73rem; flex-shrink: 0; }
.ts { color: var(--text3); font-size: .73rem; flex-shrink: 0; }

/* ===== PLAYER BAR ===== */
.player-bar {
    position: fixed; bottom: -80px; left: 0; right: 0;
    height: var(--player-h);
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,.04);
    z-index: 1050;
    display: flex; align-items: center; padding: 0 .75rem;
    transition: bottom .3s ease;
}
.player-bar.active { bottom: 0; }

/* Mobile top progress bar */
.pl-mobile-prog {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #e5e7eb;
    cursor: pointer;
    z-index: 10;
}
.pl-mobile-prog-fill {
    height: 100%;
    background: var(--green);
    width: 0%;
    transition: width .3s linear;
    border-radius: 0 2px 2px 0;
}
.pl-mobile-prog:active {
    height: 8px;
    top: -2px;
}
.pl-mobile-prog:active .pl-mobile-prog-fill {
    border-radius: 0 4px 4px 0;
}
.pl-mobile-time {
    display: none;
    position: absolute;
    top: 5px; right: 8px;
    font-size: .58rem;
    color: var(--text3);
    z-index: 11;
    pointer-events: none;
}

.pl-info { display: flex; align-items: center; gap: 9px; width: 200px; flex-shrink: 0; min-width: 0; }
.pl-info img { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.pl-info .plt { font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; }
.pl-info .pla { font-size: .68rem; color: var(--text2); white-space: nowrap; overflow: hidden; }
.pl-info .plt span, .pl-info .pla span { display: inline-block; }
.marquee-scroll span { animation: marquee 8s linear infinite; animation-delay: 2s; }
@keyframes marquee {
    0%, 15% { transform: translateX(0); }
    45%, 55% { transform: translateX(var(--scroll-distance)); }
    85%, 100% { transform: translateX(0); }
}

.pl-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.pl-btns { display: flex; align-items: center; gap: 12px; }
.pl-btns .btn { background: none; border: none; color: var(--text3); font-size: .95rem; padding: 2px; }
.pl-btns .btn:hover { color: var(--text); }
.pl-btns .bmp {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--green); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .88rem;
    box-shadow: 0 3px 10px rgba(22,163,74,.25);
    transition: all .15s;
}
.pl-btns .bmp:hover { background: var(--green-hover); color: #fff; }
.pl-btns .bmp.loading { pointer-events: none; }
.pl-btns .bmp .spinner-border { width: 16px; height: 16px; border-width: 2px; }

.pl-prog { display: flex; align-items: center; gap: 7px; width: 100%; max-width: 480px; }
.pl-prog .pt { font-size: .68rem; color: var(--text3); min-width: 28px; text-align: center; }
.pl-prog .progress { flex: 1; height: 4px; background: var(--border); border-radius: 2px; cursor: pointer; overflow: visible; }
.pl-prog .progress-bar { background: var(--green); border-radius: 2px; transition: width .1s linear; position: relative; }
.pl-prog .progress:hover .progress-bar::after {
    content: ''; position: absolute; right: -5px; top: -4px;
    width: 12px; height: 12px; background: var(--green); border-radius: 50%;
}

.pl-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pl-right .bv { background: none; border: none; color: var(--text3); font-size: .85rem; cursor: pointer; }
.pl-right .vb { width: 65px; height: 4px; background: var(--border); border-radius: 2px; cursor: pointer; }
.pl-right .vb .progress-bar { background: var(--green); }
.pl-right .bdl { background: var(--green); border: none; color: #fff; font-size: .73rem; font-weight: 600; padding: .35rem .75rem; border-radius: 7px; white-space: nowrap; }
.pl-right .bdl:hover { background: var(--green-hover); }

/* ===== FOOTER ===== */
.ft { background: var(--white); border-top: 1px solid var(--border); padding: 1.75rem 0 1.25rem; margin-top: 1.5rem; }
.ft h6 { font-weight: 700; font-size: .83rem; }
.ft a { color: var(--text3); font-size: .78rem; display: block; padding: 2px 0; }
.ft a:hover { color: var(--green); }
.ft-brand { color: var(--green); font-weight: 800; font-size: 1.05rem; }
.ft-desc { color: var(--text2); font-size: .78rem; line-height: 1.6; }
.ft-bot { border-top: 1px solid var(--border); padding-top: .75rem; font-size: .73rem; color: var(--text3); }

/* ===== TRACK DETAIL ===== */
.detail-badge { display:inline-flex;align-items:center;gap:4px;font-size:.78rem;font-weight:500;color:var(--text2);background:var(--white);border:1px solid var(--border);padding:3px 10px;border-radius:20px; }
.detail-badge i { font-size:.7rem;color:var(--green); }
.btn-pl.btn-lg { padding:.65rem 2rem;font-size:.95rem; }
.g-chip.active { background:var(--green);color:#fff;border-color:var(--green); }
.g-chip.active:hover { background:var(--green-hover); }
.track-hero img { transition:transform .3s; }
.track-hero:hover img { transform:scale(1.02); }

@media(max-width:767.98px) {
    .track-hero .d-flex { flex-direction:column;align-items:center;text-align:center; }
    .track-hero img { width:160px!important;height:160px!important; }
    .track-hero .d-flex.gap-2 { justify-content:center; }
}

/* ===== RESPONSIVE ===== */
@media(max-width:991.98px) { .search-bar { top: 56px; } }
@media(max-width:767.98px) {
    .pl-info { width: 120px; }
    .pl-info > div { max-width: calc(100% - 53px); overflow: hidden; }
    .pl-right .vb, .pl-right .bv { display: none; }
    .pl-prog { display: none; }
    .pl-center { flex: 0; }
    .pl-mobile-prog { display: block; }
    .pl-mobile-time { display: block; }
    .hero { padding: 1.1rem 1.25rem; }
    .hero h1 { font-size: 1.05rem; }
    .crd { padding: .9rem; }
}
@media(max-width:575.98px) {
    .pl-right .bdl .dtx { display: none; }
    .pl-info { flex: 1; width: auto; min-width: 0; }
    .pl-info > div { max-width: calc(100% - 53px); overflow: hidden; }
    .pl-center { flex: 0 0 auto; }
    .pl-btns { gap: 6px; }
    .pl-btns .bmp { width: 32px; height: 32px; font-size: .8rem; }
    .pl-btns .btn { font-size: .85rem; }
    .s-wrap .s-btn .stx { display: none; }
}

/* Spinner animation for play button loading */
.spin {
    display: inline-block;
    animation: spin .8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
