/* ----------------------------------------------------
   VARIABLES (MODE SOMBRE PAR DÉFAUT)
---------------------------------------------------- */
:root {
    --bg: #050509;
    --bg-card: #12121a;
    --accent: #1db954;
    --accent-soft: #2b8650;
    --text-main: #ffffff;
    --text-muted: #a0a0b5;
    --text-soft: #c7c7d8;
    --border-soft: #262636;
    --radius-card: 16px;
    --radius-cover: 12px;
    --shadow-soft: 0 12px 30px rgba(0,0,0,0.45);
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;

    --mini-height: 150px;
    --full-btn-size: 72px;
    --full-btn-font: 32px;
}

/* ----------------------------------------------------
   GLOBAL
---------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--bg);
    background: radial-gradient(circle at top, #1b1b2b 0, #050509 55%);
    color: var(--text-main);
    overflow-x: hidden;
}

/* ----------------------------------------------------
   HEADER
---------------------------------------------------- */
.app-header {
    padding: 16px 16px 8px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(5,5,9,0.95), rgba(5,5,9,0.7));
    backdrop-filter: blur(18px);
}

.app-footer {
    padding: 16px;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.app-footer p {
    flex-wrap: nowrap;
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
}
.app-footer a:hover {
    text-decoration: underline;
}

h1 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.1;
    font-weight: 500;
}
h1 span {
    font-style: italic;
    /* font-weight: 300; */
}

.branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 4em;
    height: 4em;
    /* border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #1db954, #0b3b22);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.05); */
}

.logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.logo-circle img.light {
    display: block;
}
.logo-circle img.dark {
    display: none;
}

.tagline {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ----------------------------------------------------
   MAIN CONTENT
---------------------------------------------------- */
.app-main {
    padding: 18px 16px calc(var(--mini-height) + 20px);
}

/* ----------------------------------------------------
   PLAYLIST SECTION
---------------------------------------------------- */
.playlist-section {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.playlist-card {
    background: linear-gradient(135deg, #181824, #12121a);
    padding: 16px;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease;
}

.playlist-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

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

.playlist-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.playlist-card p {
    margin: 12px 0 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.playlist-card .playlist-header p {
    margin: 0;
    font-size: 0.8rem;
}

.playlist-card .track-play-icon {
    margin-top: 8px;
    font-size: 1.2rem;
    color: var(--accent);
}

.playlist-title {
    margin: 48px 0 12px;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* ----------------------------------------------------
   TRACK CARDS
---------------------------------------------------- */
.section-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.track-card {
    background: linear-gradient(135deg, #12121a, #181824);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.track-card.playing {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(29,185,84,0.6), var(--shadow-soft);
}

.track-button {
    display: flex;
    width: 100%;
    padding: 12px;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    gap: 12px;
}

/* Cover */
.track-cover {
    flex: 0 0 72px;
    height: 72px;
    border-radius: var(--radius-cover);
    overflow: hidden;
    background: #222233;
}

.track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info */
.track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.track-title {
    font-size: 1rem;
    margin: 0;
}

.track-subtitle {
    font-size: 0.8rem;
    margin: 0;
    color: var(--text-soft);
}

.track-artist {
    font-size: 0.75rem;
    margin: 0;
    color: var(--accent);
}

.track-description {
    font-size: 0.75rem;
    margin: 4px 0 0;
    color: var(--text-muted);
}

/* Play icon */
.track-play-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    color: var(--accent);
}

.track-card.playing .track-play-icon {
    color: var(--text-main);
}

/* ----------------------------------------------------
   MINI PLAYER
---------------------------------------------------- */
.mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mini-height);
    background: rgba(8,8,14,0.96);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-soft);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
}

.mini-player.is-hidden {
    display: none;
}

/* Mini top row */
.mini-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mini-cover {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
}

.mini-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#mini-title {
    font-size: 0.9rem;
}

#mini-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mini controls */
.mini-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-controls button {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: #1b1b28;
    color: var(--text-main);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mini progress */
.mini-progress {
    width: 100%;
}

.mini-progress-bar {
    width: 100%;
    height: 5px;
    background: #1b1b28;
    border-radius: 999px;
    overflow: hidden;
}

#mini-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
}

/* ----------------------------------------------------
   FULLSCREEN PLAYER
---------------------------------------------------- */
.fullscreen {
    position: fixed;
    inset: 0;
    background: #050509;
    z-index: 50;
    overflow-y: auto;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.35s ease;
}

.fullscreen.visible {
    transform: translateY(0);
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 32px;
    color: var(--text-main);
    margin-bottom: 10px;
    cursor: pointer;
}

/* Full cover */
.full-cover {
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: 16px;
    margin: 0 auto;
    display: block;
}

/* Full text */
#full-title {
    text-align: center;
    margin-top: 20px;
    font-size: 1.4rem;
}

#full-artist {
    text-align: center;
    font-size: 1rem;
    color: var(--accent);
}

.full-description {
    text-align: center;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Full progress */
.full-progress {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.full-progress-bar {
    flex: 1;
    height: 6px;
    background: #1b1b28;
    border-radius: 999px;
    overflow: hidden;
}

#full-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
}

/* Full controls */
.full-controls {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.full-controls button {
    width: var(--full-btn-size);
    height: var(--full-btn-size);
    border-radius: 999px;
    border: none;
    background: #1b1b28;
    color: var(--text-main);
    font-size: var(--full-btn-font);
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-center {
    background: var(--accent);
    color: black;
}

/* ----------------------------------------------------
   MODE CLAIR AUTOMATIQUE
---------------------------------------------------- */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f5f7;
        --bg-card: #ffffff;
        --text-main: #1a1a1c;
        --text-muted: #555566;
        --text-soft: #777788;
        --border-soft: #e0e0e5;
        --accent: #1db954;
        --accent-soft: #2b8650;
    }

    body {
        background: linear-gradient(to bottom, #ffffff, #f0f0f3);
        color: var(--text-main);
    }

    .app-header {
        background: rgba(255,255,255,0.85);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border-soft);
    }

    .logo-circle img.light {
        display: none;
    }
    .logo-circle img.dark {
        display: block;
    }

    .playlist-card {
        background: #ffffff;
        border-color: var(--border-soft);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .track-card {
        background: #ffffff;
        border-color: var(--border-soft);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .mini-player {
        background: rgba(255,255,255,0.9);
        border-top: 1px solid var(--border-soft);
    }

    .fullscreen {
        background: #ffffff;
        color: var(--text-main);
    }

    .full-controls button {
        background: #e9e9ef;
        color: var(--text-main);
    }

    .full-center {
        background: var(--accent);
        color: white;
    }
}

/* ----------------------------------------------------
   DESKTOP
---------------------------------------------------- */
@media (min-width: 768px) {
    /* .app-header {
        max-width: 720px;
        margin: 0 auto;
        left: 0;
        right: 0;
    } */

    .app-footer {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        width: 0;
    }

    .app-footer .inner {
        position: absolute;
        bottom: 35px;
        left: 0;
        width: max-content;
        white-space: nowrap;
        transform: rotate(-90deg);
        transform-origin: bottom left;
    }

    .app-footer p {
        margin: 0;
    }

    .app-main {
        max-width: 720px;
        margin: 0 auto;
    }

    .mini-player {
        max-width: 720px;
        margin: 0 auto;
        left: 0;
        right: 0;
    }

    .fullscreen {
        max-width: 720px;
        margin: 0 auto;
        left: 0;
        right: 0;
    }
}
