
/* === Main live layout: video on left, chat on right === */

/* Flex row: video + chat */
.chat-area {
  display: flex;
  align-items: stretch;
  justify-content: flex-start; /* change from center */
  gap: 16px;
  margin-top: 16px;
  flex-wrap: nowrap;
}


/* Left side: video + title bar */
.video-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}










.chat-area {
  align-items: stretch; /* NEW: makes chat + video align to full height */
}





/* Collapse only the inner chat panel content */
#chatPanel.collapsed {
  display: none;
}






/* Live page: bar under video with country + title + summary */
.live-meta {
  margin-top: 6px;
  background: #111;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* TOP ROW: Country ┃ Title ┃ Backend (right) */
.live-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}





/* Country pill stays left */
.live-country-pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: #222;
  border: 1px solid #444;
  opacity: 0.95;
  white-space: nowrap;
  flex-shrink: 0;
}


.live-streamer-name {
  padding: 2px 8px;
  border-radius: 999px;
  background: #222;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0 8px;
  border: 1px solid #444;
  opacity: 0.95;
  white-space: nowrap;
}




/* Title expands to fill available space */
.live-title-text {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;           /* allow title to stretch */
  text-align: left;  /* keep text clean */
}

/* Backend pill on far right */
.live-backend-pill {
  background: #222;
  color: #bbb;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.9;
}



/* Summary stays full width under the row */
.live-summary-text {
  font-size: 0.8rem;
  color: #ccc;
  max-height: 2.6em; /* ~2 lines */
  overflow: hidden;
  text-align: left !important;
    display: block;        /* spans are inline by default */
  width: 100%;
  text-align: left;
}


.live-meta-bottom { 
  text-align: left; 
}






 .live-timer {
  font-family: monospace;
  font-size: 0.9rem;
  color: #ccc;
  margin-left: auto;   /* pushes timer + backend to the right side of the bar */
  margin-right: 8px;
}



.hidden {
  display: none !important;
}




/* Mobile layout for live meta bar */
@media screen and (max-width: 700px) {
  .live-meta-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
  }

  /* Title drops to its own line and can wrap */
  .live-title-text {
    flex-basis: 100%;
    white-space: normal;
    font-size: 0.9rem;
    margin-top: 2px;
  }

  /* Slightly smaller pills on mobile */
  .live-country-pill,
  .live-streamer-name,
  .live-backend-pill {
    font-size: 0.75rem;
    padding: 2px 6px;
  }

  /* Timer no longer forces everything to the right edge */
  .live-timer {
    margin-left: 0;
    margin-right: 0;
    font-size: 0.85rem;
  }
}


.live-voice-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  margin-left: 4px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  background: #2fa1ff; /* base blue */
  color: #000;
  white-space: nowrap;
}

.live-voice-button:hover {
  opacity: 0.9;
}

.live-voice-label {
  font-size: 0.8rem;
}

/* little X when streamer disables voice chat */
.live-voice-disabled-mark {
  display: none;
  font-size: 0.8rem;
  margin-left: 2px;
}

/* tiny status dot */
.live-voice-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 4px;
  background: #000;      /* offline / default: black-ish */
  opacity: 0.5;
}

/* when streamer disabled voice chat (config) */
.live-voice-button.voice-disabled {
  background: #555;
  color: #ddd;
}

.live-voice-button.voice-disabled .live-voice-disabled-mark {
  display: inline;
}

/* when video is actually live */
.live-voice-button.voice-live .live-voice-status-dot {
  background: #2fa1ff;   /* bright blue dot */
  opacity: 1;
  box-shadow: 0 0 4px rgba(47, 161, 255, 0.9);
}

/* when offline but feature enabled (no X, dark dot) */
.live-voice-button.voice-offline:not(.voice-disabled) .live-voice-status-dot {
  background: #000;
  opacity: 0.6;
}



/* ===== Right column: chat card / toggle / iframe ===== */

.chat-wrapper.card {
  background: #05060a;
  border-radius: 12px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}


