/* ═══ Radio La Caletta — Layout ═══ */

#main, #sidebar { padding-top: env(safe-area-inset-top, 0px); }
.tab-bar {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(48px + env(safe-area-inset-bottom, 0px));
}

/* ── Sidebar ── */
#sidebar {
  position: fixed; left: 0; top: 0;
  height: 100%; width: 250px;
  box-shadow: 0 0 20px rgba(0,0,0,1);
  background: hsl(0,0%,16%);
  z-index: 21; transition: all 500ms;
  user-select: none; display: flex; flex-direction: column;
}
#sidebar.closed { left: -250px; }
@media (max-width: 768px) {
  #sidebar { width: 100vw; }
  #sidebar.closed { left: -100vw; }
}

.sidebar-header { padding: 10px; display: flex; align-items: center; }
.sidebar-hamburger {
  color: #fff; font-size: 24px; width: 24px; height: 24px;
  margin-right: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-hamburger:hover { transform: scale(1.5); }

.channels { margin-top: 20px; flex: 1; overflow-y: auto; }
.channels h2 { color: #fff; margin-bottom: 20px; }
.channels ul { list-style: none; }
.channel-link {
  display: block; padding: 20px;
  background: hsl(0,0%,16%);
  border-bottom: 2px solid rgba(68,68,68,0.7);
  color: #fff; text-decoration: none;
  font-size: 14px; text-align: left;
  transition: background 200ms;
}
.channel-link:hover, .channel-link.active { background: rgba(68,68,68,0.7); }

.brand { padding: 20px; text-align: center; }
.brand a { font-size: 10px; color: #fff; text-decoration: none; opacity: .6; transition: 300ms all; }
.brand a:hover { font-size: 12px; opacity: 1; }
.brand .heart { color: red; }

#backdrop {
  display: none; position: fixed;
  background: rgba(17,17,17,0.7);
  width: 100%; height: 100%; left: 0; top: 0; z-index: 20;
}
#backdrop.show { display: block; }

/* ── Main ── */
#main {
  position: absolute; left: 250px; top: 0;
  width: calc(100% - 250px); height: 100%;
  transition: left 500ms, width 500ms;
  display: flex; flex-direction: column;
}
#main.full { left: 0; width: 100%; }

.bg-blur-wrap {
  position: absolute; height: 100%; width: 100%; top: 0; left: 0;
  overflow: hidden; z-index: 0;
}
.bg-blur {
  position: absolute; height: 120%; width: 120%; top: -10%; left: -10%;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  filter: blur(14px); -webkit-filter: blur(14px); opacity: 0.3;
  transition: opacity 1s ease;
}
.bg-blur.b { opacity: 0; }
.bg-blur.b.active { opacity: 0.3; }
.bg-blur.a { opacity: 0.3; }
.bg-blur.a.fade-out { opacity: 0; }

/* ── Header ── */
.x-header {
  position: absolute; top: 0; right: inherit;
  z-index: 3; width: 100%; height: 80px; overflow: hidden;
  display: flex; align-items: center; justify-content: flex-end;
  background: inherit; text-align: right;
}
.h1-title { font-size: 12px; max-width: 200px; margin: 0 80px 0 0; }
.img-logo {
  height: 50px; width: 50px; position: absolute;
  border-radius: 3px; right: 15px; top: 15px; object-fit: cover;
}
@media (max-height: 400px) {
  .x-header { height: 50px; }
  .x-header h1, .x-header .img-logo { display: none; }
}

/* ── Tab Bar ── */
.tab-bar {
  position: relative; bottom: auto; left: auto;
  width: 100%; height: 48px;
  background: hsl(0,0%,16%);
  padding: 0; margin: 0; list-style: none;
  display: flex; align-items: center; justify-content: center;
  z-index: 9; box-shadow: 0 0 20px rgba(0,0,0,1);
  flex-shrink: 0;
}
.tab-bar.full { left: 0; width: 100%; }
.tab-bar li { width: 100%; height: 100%; }
.tab-bar li a {
  display: inline-block; text-decoration: none;
  width: 100%; height: 100%; color: #fff;
  transition: background 200ms;
}
.tab-bar li a:hover { background: rgb(68,68,68); }
.tab-bar li a.active { background: rgba(68,68,68,0.7); }
.tab-bar li a span {
  display: inline-block; color: #fff;
  line-height: 48px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; text-transform: uppercase;
}
.tab-bar li a i {
  color: #fff; line-height: 48px; font-size: 20px;
  text-transform: uppercase; display: none;
}
@media (max-width: 800px) {
  .tab-bar li a i { display: inline-block; }
  .tab-bar li a span { display: none; }
}

/* ── Tab Content ── */
.tab-content {
  position: relative; top: 80px; z-index: 1;
  width: 100%; flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding-bottom: var(--next-up-h, 0px);
  box-sizing: border-box;
}
.tab-panel {
  position: absolute; top: 0; left: 0; bottom: 80px; width: 100%;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; pointer-events: none; box-sizing: border-box;
  display: none; animation: none;
}
@media (max-height: 400px) { .tab-panel { padding-top: 50px; } }
.tab-panel.active {
  display: block;
  opacity: 1; pointer-events: auto;
  animation: fadeIn 300ms ease both;
}

/* ── Next Up Box ── */
.next-up-box {
  display: none; background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
  padding: 10px 14px; position: relative; width: calc(100% - 40px);
  margin: 0 20px 4px;
}
.next-up-label { font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 8px; }
.next-up-row { display: flex; gap: 10px; align-items: center; }
.next-up-thumb {
  width: 42px; height: 42px; border-radius: 7px;
  background: rgba(0,0,0,0.3); overflow: hidden;
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.next-up-thumb img { position: absolute; top:0;left:0;width:100%;height:100%; object-fit:cover; opacity:0; transition:opacity .3s; }
.next-up-thumb img.ok { opacity: 1; }
.next-up-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-up-artist { font-size: 11px; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
