/* ============================================================
   TOP BAR
============================================================ */
.simple-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0);
  backdrop-filter: blur(4px);
  z-index: 3000;
  pointer-events: none; /* Allow drag events to pass through */
}

.simple-topbar * {
  pointer-events: auto; /* But allow clicks on content inside */
}

.rah-nav-toggle {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 12px;
  color: #ffffff;
}

.rah-topbar-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #ffffff;
}

/* ============================================================
   OPAQUE MENU PANEL (replaces previous frosted attempts)
============================================================ */
.rah-nav-panel {
  position: absolute;
  top: 48px;
  left: 8px;
  right: auto;

  background: #101522;                 /* FULLY OPAQUE NAVY-BLACK */
  color: #ffffff;

  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);

  box-shadow: 0 4px 14px rgba(0,0,0,0.45);

  padding: 8px 0;
  display: none;
  flex-direction: column;

  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 3001;
}

/* When open */
.rah-nav-panel.open {
  display: flex;
}

/* Menu links */
.rah-nav-panel a {
  padding: 10px 16px;
  font-size: 15px;
  color: #ffffff;
  text-decoration: none;
  display: block;
  white-space: nowrap;
}

.rah-nav-panel a:hover {
  background: rgba(255,255,255,0.10);
}

/* Submenu system */
.submenu-title {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border-top: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.submenu-title:hover {
  background: rgba(255,255,255,0.15);
}

.submenu {
  display: none;
  flex-direction: column;
  padding-left: 0;
  margin: 0;
}

.submenu.open {
  display: flex;
}

.submenu li {
  list-style: none;
}

.submenu a {
  padding: 8px 24px;
  font-size: 14px;
  color: #ffffff;
}

/* ============================================================
   GLOBAL BASE
============================================================ */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Open Sans", sans-serif;
  background: radial-gradient(circle at top left, #2b4b7d 0%, #1a2335 35%, #0e111a 70%, #050609 100%);
  color: #f5f5f5;
}

#app {
  min-height: 100vh;
  box-sizing: border-box;
}

/* ============================================================
   FIXED VOICE BAR + NOW PLAYING BAR
============================================================ */

.voice-header,
.now-playing-row {
  position: fixed;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  box-sizing: border-box;
}

/* VOICE BAR */
.voice-header {
  top: 58px;
  height: 80px;  /* Increased from 70px to fit both selectors comfortably */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;  /* Slightly increased gap for breathing room */
  padding: 10px 14px;
  z-index: 2500;
  pointer-events: none;
}

.voice-header * {
  pointer-events: auto;
}

/* Hide voice title - not needed since it's in the selector */
.voice-title {
  display: none;
}

/* Concert selector - full width */
.concert-select-wrapper {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
}

.concert-select-wrapper label {
  display: none;  /* Hide label */
}

.concert-select-wrapper select {
  width: 100%;
  padding: 6px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}

/* Voice selector wrapper - just contains the select */
.selectors-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.voice-select-wrapper {
  width: 100%;
  max-width: 280px;
  display: flex;
  justify-content: center;
}

.voice-select-wrapper label {
  display: none;  /* Hide label */
}

.voice-select-wrapper select {
  width: 100%;
  padding: 6px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
  .concert-select-wrapper {
    max-width: 100%;
  }
  
  .voice-select-wrapper {
    max-width: 220px;
  }
}

/* NOW PLAYING BAR */
.now-playing-row {
  top: 132px; /* 58 + 80 - adjusted for new voice header height */
  height: 44px;
  padding: 10px 14px;
  z-index: 2499;
  pointer-events: none; /* Allow drag events to pass through */
}

.now-playing-row * {
  pointer-events: auto; /* But allow clicks on content inside */
}

.now-playing-header {
  font-size: 18px;
  font-weight: 600;
  opacity: 0.95;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  color: #f4e8a8;
}

.mode-indicators {
  margin-left: 8px;
  font-size: 16px;
  opacity: 0.9;
}

.mode-indicators .inactive { color: rgba(255,255,255,0.4); }
.mode-indicators .active   { color: #ff4d4d; }

/* ============================================================
   MAIN CONTENT
============================================================ */
#mainContent {
  padding: 8px;
  padding-top: 176px; /* 58 + 80 + 44 */
  padding-bottom: 150px;
  box-sizing: border-box;
}

#offlineBanner {
  display: none;
  position: fixed;
  top: 176px; /* 58 + 80 + 44 */
  left: 0;
  right: 0;
  background: rgba(179,0,0,0.9);
  color: #ffffff;
  padding: 8px 14px;
  text-align: center;
  font-size: 14px;
  z-index: 3500;
  border-bottom: 2px solid #ff4d4d;
}

.playlist-container {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 0px;
}

/* Boost z-index during active drag to ensure drag works over headers */
#playlistContainer.drag-active {
  position: relative;
  z-index: 3500;
}

/* ============================================================
   REORDER BUTTON & SORT SELECTOR
============================================================ */
.reorder-toggle-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.sort-order-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.sort-order-selector label {
  color: #ffffff;
  opacity: 0.85;
  font-size: 13px;
  white-space: nowrap;
}

.sort-order-selector select {
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 6px;
  background: rgba(255,255,255,0.10);
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
}

.sort-order-selector select:hover {
  background: rgba(255,255,255,0.15);
}

