/* Rooms widget (stacked above notifications) */

.sbb-notify{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.sbb-rooms{
  position: relative;
}

.sbb-rooms-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px) saturate(120%);
  z-index: 9998;
  display: none;
}

/* reuse notify button styling; only tweak icon */
.sbb-rooms-btn .icon svg{
  width: 22px;
  height: 22px;
}

/* Make the rooms count badge subtle (not red like notifications) */
.sbb-rooms-btn .sbb-notify-badge{
  background: rgba(30, 80, 160, .12);
  color: rgba(20, 35, 60, .92);
  border: 1px solid rgba(30, 80, 160, .18);
  box-shadow: none;
}

body:not(.theme-light) .sbb-rooms-btn .sbb-notify-badge{
  background: rgba(160, 195, 255, .14);
  color: rgba(235, 244, 255, .95);
  border: 1px solid rgba(160, 195, 255, .22);
}

.sbb-rooms-panel{
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 420px;
  max-height: min(640px, calc(100vh - 120px));
  overflow: hidden;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 380px at 35% 0%, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(520px 360px at 85% 120%, rgba(0,180,255,.10), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,248,255,.92));
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(130%) blur(10px);
  color-scheme: light;
  display: none;
  transition: width 160ms ease;
}

/* Embed mode: show as centered modal (works better on all screens) */
.sbb-rooms.embed-mode .sbb-rooms-overlay{ display: block; }

.sbb-rooms.embed-mode .sbb-rooms-panel{
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(1200px, calc(100vw - 28px));
  height: min(860px, calc(100vh - 28px));
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

/* In embed mode the list-only actions (Atualizar) wastes vertical space */
.sbb-rooms.embed-mode .sbb-rooms-actions{ display: none; }

@media (max-width: 900px) {
  .sbb-rooms.embed-mode .sbb-rooms-panel{
    left: 0;
    top: 0;
    transform: none;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sbb-rooms-iframe{ border-radius: 0; }
}

@media (max-width: 520px) {
  .sbb-rooms.embed-mode .sbb-rooms-overlay{
    backdrop-filter: none;
  }
}

body:not(.theme-light) .sbb-rooms-panel{
  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(560px 340px at 35% 0%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(520px 360px at 85% 120%, rgba(0,180,255,.10), transparent 55%),
    linear-gradient(180deg, rgba(12,16,28,.92), rgba(6,8,16,.92));
  color: #eef2ff;
  box-shadow: 0 22px 65px rgba(0,0,0,.28), 0 10px 22px rgba(0,0,0,.22);
  color-scheme: dark;
}

.sbb-rooms.open .sbb-rooms-panel{ display:block; }

/* When embedded, the panel must stay flex to let the iframe fill height */
.sbb-rooms.open.embed-mode .sbb-rooms-panel{ display:flex; }

.sbb-rooms-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  flex: 0 0 auto;
}

body:not(.theme-light) .sbb-rooms-head{ border-bottom: 1px solid rgba(255,255,255,.08); }

.sbb-rooms-head strong{ font-size: var(--notify-title); }

.sbb-rooms-actions{
  display:flex;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  flex: 0 0 auto;
}

body:not(.theme-light) .sbb-rooms-actions{ border-bottom: 1px solid rgba(255,255,255,.08); }

.sbb-rooms-actions button{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.7);
  cursor:pointer;
  font-weight: 800;
  font-size: 12px;
  color: inherit;
}

body:not(.theme-light) .sbb-rooms-actions button{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
}

.sbb-rooms-list{
  padding: 10px 14px 14px;
  overflow: auto;
  max-height: 360px;
}

.sbb-rooms-embed{
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sbb-rooms-iframewrap{
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 0;
}

.sbb-rooms-embedbar{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.sbb-rooms-embedbar button,
.sbb-rooms-embedbar a{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.7);
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  color: inherit;
  text-decoration: none;
}

body:not(.theme-light) .sbb-rooms-embedbar button,
body:not(.theme-light) .sbb-rooms-embedbar a{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
}

.sbb-rooms-embedtitle{
  font-size: 12px;
  font-weight: 900;
  opacity: .85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.sbb-rooms-iframe{
  width: 100%;
  flex: 1;
  min-height: 0;
  height: auto;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.18);
}

body:not(.theme-light) .sbb-rooms-iframe{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.35);
}

.sbb-rooms-empty{
  padding: 12px;
  opacity: .85;
}

.sbb-room-item{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.65);
  text-decoration: none;
  color: inherit;
  margin-bottom: 10px;
}

body:not(.theme-light) .sbb-room-item{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}

.sbb-room-item .meta{
  display:flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sbb-room-item .t{
  font-weight: 900;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sbb-room-item .s{
  font-size: 12px;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sbb-room-item .links{
  display:flex;
  gap: 8px;
  flex-shrink: 0;
}

.sbb-room-item .links a{
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.72);
  color: inherit;
  text-decoration: none;
}

body:not(.theme-light) .sbb-room-item .links a{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
