/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
}

p, 
ul, 
li {
    font-weight: 600;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* THEME */
:root {
  --bg: #111;
  --surface: #181818;
  --border: #2a2a2a;
  --text: #fff;
  --muted: #aaa;
  --accent: #1DB954;
}

.theme-light {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #f1f1f1;
  --text: #000;
  --muted: #666;
  --accent: #1DB954;
}

body {
  background: var(--bg);
  color: var(--text);
}

.pdf {
  position: relative;
  height: 100%;
  padding: 12px;
  background: var(--surface);
}

.pdf iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.pdf__mask {
  position: absolute;
  inset: 12px;
  background: var(--surface);
  z-index: 2;
  display: block;
}

.pdf.ready .pdf__mask {
  display: none;
}



/* BUTTONS */

button {
  font-size: 16px;
}

.btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

#loopToggle {
    background-color: var(--border);
    color: var(--muted);
    border-radius: 1000px;
    display: inline-block;  
    border: 2px solid transparent;

}

#loopToggle.active {
  color: var(--accent); 
  border-color: var(--accent);
}

.btn--ghost {
  background: var(--border);
  color: var(--text);
}

#toggleTheme {
  font-size: 20px;
  font-weight: normal;
  line-height: 1;
}

/* LAYOUT */
.app {
  display: flex;
  height: 100vh;
}

/* TOPBAR (mobile) */
.topbar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar__title {
  flex: 1;
  text-align: center;
  font-weight: 700;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px;
}

.sidebar__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-weight: 700;
}

.sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar__list li {
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
}

.sidebar__list li.active {
  background: var(--border);
  color: var(--accent);
}

/* MAIN */
.main {
  flex: 1;
}

.pdf {
  position: relative;
  height: 100%;
  padding: 12px;
  background: var(--surface);
}

.pdf iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
  transition: opacity .15s;
}

.pdf__loader {
  position: absolute;
  inset: 12px;
  background: var(--surface);
  opacity: 0;
  transition: opacity .15s;
}

.pdf.loading iframe {
  opacity: 0;
}

.pdf.loading .pdf__loader {
  opacity: 1;
}

/* PLAYER */
.player {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.player__toggle {
  width: 100%;
  background: var(--border);
  border: none;
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.player__content {
  margin-top: 8px;
}

.player__tracks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.player__tracks button {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: var(--border);
  color: var(--text);
  cursor: pointer;
}

.player__tracks button.active {
  background: var(--accent);
  color: #000;
}

.player--collapsed .player__content {
  display: none;
}

.player__controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: flex-start;
}

.player__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.player__arrow {
  width: 64px;
  height: 100%;
  border-radius: 8px;
  border: none;
  background: var(--border);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.player__arrow:active {
  transform: scale(0.95);
}

.player__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.player__video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.player__video,
#audioPlayer,
.player__empty {
  display: none;
}

.player__empty {
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.logo__thin {
    font-weight: 400;
    color: var(--muted);
}

/* MENU (mobile songs) */
.menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
}

.menu.active {
  display: flex;
}

.menu__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.menu__list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: auto;
}

.menu__list li {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.sidebar__logo {
    font-weight: bolder;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar__logo img {
    width: 20px;
    height: 20px;
}



/* RESPONSIVE */

.player__arrow {
    display: none;
}
@media (max-width: 768px) {
    .player__arrow {
        display: inline-block;
    }
  .app {
    flex-direction: column;
  }

  .topbar {
    display: flex;
  }

  .sidebar {
    display: none;
  }

  .player {
    position: sticky;
    bottom: 0;
  }

  .sidebar__logo {
    display: none;
  }
}

html, body {
  overscroll-behavior: none;
  touch-action: manipulation;
}