/* Telegram UI style for StreamLive */
html.pl-theme-telegram,
body.pl-theme-telegram {
  --tg-bg: #0e1621;
  --tg-elev: #17212b;
  --tg-card: #182533;
  --tg-hover: #242f3d;
  --tg-text: #f5f5f5;
  --tg-muted: #708499;
  --tg-blue: #2AABEE;
  --tg-blue-dark: #229ED9;
  --tg-green: #4fae4e;
  --tg-border: #0e1621;
  --tg-bubble: #2b5278;
  --tg-side: 260px;
  --tg-top: 52px;
  --tg-bottom: 56px;
  background: var(--tg-bg) !important;
  color: var(--tg-text) !important;
  font-family: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif !important;
}

/* Header / nav */
body.pl-theme-telegram .site-header,
body.pl-theme-telegram header.header,
body.pl-theme-telegram .header,
body.pl-theme-telegram nav.top-nav {
  background: var(--tg-elev) !important;
  border-bottom: 1px solid #0a1018 !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
body.pl-theme-telegram a { color: var(--tg-blue); }
body.pl-theme-telegram .btn-primary,
body.pl-theme-telegram button.btn-primary {
  background: var(--tg-blue) !important;
  border-color: var(--tg-blue) !important;
  color: #fff !important;
  border-radius: 10px !important;
}
body.pl-theme-telegram .btn-outline {
  border-radius: 10px !important;
  border-color: #3a4a5a !important;
  color: var(--tg-text) !important;
}
body.pl-theme-telegram .card,
body.pl-theme-telegram .video-card,
body.pl-theme-telegram .channel-card,
body.pl-theme-telegram .post-card {
  background: var(--tg-card) !important;
  border: 1px solid #1c2733 !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
body.pl-theme-telegram input,
body.pl-theme-telegram textarea,
body.pl-theme-telegram select {
  background: var(--tg-elev) !important;
  border: 1px solid #243040 !important;
  color: var(--tg-text) !important;
  border-radius: 10px !important;
}
body.pl-theme-telegram .container { max-width: 1100px; }

/* Sidebar drawer */
.tg-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--tg-side);
  background: var(--tg-elev); z-index: 10020; transform: translateX(-105%);
  transition: transform .22s ease; overflow-y: auto; padding: 12px 8px;
  border-right: 1px solid #0a1018; box-sizing: border-box;
}
.tg-sidebar.open { transform: translateX(0); }
.tg-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10010;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.tg-backdrop.open { opacity: 1; pointer-events: auto; }
.tg-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.tg-nav-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px;
  border-radius: 10px; color: var(--tg-text) !important; text-decoration: none !important;
  font-size: 15px;
}
.tg-nav-item:hover { background: var(--tg-hover); }
.tg-nav-item.active { background: var(--tg-hover); color: var(--tg-blue) !important; }
.tg-nav-label {
  font-size: 12px; color: var(--tg-muted); padding: 14px 14px 6px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .3px;
}
.tg-menu-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: transparent; color: var(--tg-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.tg-menu-btn:hover { background: var(--tg-hover); }

/* Bottom mobile bar */
.tg-bottom {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tg-bottom);
  background: var(--tg-elev); border-top: 1px solid #0a1018; z-index: 10000;
  justify-content: space-around; align-items: center;
}
.tg-bottom-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--tg-muted) !important; text-decoration: none !important; font-size: 10px;
  padding: 6px 0;
}
.tg-bottom-item.active, .tg-bottom-item:hover { color: var(--tg-blue) !important; }
.tg-bottom-item .ico { font-size: 20px; line-height: 1; }

@media (max-width: 860px) {
  body.pl-theme-telegram { padding-bottom: calc(var(--tg-bottom) + 8px) !important; }
  .tg-bottom { display: flex; }
}

/* Cards denser like chats */
body.pl-theme-telegram .pg-glass,
body.pl-theme-telegram .xf-mini-profile {
  background: var(--tg-card) !important;
  border-radius: 12px !important;
  border-color: #1c2733 !important;
}

