/* =========================
   VARIÁVEIS
========================= */
:root {
    --bg:     #111;
    --panel:  #151515;
    --panel2: #1c1c1c;
    --text:   #fff;
    --muted:  #aaa;
    --accent: #00b894;
    --border: #222;
}
body.light {
    --bg:     #f2f2f2;
    --panel:  #fff;
    --panel2: #e9e9e9;
    --text:   #111;
    --muted:  #555;
    --accent: #00b894;
    --border: #ddd;
}

/* =========================
   RESET
========================= */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    background-image: url('./backgrounds/thunderstorm.gif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    overflow: hidden;
}

/* =========================
   LOGIN
========================= */
.login-body { display:flex; justify-content:center; align-items:center; height:100vh; }

.login-box {
    width: 340px;
    background: var(--panel);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.login-box input {
    display: block; width: 100%; padding: 14px;
    margin-bottom: 14px;
    background: var(--panel2); border: none; border-radius: 10px;
    color: var(--text); font-size: 15px; outline: none;
}

.login-box button {
    width: 100%; padding: 14px;
    background: var(--accent); border: none; border-radius: 10px;
    color: #fff; font-size: 16px; font-weight: bold; cursor: pointer;
    transition: opacity .2s;
}
.login-box button:hover { opacity: .85; }

.error {
    background: #b00020; color: #fff;
    padding: 10px 14px; margin-bottom: 14px;
    border-radius: 8px; font-size: 14px;
}

/* =========================
   LAYOUT
========================= */
.layout  { display:flex; height:100vh; overflow:hidden; }
.content { display:flex; flex:1; overflow:hidden; }

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 300px; height: 100vh;
    background: var(--panel);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.logo { padding: 18px 20px; font-size: 20px; font-weight: bold; }

#themeToggle {
    width: calc(100% - 20px); margin: 10px;
    padding: 11px; border: none; border-radius: 10px;
    background: var(--panel2); color: var(--text);
    cursor: pointer; transition: background .2s; font-size: 14px;
}
#themeToggle:hover { background: var(--accent); color: #fff; }

#searchBox {
    width: calc(100% - 20px); margin: 0 10px 10px;
    padding: 11px; border: none; border-radius: 10px;
    background: var(--panel2); color: var(--text); outline: none; font-size: 14px;
}

/* =========================
   FOLDERS / SONGS
========================= */
.folder-title {
    padding: 13px 15px;
    background: var(--panel2);
    cursor: pointer;
    display: flex; justify-content: space-between;
    transition: background .2s; user-select: none; font-size: 14px;
}
.folder-title:hover { background: var(--accent); color: #fff; }

.song-count { opacity: .55; font-size: 11px; }
.arrow { transition: transform .3s; }

.folder-songs {
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease;
    background: var(--panel);
}
.folder.open .folder-songs { max-height: 1200px; }
.folder.open .arrow        { transform: rotate(90deg); }

.song {
    padding: 11px 15px; cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .15s; font-size: 13px;
}
.song:hover  { background: var(--panel2); }
.song.active { background: var(--accent); color: #fff; }

/* =========================
   MAIN
========================= */
.main {
    flex: 1; display: flex;
    justify-content: center; align-items: center;
    position: relative; overflow: hidden;
    background: rgba(0,0,0,.2);
}

.fullscreen-player {
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
}

.fullscreen-content {
    width: 92%; max-width: 680px;
    padding: 28px; border-radius: 28px;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(0,0,0,.35);
    display: flex; flex-direction: column; align-items: center;
    transition: background 1.2s ease;
}

/* =========================
   ALBUM ART
========================= */
.album-art {
    width: 200px; height: 200px; border-radius: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 80px; flex-shrink: 0; overflow: hidden;
    background: linear-gradient(135deg, rgba(0,184,148,.4), rgba(0,0,0,.5));
    box-shadow: 0 0 40px rgba(0,184,148,.4);
    animation: pulse 4s infinite ease-in-out;
    transition: box-shadow .6s ease;
}
.album-art.has-art { font-size: 0; box-shadow: 0 0 60px rgba(0,184,148,.6); }

@keyframes pulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.03); }
}

