/* ===================== */
/* ==== BASE =========== */
/* ===================== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #1e1e1e;
  color: white;

  display: flex;
  flex-direction: column;

  height: 100vh;
  gap: 80px;
  box-sizing: border-box;
}

/* ===================== */
/* ==== THEME TOGGLE === */
/* ===================== */
#themeToggle {
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 14px;
}

body.light #themeToggle {
  background: rgba(0,0,0,0.1);
  color: black;
}

/* ===================== */
/* ===== BOT SWITCH ==== */
/* ===================== */
.toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;

  color: #fff;
  cursor: pointer;

  font-size: 14px;
  font-weight: bold;
  height: 31px;
  padding: 0 10px;

  white-space: nowrap;
}

.chat-icon {
  width: 18px;
  height: 18px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 16px;
  top: 0.5px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;

  background-color: #444;
  transition: 0.3s;
  border-radius: 6px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;

  left: 2px;
  bottom: 2px;

  background-color: white;
  transition: 0.3s;

  border-radius: 4px;
}

.switch input:checked + .slider {
  background-color: #00c853;
}

.switch input:checked + .slider:before {
  transform: translateX(16px);
}

/* ===================== */
/* ==== TOPBAR ========= */
/* ===================== */
#topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  background: rgba(0,0,0,0.65);
  border-bottom: 1px solid rgba(255,255,255,0.2);

  min-height: 50px;
  padding: 6px 15px;

  gap: 1px;
  row-gap: 6px;

  z-index: 1001;
  margin-bottom: 0px;
}

#logo {
  height: 30px;
  margin-right: 10px;
  cursor: pointer;
  display: block;
}

#topbar-title {
  flex: 1 1 100px;
  max-width: 35%;

  color: #fff;
  font-size: 18px;
  font-weight: bold;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#topbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 6px;
  margin-left: auto;
}

/* ===================== */
/* ==== LAYOUT ========= */
/* ===================== */
.container {
  display: flex;
  gap: 12px;
  width: 85vw;

  flex: 1;
  min-height: 0;
  align-self: center;
}

/* ===================== */
/* ==== VIDEO ========== */
/* ===================== */
.video {
  position: relative;
  flex: 2;

  background: black;
  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  overflow: hidden;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* START OVERLAY */
.startOverlay {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.6);
  z-index: 10;
}

.startOverlay button {
  padding: 12px 18px;
  font-size: 16px;
  cursor: pointer;

  border: none;
  border-radius: 6px;

  background: #1f1f1f;
  color: white;
}

.startOverlay button:hover {
  background: #3B3B3B;
}

/* ===================== */
/* ==== CHAT =========== */
/* ===================== */
.chat {
  position: relative;
  flex: 1;

  display: flex;
  flex-direction: column;

  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  overflow: hidden;

  background: #111111;
}

.chat-header {
  font-size: 14px;
  padding: 10px;

  background: #111;
  border-bottom: 1px solid rgba(255,255,255,0.2);

  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  font-weight: 600;
}

.chat-logo {
  height: 16px;
  width: 16px;
  margin-right: -4px;
  vertical-align: middle;
}

