:root {
  --bg: #e9e9e9;
  --text: #333;
  --header-top: #fdfdfd;
  --header-bottom: #f0f0f0;
  --border: #ccc;
  --module-bg: #f7f7f7;
  --module-header-top: #f5f5f5;
  --module-header-bottom: #e5e5e5;
  --tab-bg-top: #eeeeee;
  --tab-bg-bottom: #dcdcdc;
  --active-tab-bg: #fff;
  --chat-bg: #fff;
  --chat-text: #333;
  --username: #6441a5;
  --video-title-top: #f5f5f5;
  --video-title-bottom: #e0e0e0;
}

/* DARK THEME */
body.theme-dark {
  --bg: #181818;
  --text: #ddd;
  --header-top: #2a2a2a;
  --header-bottom: #1c1c1c;
  --border: #444;
  --module-bg: #222;
  --module-header-top: #333;
  --module-header-bottom: #222;
  --tab-bg-top: #333;
  --tab-bg-bottom: #222;
  --active-tab-bg: #222;
  --chat-bg: #222;
  --chat-text: #ddd;
  --username: #b49ce6;
  --video-title-top: #333;
  --video-title-bottom: #222;
}

/* RETRO PURPLE */
body.theme-retro {
  --bg: #f2eefc;
  --text: #2a1f4d;
  --header-top: #e8e0ff;
  --header-bottom: #d8ccff;
  --border: #b8a6ff;
  --module-bg: #f7f3ff;
  --module-header-top: #e8e0ff;
  --module-header-bottom: #d8ccff;
  --tab-bg-top: #e8e0ff;
  --tab-bg-bottom: #d8ccff;
  --active-tab-bg: #fff;
  --chat-bg: #faf7ff;
  --chat-text: #2a1f4d;
  --username: #6441a5;
  --video-title-top: #e8e0ff;
  --video-title-bottom: #d8ccff;
}

/* GRAY MODE */
body.theme-gray {
  --bg: #dcdcdc;
  --text: #222;
  --header-top: #f0f0f0;
  --header-bottom: #d0d0d0;
  --border: #999;
  --module-bg: #e5e5e5;
  --module-header-top: #f0f0f0;
  --module-header-bottom: #d0d0d0;
  --tab-bg-top: #f0f0f0;
  --tab-bg-bottom: #d0d0d0;
  --active-tab-bg: #fff;
  --chat-bg: #eee;
  --chat-text: #222;
  --username: #444;
  --video-title-top: #f0f0f0;
  --video-title-bottom: #d0d0d0;
}


/* GLOBAL ------------------------------------------------------------ */

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  margin: 0;
}

#page {
  width: 1020px;
  margin: 0 auto;
}

/* LIGHT / DARK MODE ------------------------------------------------- */

body.theme-dark {
  background: #181818;
  color: #ddd;
}

body.theme-dark #top-header,
body.theme-dark #footer {
  background: linear-gradient(#2a2a2a, #1c1c1c);
  border-color: #444;
}

body.theme-dark #channel-bar,
body.theme-dark .video-box,
body.theme-dark .tab-content,
body.theme-dark #chat-column,
body.theme-dark .module {
  background: #222;
  border-color: #444;
}

