/* =========================================================
   Nostr Streams – Layout
   ========================================================= */

/* ---------- Desktop base layout ---------- */

.streams-layout {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  margin: 20px auto;
  gap: 20px;
  padding: 0 20px;
}

.streams-sidebar {
  width: 200px;
  background: #111;
  border-radius: 10px;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 70px;
}

.sidebar-item {
  background: transparent;
  border: none;
  color: #eee;
  text-align: left;
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-item:hover {
  background: #1d1d1d;
}

.sidebar-item.active {
  background: #007bff;
  color: #fff;
}

.sidebar-group-title {
  padding: 4px 16px 8px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

/* ---------- Main content ---------- */

.streams-main {
  flex: 1;
}

/* ---------- Stream grid ---------- */

#live-streams,
#nostr-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 0fr));
  gap: 16px;
  padding: 10px 10px 20px;
  max-width: 100%;
  margin: 10px auto 24px;
  box-sizing: border-box;
}

/* ---------- Stream cards ---------- */

.live-card {
  background: #181818;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.07);
}

.live-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(255,255,255,0.15);
}

.live-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.live-info {
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  height: 260px;  /* fixed height keeps every card perfectly even */
  overflow: hidden; /* nothing can spill below the card */
}


/* outer box gives padding/background */
.live-title{
  margin-bottom: 9px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 4px 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);

  line-height: 1.3;
  min-height: calc(1.3em * 2 + 2px);  /* ✅ reserves 2 lines even if title is 1 */
}


/* inner text is what gets clamped */
.live-title-text{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;

  font-size: 0.95rem;
  font-weight: bold;
  color: #fff;

  line-height: 1.3;               /* ✅ slightly more descender room */
  max-height: calc(1.3em * 2);    /* ✅ clamp height matches line-height */
}



.live-zap-row{
  padding-top: 4px;
}

.live-streamer {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.9rem;
  line-height: 1.3;
  color: #bbb;
  margin-bottom: 10px;

  /* Always reserve exactly two username lines. */
  height: calc(1.3em * 2 + 8px);
  min-height: calc(1.3em * 2 + 8px);
  max-height: calc(1.3em * 2 + 8px);
  overflow: hidden;
  flex-shrink: 0;
}

/* Long names may wrap to line two, but never create a third row. */
.live-streamer {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.live-country-flag {
  flex: 0 0 auto;
}

.stream-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 22px;
}

.live-actions {
  margin-top: auto;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
/* Base button */
.watch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  text-decoration: none;
  border: none;
  white-space: nowrap;
  color: #fff;

  /* Helps on pink + blue */
  text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}

