/* ===== RADIO THEME (POP) ===== */
/* Ponlo en: Assets/tenants/{tenantId}/theme.css */

:root{
  /* Fondo */
  --bg1:#ff4fd8;
  --bg2:#35d6ff;
  --bg3:#7dff6a;

  /* Texto */
  --ink:#0b1020;
  --inkSoft: rgba(0,0,0,.72);

  /* Superficies */
  --paper:#ffffff;
  --paper2:#fff6df;

  /* Bordes + sombras estilo sticker */
  --strokeColor: rgba(0,0,0,.82);
  --stroke: 3px solid var(--strokeColor);
  --shadow: 0 18px 0 rgba(0,0,0,.18);
  --shadow2: 0 12px 0 rgba(0,0,0,.14);

  --r: 22px;

  /* Safe areas */
  --safeB: env(safe-area-inset-bottom, 0px);
  --safeT: env(safe-area-inset-top, 0px);
}

/* ===== Background animated ===== */
html,body{height:100%}
body{
  margin:0;
  font-family: ui-rounded, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--ink);
  min-height: 100dvh;
  overflow-x:hidden;

  background:
    radial-gradient(90% 90% at 20% 10%, rgba(255,255,255,.45), transparent 55%),
    linear-gradient(120deg, var(--bg1), var(--bg2), var(--bg3));
  background-size: 200% 200%;
  animation: bgMove 10s ease-in-out infinite;
}

@keyframes bgMove{
  0%,100%{background-position: 0% 30%}
  50%{background-position: 100% 70%}
}

/* Si quieres desactivar animaciones en usuarios que lo pidan */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ===== Layout helpers ===== */
.page{
  min-height:100dvh;
  padding-top: calc(16px + var(--safeT));
  padding-bottom: calc(16px + var(--safeB));
  display:grid;
  grid-template-rows:auto 1fr auto;
  gap: 14px;
}

.wrap{
  width: min(760px, 100%);
  margin:0 auto;
  padding: 0 14px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* ===== Card base ===== */
.card{
  background: var(--paper);
  border: var(--stroke);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
}

/* “Sticker corner” */
.card::after{
  content:"";
  position:absolute;
  right:-20px; top:-20px;
  width:70px; height:70px;
  background: rgba(0,0,0,.08);
  border: var(--stroke);
  border-left:0;
  border-bottom:0;
  transform: rotate(12deg);
  border-top-right-radius: 24px;
  pointer-events:none;
}

/* ===== Hero ===== */
.hero{
  padding:16px;
  display:flex;
  gap:12px;
  align-items:center;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.80));
}

.logo{
  width:56px; height:56px;
  border-radius: 16px;
  border: var(--stroke);
  overflow:hidden;
  box-shadow: var(--shadow2);
  background: var(--paper2);
  flex:0 0 auto;
  transform: rotate(-2deg);
}
.logo img{width:100%; height:100%; object-fit:cover; display:block}

.heroText{min-width:0}
.heroText h1{
  margin:0;
  font-size: 28px;
  line-height:1.1;
  letter-spacing: .2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.heroText p{
  margin:6px 0 0;
  font-size: 13.5px;
  color: var(--inkSoft);
}

.heroActions{
  margin-left:auto;
  display:flex;
  gap:10px;
  align-items:center;
  flex:0 0 auto;
}

/* ===== Buttons ===== */
.btn{
  cursor:pointer;
  border: var(--stroke);
  background: var(--paper2);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 16px;
  font-weight: 900;
  display:inline-flex;
  align-items:center;
  gap:10px;
  box-shadow: var(--shadow2);
  transition: transform .12s ease, filter .12s ease;
  user-select:none;
  white-space:nowrap;
}
.btn:hover{transform: translateY(-2px)}
.btn:active{transform: translateY(0) scale(.98)}
.btn:focus-visible{outline: 3px solid rgba(0,0,0,.35); outline-offset: 3px}

.btnPrimary{
  background: linear-gradient(90deg, #ffe86a, #ff9bd6);
}

/* ===== Player (Boombox) ===== */
.boombox.player{
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.75));
}

.rowTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  margin-bottom: 12px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border: 2px solid var(--strokeColor);
  border-radius:999px;
  background: #ff6a87;
  color: #0b1020;
  font-weight: 1000;
  box-shadow: var(--shadow2);
}

.liveDot{
  width:10px; height:10px;
  border-radius:999px;
  background:#0b1020;
  animation: blink 1s steps(2,end) infinite;
}
@keyframes blink{50%{opacity:.3}}

.eq{
  display:flex;
  gap:5px;
  align-items:flex-end;
  height: 24px;
  padding: 8px 10px;
  border: 2px solid var(--strokeColor);
  border-radius: 16px;
  background: rgba(0,0,0,.06);
  box-shadow: var(--shadow2);
}
.eq .bar{
  width:6px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  transform-origin: bottom;
  animation: dance .9s ease-in-out infinite;
}
.eq .bar:nth-child(2){animation-delay:.08s}
.eq .bar:nth-child(3){animation-delay:.16s}
.eq .bar:nth-child(4){animation-delay:.24s}
.eq .bar:nth-child(5){animation-delay:.32s}
.eq .bar:nth-child(6){animation-delay:.40s}
.eq .bar:nth-child(7){animation-delay:.48s}
@keyframes dance{
  0%,100%{transform:scaleY(.3); opacity:.9}
  50%{transform:scaleY(1.2); opacity:1}
}
.eq.paused .bar{
  animation-duration: 2.3s;
  opacity:.55;
  transform: scaleY(.25);
}