body.theme-dark .module-header,
body.theme-dark .chat-header,
body.theme-dark .video-titlebar {
  background: linear-gradient(#333, #222);
  border-color: #444;
}

body.theme-dark .tab {
  background: linear-gradient(#333, #222);
  border-color: #444;
}

body.theme-dark .tab.active {
  background: #222;
  border-bottom-color: #222;
}

body.theme-dark .chat-input textarea,
body.theme-dark .search {
  background: #111;
  color: #ddd;
}

/* HEADER ------------------------------------------------------------ */

#top-header {
  background: linear-gradient(var(--header-top), var(--header-bottom));
  border-bottom: 1px solid var(--border);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: #444;
  text-shadow: 0 1px 0 #fff;
}

.logo span {
  color: #6441a5;
}

.nav a {
  margin-right: 15px;
  color: #444;
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover {
  text-decoration: underline;
}

.user-controls {
  display: flex;
  gap: 6px;
}

.search {
  padding: 4px 6px;
  border: 1px solid #bbb;
  background: #fff;
}

/* BUTTONS ----------------------------------------------------------- */

.btn {
  padding: 5px 10px;
  border-radius: 3px;
  border: 1px solid #aaa;
  background: linear-gradient(#ffffff, #dddddd);
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 1px 0 #fff inset;
}

.btn:hover {
  background: linear-gradient(#ffffff, #cccccc);
}

.btn.purple {
  background: linear-gradient(#b49ce6, #8a6bcf);
  border-color: #6d4fb8;
  color: #fff;
  text-shadow: 0 -1px 0 #5a3f9a;
}

.btn.purple:hover {
  background: linear-gradient(#c3aef0, #8a6bcf);
}

.btn.small {
  padding: 4px 8px;
  font-size: 12px;
}

.btn.full {
  width: 100%;
}

.follow-btn {
  background: linear-gradient(#fefefe, #e0e0e0);
}

/* CHANNEL BAR ------------------------------------------------------- */

#channel-bar {
  background: #fff;
  border-bottom: 1px solid #ccc;
  padding: 12px;
  display: flex;
  justify-content: space-between;
}

#channel-bar h1 {
  font-size: 20px;
  margin-bottom: 4px;
}

.meta {
  font-size: 12px;
  color: #666;
  display: flex;
  gap: 12px;
  font-family: Verdana, sans-serif;
}

.live {
  background: #d9534f;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
}

/* LIVE pulse animation */
.live-pulse {
  position: relative;
}

.live-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 5px;
  border: 1px solid rgba(217, 83, 79, 0.6);
  animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* LAYOUT ------------------------------------------------------------ */

#content {
  display: grid;
  grid-template-columns: 700px 300px;
  gap: 20px;
  margin-top: 15px;
}

/* BANNER ------------------------------------------------------------ */

.channel-banner {
  width: 960px;
  height: 120px;
  margin: 0 auto 10px auto;
  border: 1px solid #bbb;
  background: #ddd;
  overflow: hidden;
}

.channel-banner img {
  width: 960px;
  height: 120px;
  display: block;
}

/* VIDEO PLAYER ------------------------------------------------------ */

.video-box {
  border: 1px solid #bbb;
  background: #fff;
}

.video-titlebar {
  background: linear-gradient(var(--video-title-top), var(--video-title-bottom));
  border-bottom: 1px solid var(--border);
  padding: 6px;
  font-weight: bold;
  font-size: 13px;
}

.video-area {
  position: relative;
  height: 390px;
  background: #000;
  color: #aaa;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FLASH-STYLE CONTROLS --------------------------------------------- */

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  background: linear-gradient(#222, #111);
  border-top: 1px solid #444;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
}

.control-left,
.control-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  background: #333;
  border: 1px solid #555;
  color: #eee;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
}

.ctrl-btn:hover {
  background: #444;
}

.volume-bar {
  width: 80px;
  height: 6px;
  background: #555;
  border-radius: 3px;
  overflow: hidden;
}

.volume-level {
  width: 60%;
  height: 100%;
  background: #a0d468;
}

/* TABS -------------------------------------------------------------- */

.tab-bar {
  margin-top: 10px;
  display: flex;
}

.tab {
  padding: 6px 12px;
  background: linear-gradient(var(--tab-bg-top), var(--tab-bg-bottom));
  border: 1px solid var(--border);
  border-bottom: none;
  cursor: pointer;
  font-size: 13px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  margin-right: 2px;
}

.tab.active {
  background: var(--active-tab-bg);
  border-bottom: 1px solid #fff;
  font-weight: bold;
}

.tab-content {
  background: #fff;
  border: 1px solid #bbb;
  padding: 12px;
  margin-top: -1px;
  display: none;
}

.tab-content.active {
  display: block;
}

/* MODULES ----------------------------------------------------------- */

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.module {
  background: var(--module-bg);
  border: 1px solid var(--border);
}

.module-header {
  background: linear-gradient(var(--module-header-top), var(--module-header-bottom));
  padding: 6px;
  border-bottom: 1px solid #ccc;
  font-weight: bold;
  font-size: 12px;
  font-family: Verdana, sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-body {
  padding: 8px;
  font-size: 12px;
  font-family: Verdana, sans-serif;
}

.module-body ul {
  list-style: none;
  padding-left: 0;
}

.module-body li {
  margin-bottom: 5px;
}

.module-body a {
  color: #6441a5;
  text-decoration: none;
}

.module-body a:hover {
  text-decoration: underline;
}

.collapse-toggle {
  cursor: pointer;
  font-size: 14px;
}

/* SIDEBAR ----------------------------------------------------------- */

#sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* CHAT -------------------------------------------------------------- */

#chat-column {
  background: var(--chat-bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.chat-header {
  background: linear-gradient(#f5f5f5, #e0e0e0);
  padding: 6px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-family: Verdana, sans-serif;
}

.chat-box {
  color: var(--chat-text);
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 11px;
  font-family: Verdana, sans-serif;
}

.msg {
  margin-bottom: 4px;
}

.user {
  color: var(--username);
  font-weight: bold;
}

/* EMOTES ------------------------------------------------------------ */

.emote {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  display: inline-block;
}

.emote-kappa {
  background: url("emotes/kappa.png") no-repeat center center;
  background-size: contain;
}

.emote-biblethump {
  background: url("emotes/biblethump.png") no-repeat center center;
  background-size: contain;
}

/* CHAT INPUT -------------------------------------------------------- */

.chat-input {
  border-top: 1px solid #ccc;
  padding: 10px;
}

.chat-input textarea {
  width: 100%;
  height: 60px;
  border: 1px solid #bbb;
  padding: 6px;
  resize: none;
  font-size: 11px;
  font-family: Verdana, sans-serif;
}

/* FOOTER ------------------------------------------------------------ */

#footer {
  margin-top: 20px;
  padding: 12px;
  background: linear-gradient(#fdfdfd, #f0f0f0);
  border-top: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

#footer a {
  color: #555;
  text-decoration: none;
}

#footer a:hover {
  text-decoration: underline;
}