/* Variants */
.watch-btn { background-color: #f838d9; }
.watch-btn:hover { background-color: #f77de3; }

.watch-btn.secondary {
  background-color: #007bff;

  margin-top: 0;
  margin-bottom: 6px;

  border-bottom: none;

  flex-basis: 100%;
  justify-content: flex-start;

  padding: 5px 10px;     /* ← bigger */
  font-size: 0.95rem;   /* ← slightly larger text */
  border-radius: 8px;   /* optional, feels nicer */
}

.watch-btn.secondary:hover { background-color: #4fa1f9; }

/* Shosho (aqua) — needs dark text for contrast */
.watch-btn.third {
  background-color: #60c5c1;
  color: #fff;
  font-weight: 600;

    text-shadow:
    0 1px 2px rgba(0,0,0,0.45),
    0 0 1px rgba(0,0,0,0.6);

}
.watch-btn.third:hover { background-color: #83bfbd; }

/* Invisible spacer that still takes up space */
.watch-btn.placeholder {
  visibility: hidden;
  pointer-events: none;
}

.watch-label {
  font-size: 15px;
    margin-top: 6px;   /* push it down from live-zap-row */
  display: block;    /* ensure margin applies consistently */
}

/* Other UI boxes */
.live-streamer,
.live-zap-row {
  background: rgba(255,255,255,0.04);
  padding: 4px 8px;
  border-radius: 6px;
}




/* =========================================================
   Mobile layout
   ========================================================= */


   /* =========================================================
   Early shrink (fix “big empty right space” around ~768-900px)
   Put this ABOVE your @media (max-width: 768px)
   ========================================================= */
@media (max-width: 900px) {

  /* sidebar + content should be stacked, not “desktop reserved space” */
  .streams-layout {
    flex-direction: column;
  }

  .streams-sidebar {
    width: 100%;
    position: static;     /* stop sticky */
    top: auto;
  }

  .streams-main {
    width: 100%;
  }

  /* make grid truly fill the screen */
  #live-streams,
  #nostr-videos {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
}



@media (max-width: 768px) {

  .streams-layout {
    flex-direction: column;
    gap: 12px;
    padding: 10px;
  }

  .streams-sidebar {
    position: static;
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    overflow: visible;
  }

  .sidebar-item {
    width: 100%;
    padding: 10px 14px;
    white-space: normal;
  }

  #live-streams {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
    margin: 0;
  }

  .live-thumb {
    height: auto;
    max-height: 220px;
  }

  .live-info {
    padding: 10px 12px;
  }

  .live-title {
    font-size: 0.95rem;
  }
}

/* =========================================================
   Mobile sidebar toggle
   ========================================================= */

.sidebar-toggle {
  display: none;
  width: 100%;
  background: #111;
  color: #eee;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  justify-content: space-between;
  align-items: center;
}

.sidebar-toggle .chev {
  opacity: 0.8;
  transition: transform 0.15s ease;
}


/* Desktop: never show the toggle button */
@media (min-width: 901px) {
  .sidebar-toggle {
    display: none !important;
  }

  .sidebar-list {
    display: flex !important; /* always show filters on desktop */
  }
}



/* Sidebar list (desktop default = visible) */
.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Toggle behavior on mobile */
@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }

  .sidebar-list {
    display: none;
    margin-top: 8px;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
  }

  .streams-sidebar.open .sidebar-list {
    display: flex;
  }

  .streams-sidebar.open .sidebar-toggle .chev {
    transform: rotate(180deg);
  }
}

/* =========================================================
   Badges & extras
   ========================================================= */

.live-zap-count {
  font-size: 13px;
  opacity: 0.9;
}

.live-country-flag {
  font-size: 0.9em;
  margin-right: 6px;
}

/* Thumbnail aspect ratio lock */
.live-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;   /* 🔒 force uniform thumbnails */
  overflow: hidden;
  background: #000;
}


.live-badge-row {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
}

.live-badge {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

/* Reserve room inside the purple LIVE pill for the LFL dot. */
.live-badge.purple {
  background: #8a2be2;
  padding-right: 31px;
}

.live-badge.blue { background: #2196f3; }

/* Blue LFL dot — positioned inside the purple LIVE pill. */
.lfl-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2196f3;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);

  /* subtle 3D */
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 1px rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.35);
}


/* allow buttons to wrap instead of disappearing */
.live-buttons{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* make the blue LFL button its own full-width row */
.watch-btn.secondary{
  flex-basis: 100%;
}



.live-zap-count {
  font-size: 13px;
  opacity: 0.95; /* keep container slightly muted */
}

.live-zap-count .zap-num {
  color: #fff;       /* your cards are dark; use white for numbers here */
  font-weight: 600;
  opacity: 1;        /* override container fade */
}

.live-zap-count .zap-dot {
  color: rgba(255,255,255,0.55);
  opacity: 1;
}

.live-zap-count .zap-sats {
  color: #f7931a;    /* Bitcoin orange */
  font-weight: 800;
  opacity: 1;
}

/* Streams stats bar */
.live-stats .z-num {
  color: inherit;
  font-weight: 600;
}

.live-stats .sats-symbol {
  color: #f7931a;        /* Bitcoin orange */
  font-weight: 800;
  opacity: 1;
}

.live-stats .s-num {
  color: inherit;
  font-weight: 600;
}


/* Prevent 250-country flash: hide country buttons until JS reveals them */
#sidebarList .sidebar-item[data-filter-region] {
  display: none;
}

/* Always show these */
#sidebarList .sidebar-item[data-filter-region="all"],
#sidebarList .sidebar-item[data-filter-region="global"],
#sidebarList .sidebar-item[data-filter-region="other"] {
  display: flex;
}