/* Desktop-only: when chat is hidden, remove the whole right column */
@media screen and (min-width: 901px) {
  .chat-wrapper.hidden-desktop {
    display: none;
  }
}


/* Floating reopen tab when chat is hidden on desktop */
.chat-reopen-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 8px 0 0 8px;
  border: 1px solid #333;
  background: #05060a;
  color: #f5f5f5;
  font-size: 14px;
  cursor: pointer;
  z-index: 9999;
}

/* No floating tab on mobile */
@media screen and (max-width: 900px) {
  .chat-reopen-tab {
    display: none;
  }
}




/* Iframe wrapper */
.chat-iframe {
  border-radius: 10px;
  overflow: hidden;
}






/* Chat header: title + toggle button */
.chat-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

/* Title */
.chat-header-bar h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

/* Hide / Show chat button */
.chat-toggle-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
justify-content: flex-start;

  padding: 5px 10px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;

  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

/* Subtle hover */
.chat-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}





/* Iframe wrapper */
.chat-iframe {
  border-radius: 10px;
  overflow: hidden;
}





.chat-iframe {
  width: 100%;
  max-width: 100%;
}





/* Iframe wrapper */
.chat-iframe {
  border-radius: 10px;
  overflow: hidden;
}

/* Actual iframe */
.chat-iframe iframe {
  width: 100%;
  border: none;
  display: block;
  background: #000;

  height: 70vh;        /* main scaling */
  max-height: 90vh;    /* never exceed screen */
  min-height: 400px;   /* readable minimum */
}

/* Slightly smaller on narrow screens */
@media screen and (max-width: 900px) {
  .chat-iframe iframe {
    height: 60vh;
    min-height: 320px;
  }
}





/* ===== Right column: chat card / toggle / iframe ===== */

.chat-wrapper.card {
  background: #05060a;
  border-radius: 12px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* "💬 Live chat" toggle button */
.chat-toggle {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0b0d14;
  color: #f5f5f5;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-toggle:hover {
  background: #121623;
  border-color: #444;
}

/* Panel that contains the iframe */
#chatPanel {
  margin-top: 6px;
  transition: max-height 0.2s ease, opacity 0.2s ease;
}

/* When collapsed via JS */
#chatPanel.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}




/* Widgets / Badges */
.widget-container iframe {
  width: 100%;
  height: 300px;
  border: none;
  margin: 10px 0;
}

.badges-container {
  border: 2px solid purple;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}

.badges-container iframe {
  flex: 1;
  height: 60px;
  border: none;
}

.commentbox-container {
  margin-top: 15px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}



#sidebar {
  width: var(--sidebar-w, 360px);
  min-width: 260px;
  max-width: 700px;
}


#sidebarResizer {
  width: 8px;
  cursor: col-resize;
  flex: 0 0 8px;
  background: transparent;
  position: relative;
    z-index: 50;
}

#sidebarResizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  opacity: 0.35;
  background: #fff;
}


#sidebarResizer:hover::after { opacity: 0.7; }



/* While resizing, disable iframe mouse capture so drag works */
body.lfl-resizing iframe {
  pointer-events: none !important;
}



@media screen and (min-width: 901px) {
  .chat-wrapper.hidden-desktop {
    display: none;
  }

  /* NEW: hide the drag bar too when chat is hidden */
  .chat-wrapper.hidden-desktop + #sidebarResizer,
  #sidebarResizer.hidden-desktop {
    display: none !important;
  }
}



@media screen and (min-width: 901px) {
  #sidebarResizer.hidden-desktop {
    display: none !important;
  }
}



@media screen and (max-width: 900px) {
  .chat-area {
    flex-direction: column;
  }

  /* NEW: no drag bar on mobile */
  #sidebarResizer {
    display: none !important;
  }

  /* NEW: sidebar should be full width on mobile */
  #sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}




@media screen and (min-width: 901px) {
  #sidebarResizer.hidden-desktop {
    display: none !important;
  }
}



#sidebarResizer { touch-action: none; }