.reorder-toggle-btn {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 6px 14px;
  color: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.reorder-toggle-btn:hover {
  background: rgba(255,255,255,0.18);
}

/* ============================================================
   CACHE CONTROLS
============================================================ */
.cache-controls {
  margin: 20px 0;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.cache-status {
  font-size: 13px;
  opacity: 0.85;
  text-align: center;
}

.clear-cache-btn {
  background: rgba(179,0,0,0.2);
  border: 1px solid rgba(255,77,77,0.4);
  padding: 8px 20px;
  color: #ff9999;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.clear-cache-btn:hover {
  background: rgba(179,0,0,0.3);
  border-color: rgba(255,77,77,0.6);
}

/* ============================================================
   PLAYLIST ROWS
============================================================ */
.playlist-item {
  position: relative;
  padding: 9px 4px;
  display: flex;
  align-items: center;
}

.playlist-item + .playlist-item {
  border-top: 1px solid rgba(255,255,255,0.12);
}

.playlist-item.playing {
  background: rgba(179,0,0,0.12);
  border-left: 3px solid #ff4d4d;
}

/* Buffer slots for reorder mode */
.playlist-item.buffer-slot {
  min-height: 50px;
  background: transparent;
  border: none;
  pointer-events: none;
}

.playlist-item.buffer-slot .buffer-slot-content {
  height: 50px;
  opacity: 0;
}

.playlist-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.row-play-btn {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
}

.row-select { flex: 0 0 auto; }

.row-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-title a {
  color: #fff;
  text-decoration: none;        /* remove underline */
}

.row-title a:hover {
  text-decoration: none;   /* OPTIONAL: underline on hover */
}

/* Sheet icon */
.sheet-icon {
  font-size: 18px;
  color: #ffd966;
}

/* ============================================================
   REPEAT BUBBLES
============================================================ */
.repeat-bubble {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
}

.repeat-flyout {
  position: absolute;
  z-index: 5000;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.4);
  display: flex;
  gap: 8px;
}

.repeat-flyout button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

/* ============================================================
   REORDER BUTTONS & DRAG HANDLE
============================================================ */
.reorder-controls {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  gap: 6px;
  align-items: center;
}

.reorder-controls button {
  width: 32px;
  height: 26px;
  border-radius: 4px;
  background: #f5f5f5;
  border: 1px solid #ccc;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reorder-controls button:hover {
  background: #e0e0e0;
}

.drag-handle {
  width: 28px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #999;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s;
}

.drag-handle:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

.drag-handle:active {
  cursor: grabbing;
}

/* Dragging states */
.playlist-item.dragging {
  opacity: 0.4;
}

.playlist-item.drag-placeholder {
  background: rgba(255, 77, 77, 0.2);
  border: 2px dashed rgba(255, 77, 77, 0.5);
  border-radius: 4px;
}

.reorder-mode .playlist-item { 
  padding-left: 120px; /* Increased to accommodate drag handle */
}

.reorder-mode .reorder-controls { 
  display: flex; 
}

/* ============================================================
   PLAYER BAR
============================================================ */
#playerBar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  padding: 6px 8px 10px;
  z-index: 2000;
}

.player-controls-row {
  display: flex;
  justify-content: center;
}

.transport-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 40px;

  width: 100%;          /* FIX: full width pillbox */
  max-width: 100%;      /* prevents shrinking */

  border-radius: 4px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.transport-btn {
  border: none;
  background: transparent;
  color: #fff;
  border-right: 1px solid rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

.transport-btn:hover {
  background: rgba(255,255,255,0.1);
}

.transport-loop,
.transport-shuffle {
  font-size: 26px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transport-shuffle svg {
  width: 20px;
  height: 20px;
}

.toggle-icon-active {
  color: #ff4d4d !important;
}

#mainAudio {
  width: 100%;
  filter: invert(1) hue-rotate(180deg) brightness(1.2);
  border-radius: 0px;          /* MATCH transport-group */
}

.audio-shell {
  position: relative;
  border-radius: 0px;          /* MATCH transport-group */
  overflow: hidden;            /* ensures corners look clean */
}

audio::-webkit-media-controls {
  border-radius: 8px !important;
}
/* ============================================================
   LYRICS SYSTEM
============================================================ */
.transport-lyrics {
  font-size: 24px;
  font-weight: bold;
}

.transport-lyrics.toggle-icon-active {
  background: rgba(255, 77, 77, 0.3);
  border-color: rgba(255, 77, 77, 0.6);
}

.lyrics-panel {
  position: fixed;
  background: black;
  color: white;
  z-index: 4000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Portrait: Top of screen above Now Playing bar */
@media (orientation: portrait) {
  .lyrics-panel {
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(100vh - 142px); /* 142px = headers height */
    min-height: 200px;
  }
}

/* Landscape: Full screen */
@media (orientation: landscape) {
  .lyrics-panel {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
  }
}

.lyrics-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4001;
  opacity: 0.6;
}

.lyrics-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.lyrics-content {
  font-size: 24px;
  line-height: 1.6;
  text-align: center;
  max-width: 90%;
}

.lyrics-line {
  margin: 8px 0;
  opacity: 0;
  display: none;
}

.lyrics-line.active {
  opacity: 1;
  display: block;
  font-weight: 400;
  color: white;
}

/* Responsive font sizing */
@media (orientation: landscape) {
  .lyrics-content {
    font-size: 32px;
  }
}

@media (max-width: 600px) {
  .lyrics-content {
    font-size: 20px;
  }
}

.lyrics-audio-toggle {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  z-index: 4001;
  opacity: 0.7;
  white-space: nowrap;
}

.lyrics-audio-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}