/* ===================== */
/* ==== MESSAGES ======= */
/* ===================== */
.msg-line {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.2;

  word-break: break-word;
  animation: slideIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.timestamp {
  color: #666;
  font-size: 12px;
  margin-right: 3px;
  vertical-align: middle;
}

.badge {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 3px;
  line-height: 1;

  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.username {
  font-weight: 700;
  font-size: 14px;
  margin-right: 4px;

  vertical-align: middle;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.username:hover {
  background: rgba(255,255,255,0.12);
  cursor: pointer;
}

.text {
  vertical-align: middle;
  margin-right: -5px;
}

.msg-line[data-bot-name="botrix"] {
    background: rgba(0,150,255,0.12);
    border: 1px solid rgba(0,150,255,0.35);
    border-left: 3px solid #0096ff;
    border-radius: 6px;
    max-width: 100%;
	padding: 4px 6px;
}

.msg-line[data-bot-name="kickbot"] {
    background: rgba(136,38,217,0.12);
    border: 1px solid rgba(136,38,217,0.35);
    border-left: 3px solid #8826d9;
    border-radius: 6px;
    max-width: 100%;
	padding: 4px 6px;
}

/* ===================== */
/* ==== BADGES ========= */
/* ===================== */
.new-msg-badge {
  background-color: rgba(0,255,0,0.5);
  border-radius: 6px;
  color: #fff;

  display: block;
  font-size: 12px;
  font-weight: bold;

  margin-bottom: 2px;
  text-align: center;

  padding: 8px 8px;
  opacity: 1;

  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;

  overflow: hidden;
  max-height: 200px;
}

.new-msg-badge.fade-out {
  opacity: 0;
}

/* LIVE DOT */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;

  margin-right: 0px;
  border-radius: 50%;

  background: #ff3b3b;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.8);

  animation: pulseDot 1.5s infinite;
  vertical-align: middle;
}

/* ===================== */
/* ==== BUTTONS ======== */
/* ===================== */
.scroll-btn {
  position: absolute;
  bottom: 8px;
  left: 50%;

  transform: translateX(-50%);

  background-color: #0037FF;
  color: white;

  border: 1px solid #333;
  border-radius: 6px;

  padding: 8px 10px;
  font-size: 12px;

  cursor: pointer;
  display: none;
  z-index: 10;
}

.scroll-btn:hover {
  background: #2E5DFF;
}

/* ===================== */
/* ==== FOOTER ========= */
/* ===================== */
footer {
  position: static;
  margin-top: auto;

  align-items: center;
  background: rgba(0,0,0,0.65);
  border-top: 1px solid rgba(255,255,255,0.2);

  color: #fff;
  display: flex;

  font-size: 13px;
  justify-content: center;

  padding: 8px 0;
  width: 100%;
  gap: 4px;
}

.heart {
  animation: pulse 1s infinite;
  color: #ff4b5c;
}

/* ===================== */
/* ==== REPLY SYSTEM === */
/* ===================== */
.reply-box {
  font-size: 12px;
  opacity: 0.7;

  border-left: 2px solid #666;
  padding-left: 6px;

  margin-bottom: 4px;
}

.msg-group {
  border: 1px solid rgba(0,209,0,0.75);
  border-radius: 8px;

  padding: 6px 8px;
  margin-bottom: 6px;

  background: rgba(255,255,255,0.02);
}

.reply-icon {
  width: 12px;
  height: 12px;

  flex-shrink: 0;
  vertical-align: middle;

  margin-right: 1px;
  position: relative;
  top: -2px;

  color: #00FF00;
}

.reply-label {
  font-style: italic;
  color: #00FF00;
}

.hidden-bot {
  display: none !important;
}

/* ===================== */
/* ==== ANIMATIONS ===== */
/* ===================== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseDot {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===================== */
/* ==== LIGHT THEME ==== */
/* ===================== */

body.light .toggle-wrapper {
  color: #000;
  border: 1px solid rgba(0,0,0,0.2);
  background: rgba(0,0,0,0.1);
}

body.light .chat-icon {
  color: #000;
}

body.light {
  background: #f5f6f8;
  color: #111;
}

/* TOPBAR */
body.light #topbar {
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

body.light #topbar-title {
  color: #111;
}

/* LAYOUT */
body.light .container {
  background: transparent;
}

/* VIDEO */
body.light .video {
  background: #000;
  border: 1px solid rgba(0,0,0,0.1);
}

/* CHAT */
body.light .chat {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.1);
}

body.light .chat-header {
  background: #f2f2f2;
  color: #111;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

body.light .messages {
  color: #111;
}

/* MESSAGES */
body.light .timestamp {
  color: #777;
}

body.light .username:hover {
  background: rgba(0,0,0,0.06);
}

/* BADGES */
body.light .new-msg-badge {
  background-color: rgba(0, 200, 0, 0.2);
  color: #111;
}

/* BUTTON */
body.light .scroll-btn {
  background-color: #2563eb;
  color: white;
  border: 1px solid rgba(0,0,0,0.1);
}

body.light .scroll-btn:hover {
  background: #1d4ed8;
}

/* FOOTER */
body.light footer {
  background: rgba(255,255,255,0.9);
  color: #111;
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* REPLY BOX */
body.light .reply-box {
  border-left: 2px solid #999;
  color: #333;
}

body.light .msg-group {
  border: 1px solid rgba(0,209,0,0.75);
}

body.light .reply-label {
  color: #0a7a0a;
}

body.light .reply-icon {
  color: #0a7a0a;
}

/* LIVE DOT (optional softer in light mode) */
body.light .live-dot {
  box-shadow: 0 0 6px rgba(255, 59, 59, 0.5);
}

/* ===================== */
/* ==== RESPONSIVE ===== */
/* ===================== */
@media (max-width: 900px) {

  body {
    gap: 12px;
  }

  .container {
    flex-direction: column;
    width: 95vw;
    height: auto;
    flex: none;
  }

  .video {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  iframe {
    height: 100%;
  }

  .chat {
    flex: none;
    height: 60vh;
  }

  #topbar {
    padding: 6px 10px;
  }

  #topbar-title {
    max-width: 60%;
    font-size: 16px;
  }

  #logo {
    height: 26px;
  }

  .scroll-btn {
    font-size: 14px;
    padding: 10px 12px;
  }
  
    .toggle-wrapper {
    font-size: 12px;
    height: 26px;
    padding: 0 8px;
    gap: 6px;
  }

  .chat-icon {
    width: 16px;
    height: 16px;
  }

  .switch {
    width: 28px;
    height: 14px;
    top: 0;
  }

  .slider {
    border-radius: 6px;
  }

  .slider:before {
    height: 10px;
    width: 10px;

    left: 2px;
    bottom: 2px;

    border-radius: 3px;
  }

  .switch input:checked + .slider:before {
    transform: translateX(14px);
  }

  #themeToggle {
    font-size: 12px;
    height: 26px;
    padding: 0 8px;
  }
  
  #topbar-title {
	display: none;
  }

  footer {
    display: none;
  }
}