/* =========================
   INFO
========================= */
.fullscreen-info { width: 100%; text-align: center; overflow: hidden; }

.fullscreen-title {
    font-size: 20px; font-weight: bold;
    margin: 14px 0 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
.fullscreen-folder { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* =========================
   AUDIO
========================= */
#audioPlayer { display: none; }

/* =========================
   PROGRESS BAR
========================= */
.progress-wrapper {
    display: flex; align-items: center;
    gap: 10px; width: 100%; margin-bottom: 14px;
}
.progress-time { font-size: 12px; color: var(--muted); min-width: 34px; text-align: center; user-select: none; }

.progress-bar {
    flex: 1; height: 6px;
    background: rgba(255,255,255,.15); border-radius: 10px;
    position: relative; cursor: pointer;
    padding: 10px 0; margin: -10px 0;
}
.progress-fill {
    height: 6px; background: var(--accent); border-radius: 10px;
    width: 0%; pointer-events: none; transition: width .1s linear;
}
.progress-thumb {
    width: 14px; height: 14px;
    background: #fff; border-radius: 50%;
    position: absolute; top: 50%; left: 0%;
    transform: translate(-50%,-50%);
    pointer-events: none;
    box-shadow: 0 0 6px rgba(0,0,0,.4);
    transition: left .1s linear, width .15s, height .15s;
}
.progress-bar:hover .progress-thumb,
.progress-bar:active .progress-thumb { width: 18px; height: 18px; }

/* =========================
   VISUALIZER
========================= */
#visualizer {
    width: 100%; height: 110px; border-radius: 18px;
    background: rgba(255,255,255,.03);
    margin-bottom: 14px; display: block;
}

/* =========================
   CONTROLS
========================= */
.fullscreen-controls {
    display: flex; gap: 10px; align-items: center; margin-bottom: 12px;
}
.fullscreen-controls button {
    width: 50px; height: 50px; border: none; border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff;
    font-size: 17px; cursor: pointer; flex-shrink: 0;
    transition: transform .2s, background .2s;
}
.fullscreen-controls button:hover { background: rgba(255,255,255,.22); transform: scale(1.1); }

#playPauseBtn {
    width: 66px !important; height: 66px !important;
    font-size: 22px !important;
    background: var(--accent) !important;
    box-shadow: 0 0 20px rgba(0,184,148,.5);
}
#playPauseBtn:hover { box-shadow: 0 0 30px rgba(0,184,148,.8) !important; }

#shuffleBtn.active,
#repeatBtn.active  { color: var(--accent); background: rgba(0,184,148,.2); }
#repeatBtn.repeat-one { color: #fdcb6e; background: rgba(253,203,110,.2); }

.extra-controls { display: flex; justify-content: center; }
.extra-controls button {
    padding: 8px 18px; border: none; border-radius: 20px;
    background: rgba(255,255,255,.1); color: #fff;
    font-size: 13px; cursor: pointer; transition: background .2s;
}
.extra-controls button:hover { background: rgba(255,255,255,.2); }
#boostBtn.active { background: rgba(253,121,168,.3); color: #fd79a8; box-shadow: 0 0 16px rgba(253,121,168,.5); }

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {
    .sidebar { width: 44%; min-width: 155px; }
    .main    { width: 56%; overflow: hidden; }

    .fullscreen-content { width: 98%; padding: 12px; border-radius: 18px; }

    .album-art { width: 96px; height: 96px; font-size: 38px; border-radius: 14px; }
    .album-art.has-art { font-size: 0; }

    .fullscreen-title  { font-size: 13px; margin: 8px 0 2px; }
    .fullscreen-folder { font-size: 11px; margin-bottom: 8px; }

    #visualizer { height: 55px; margin-bottom: 10px; }
    .progress-wrapper { margin-bottom: 10px; }

    .fullscreen-controls { gap: 7px; }
    .fullscreen-controls button { width: 38px; height: 38px; font-size: 13px; }
    #playPauseBtn { width: 50px !important; height: 50px !important; font-size: 17px !important; }

    .extra-controls button { padding: 6px 12px; font-size: 12px; }
}
