body, html {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #121212;
  color: #fff;
  height: 100%;
}

.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #1b1b1b;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border-right: 1px solid #2a2a2a;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  margin-bottom: 20px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.chat-list-container {
  flex: 1;
  overflow-y: auto;
}

.chat-list-container button {
  width: 100%;
  padding: 10px;
  margin-bottom: 6px;
  background: #262626;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
}

.chat-list-container button:hover {
  background: #333;
}

.chat-list-container button.active {
  background: #3d3d3d;
}

.sidebar-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-buttons button {
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #2c2c2c;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.sidebar-buttons button:hover {
  background: #3a3a3a;
}

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 15px;
  border-bottom: 1px solid #2a2a2a;
  font-weight: bold;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.message {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 14px;
  background: #2a2a2a;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message.user .bubble {
  background: #3a3a3a;
}

.input-container {
  display: flex;
  padding: 12px;
  border-top: 1px solid #2a2a2a;
  gap: 10px;
}

textarea {
  flex: 1;
  padding: 10px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  color: white;
  resize: none;
}

textarea:focus {
  outline: none;
  border-color: #555;
}

#sendBtn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: #3a3a3a;
  color: white;
  cursor: pointer;
}

#sendBtn:hover {
  background: #4a4a4a;
}

/* Intro Animation */
#introOverlay {
  position: fixed;
  inset: 0;
  background: #111;
  z-index: 9999;
  overflow: hidden;
  transition: opacity 1s ease;
}

#introOverlay.fade {
  opacity: 0;
  pointer-events: none;
}

.door {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(to bottom, #2b2b2b, #1a1a1a);
  transition: transform 2s ease;
}

.door.left { left: 0; }
.door.right { right: 0; }

#introOverlay.open .left { transform: translateX(-100%); }
#introOverlay.open .right { transform: translateX(100%); }

.intro-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: fadeIn 1s forwards 0.8s;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}