.controls{
  display:flex;
  gap:12px;
  align-items:center;
}

.bigPlay{
  border: var(--stroke);
  border-radius: 18px;
  background: linear-gradient(90deg, #7dff6a, #ffe86a);
  padding: 12px 14px;
  font-weight: 1000;
  display:flex;
  align-items:center;
  gap:10px;
  box-shadow: var(--shadow2);
  cursor:pointer;
  user-select:none;
  min-width: 118px;
  justify-content:center;
  transition: transform .12s ease;
}
.bigPlay:hover{transform: translateY(-2px)}
.bigPlay:active{transform: translateY(0) scale(.98)}
.bigPlay:focus-visible{outline: 3px solid rgba(0,0,0,.35); outline-offset: 3px}

.track{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.tiny{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  color: var(--inkSoft);
  gap:10px;
}

.progress{
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--strokeColor);
  background: rgba(0,0,0,.06);
  overflow:hidden;
  box-shadow: var(--shadow2);
}
.fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--bg2), var(--bg1), var(--bg3));
  transition: width .18s linear;
}

.volRow{
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:flex-end;
  font-size: 12px;
  color: var(--inkSoft);
}
.range{width: 140px; accent-color: var(--bg1);}

/* Mobile tweaks */
@media (max-width: 520px){
  .heroText h1{font-size: 24px}
  .controls{align-items:flex-start}
  .range{width: 120px}
}

/* ===== Carousel (Polaroid) ===== */
.polaroid.carousel{
  padding: 14px 14px 16px;
  background: var(--paper2);
}

.frame{
  border: 2px solid var(--strokeColor);
  border-radius: 18px;
  background:#000;
  aspect-ratio: 16/10;
  overflow:hidden;
  position:relative;
  box-shadow: var(--shadow2);
  transform: rotate(1deg);
}

.slide{
  position:absolute; inset:0;
  opacity:0;
  transform: scale(.98) rotate(-1deg);
  transition: opacity .35s ease, transform .55s cubic-bezier(.2,.9,.2,1);
}
.slide.active{
  opacity:1;
  transform: scale(1) rotate(0deg);
}
.slide img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  filter: saturate(1.15) contrast(1.03);
}

.cap{
  position:absolute;
  left:10px; right:10px; bottom:10px;
  background: rgba(255,255,255,.88);
  border: 2px solid var(--strokeColor);
  border-radius: 14px;
  padding: 10px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  transform: translateY(6px);
  opacity:.98;
}
.slide.active .cap{
  animation: popIn .45s ease;
}
@keyframes popIn{
  0%{transform: translateY(12px) scale(.98)}
  100%{transform: translateY(0) scale(1)}
}

.nav{
  margin-top: 12px;
  display:flex;
  align-items:center;
  gap:10px;
}
.dots{
  display:flex;
  gap:8px;
  flex:1;
  justify-content:center;
  align-items:center;
}
.dots button{
  width:10px; height:10px;
  border-radius:999px;
  border: 2px solid var(--strokeColor);
  background: rgba(0,0,0,.12);
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, width .12s ease;
}
.dots button:hover{transform: scale(1.08)}
.dots button.active{
  background: rgba(0,0,0,.85);
  width:26px;
}

/* ===== Optional socials card (si luego la activas) ===== */
.socials{
  padding: 14px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  background: rgba(255,255,255,.86);
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 2px solid var(--strokeColor);
  background: #fff;
  box-shadow: var(--shadow2);
  text-decoration:none;
  color: var(--ink);
  font-weight: 900;
  transition: transform .12s ease;
}
.chip:hover{transform: rotate(-2deg) translateY(-2px)}
.chip svg{opacity:.9}


/* ===== ANTI OVERFLOW DEFINITIVO (MOBILE) ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body { margin: 0; }

.page { width: 100%; max-width: 100%; overflow-x: hidden; }
.wrap { width: 100%; max-width: 760px; overflow-x: hidden; }

/* Asegura que NINGÚN bloque pueda pasar el ancho */
.wrap > * { max-width: 100%; }
.card { max-width: 100%; }

@media (max-width: 560px){

  /* Esto elimina el “ancho extra visual” del shadow offset en móvil */
  .card{
    box-shadow: 0 18px 40px rgba(0,0,0,.18) !important; /* sombra normal */
  }

  /* Bordes gruesos + padding pueden apretar: bajamos 1px en móvil */
  :root{
    --stroke: 2px solid var(--strokeColor) !important;
  }

  /* Si tu chip o botones empujan, evita que se estiren */
  .btn, .bigPlay, .chip{
    max-width: 100%;
  }

  /* Si alguna imagen/a tag está empujando (link del slide) */
  .frame, .slide, .slide a, .slide img{
    max-width: 100%;
  }

  /* También evita que el caption haga overflow */
  .cap{
    max-width: 100%;
    overflow: hidden;
  }
  .cap h3, .cap p{
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}