/* Badge */
.tg-beta-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 10px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: #fff; background: var(--tg-blue);
  border-radius: 4px; vertical-align: middle;
}

/* ===== Telegram LIGHT ===== */
html.pl-theme-telegram[data-pl-skin="light"],
body.pl-theme-telegram[data-pl-skin="light"] {
  --tg-bg: #ffffff;
  --tg-elev: #f4f4f5;
  --tg-card: #ffffff;
  --tg-hover: #e8e8ea;
  --tg-text: #0f0f0f;
  --tg-muted: #707579;
  --tg-blue: #2AABEE;
  --tg-blue-dark: #1e96d1;
  --tg-green: #4fae4e;
  --tg-border: #e4e4e4;
  --tg-bubble: #eeffde;
  --bg: #ffffff;
  --bg-elevated: #f4f4f5;
  --card: #ffffff;
  --border: #e4e4e4;
  --text: #0f0f0f;
  --text-dim: #707579;
  background: #ffffff !important;
  color: #0f0f0f !important;
  color-scheme: light;
}

body.pl-theme-telegram[data-pl-skin="light"] .site-header,
body.pl-theme-telegram[data-pl-skin="light"] header,
body.pl-theme-telegram[data-pl-skin="light"] .header,
body.pl-theme-telegram[data-pl-skin="light"] nav.top-nav,
body.pl-theme-telegram[data-pl-skin="light"] .navbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e4e4e4 !important;
  color: #0f0f0f !important;
  box-shadow: none !important;
}

body.pl-theme-telegram[data-pl-skin="light"] .tg-sidebar,
body.pl-theme-telegram[data-pl-skin="light"] .tg-bottom {
  background: #ffffff !important;
  border-color: #e4e4e4 !important;
  color: #0f0f0f !important;
}

body.pl-theme-telegram[data-pl-skin="light"] .tg-nav-item,
body.pl-theme-telegram[data-pl-skin="light"] .tg-bottom-item {
  color: #0f0f0f !important;
}
body.pl-theme-telegram[data-pl-skin="light"] .tg-nav-item:hover,
body.pl-theme-telegram[data-pl-skin="light"] .tg-nav-item.active {
  background: #f0f0f0 !important;
}

body.pl-theme-telegram[data-pl-skin="light"] .card,
body.pl-theme-telegram[data-pl-skin="light"] .video-card,
body.pl-theme-telegram[data-pl-skin="light"] .channel-card,
body.pl-theme-telegram[data-pl-skin="light"] .post-card,
body.pl-theme-telegram[data-pl-skin="light"] .forum-post,
body.pl-theme-telegram[data-pl-skin="light"] .comment {
  background: #f7f7f8 !important;
  border: 1px solid #e4e4e4 !important;
  color: #0f0f0f !important;
  box-shadow: none !important;
}

body.pl-theme-telegram[data-pl-skin="light"] input,
body.pl-theme-telegram[data-pl-skin="light"] textarea,
body.pl-theme-telegram[data-pl-skin="light"] select {
  background: #ffffff !important;
  border: 1px solid #d0d0d0 !important;
  color: #0f0f0f !important;
}

body.pl-theme-telegram[data-pl-skin="light"] .btn-outline {
  background: #f0f0f0 !important;
  color: #0f0f0f !important;
  border-color: #d0d0d0 !important;
}

body.pl-theme-telegram[data-pl-skin="light"] h1,
body.pl-theme-telegram[data-pl-skin="light"] h2,
body.pl-theme-telegram[data-pl-skin="light"] h3 {
  color: #0f0f0f !important;
}

body.pl-theme-telegram[data-pl-skin="light"] .tg-menu-btn {
  color: #0f0f0f !important;
  background: transparent !important;
}

body.pl-theme-telegram[data-pl-skin="light"] footer,
body.pl-theme-telegram[data-pl-skin="light"] .footer {
  background: #ffffff !important;
  color: #707579 !important;
  border-color: #e4e4e4 !important;
}

body.pl-theme-telegram[data-pl-skin="light"] .tg-section-title {
  color: #707579 !important;
}
