
/* Live Streaming Dashboard Overhaul */
:root {
  --chat-bg: rgba(0, 0, 0, 0.7);
  --input-bg: #18181b;
  --accent-color: #9147ff;
  --text-primary: #efeff1;
  --text-secondary: #adadb8;
}

body, html, #root {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  background-color: #000;
  color: var(--text-primary);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

/* 1. Remove All Existing UI Elements */
#root > div:not(.new-ui-container),
header, footer, aside, .cs-sidebar, .cs-chat-container, .cs-main-container,
[class*="Floating"], [class*="Control"], [class*="Button"],
[class*="Camera"], [class*="Mic"], [class*="Gesture"], [class*="Idle"] {
  display: none !important;
}

/* Ensure Live2D Canvas remains visible and large */
canvas, #live2d, .live2d-container {
  display: block !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: calc(100vh - 60px) !important;
  z-index: 1 !important;
  pointer-events: auto !important;
}

/* 2. New UI Structure */
.new-ui-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  pointer-events: none; /* Allow clicking through to Live2D */
}

/* Left Area: Chat Feed (30%) */
.chat-feed-container {
  width: 30%;
  min-width: 300px;
  flex-grow: 1;
  background: linear-gradient(to right, var(--chat-bg), transparent);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Push messages to bottom */
  pointer-events: auto;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 80%;
  scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.chat-msg {
  animation: fadeIn 0.3s ease-out;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 90%;
  word-break: break-word;
}

.chat-msg .username {
  font-weight: bold;
  color: var(--accent-color);
  margin-right: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bottom Area: Input Bar */
.input-bar {
  height: 60px;
  background-color: var(--input-bg);
  border-top: 1px solid #26262c;
  display: flex;
  align-items: center;
  padding: 0 20px;
  pointer-events: auto;
}

.input-bar input {
  flex-grow: 1;
  background: #26262c;
  border: 2px solid transparent;
  border-radius: 4px;
  color: white;
  padding: 10px 15px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-bar input:focus {
  border-color: var(--accent-color);
}

.input-bar button {
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin-left: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: filter 0.2s;
}

.input-bar button:hover {
  filter: brightness(1.1);
}
