/* VARIABLES */
:root {
  --bg-dark: #000;
  --bg-light: #f4f4f4;
  --text-light: #fff;
  --text-dark: #000;
  --primary-blue: #007aff;
  --bubble-dark: #1a1a1a;
  --bubble-light: #e6e6e6;
  --font: "Helvetica Neue", "Segoe UI", sans-serif;
}

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
}

.branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 28px;
  height: 28px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

/* TOGGLE */
.mode-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

/* MAIN CHAT AREA */
.chat-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.chat-container {
  background: var(--bubble-dark);
  width: 100%;
  max-width: 480px;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* BUBBLES */
.message-bubble {
  padding: 12px 18px;
  border-radius: 20px;
  max-width: 75%;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease;
}

.message-bubble.user {
  background: var(--primary-blue);
  color: var(--text-light);
  align-self: flex-end;
}

.message-bubble.ai {
  background: #fff;
  color: #000;
  align-self: flex-start;
}

/* INPUT */
.input-area {
  display: flex;
  gap: 10px;
}

#userInput {
  flex: 1;
  padding: 12px 16px;
  border-radius: 30px;
  border: none;
  background: #000;
  color: #fff;
  font-size: 1rem;
  outline: none;
  border: 2px solid #333;
}

#userInput:focus {
  border-color: var(--primary-blue);
}

#sendBtn {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 30px;
  padding: 0 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#sendBtn:hover {
  background: #ddd;
}

/* FOOTER */
footer {
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.5;
}

/* DARK MODE */
body.light {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

body.light .chat-container {
  background: #fff;
}

body.light .message-bubble.ai {
  background: #f0f0f0;
  color: #000;
}

body.light .message-bubble.user {
  background: var(--primary-blue);
  color: #fff;
}

body.light #userInput {
  background: #fff;
  color: #000;
  border-color: #ccc;
}

body.light #sendBtn {
  background: #000;
  color: #fff;
}

body.light footer {
  opacity: 0.7;
}

/* FADE-IN BUBBLE */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Sidebar base style --- */
.sidebar {
  background: #fff;
  border-right: 1px solid #eee;
  padding: 20px;
  width: 240px;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar ul li {
  margin: 12px 0;
}

.sidebar a {
  text-decoration: none;
  color: #111;
  font-weight: 500;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  margin-bottom: 16px;
  cursor: pointer;
}

/* --- Responsive toggle behavior --- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  #main-content {
    margin-left: 0;
  }
}

@media (min-width: 769px) {
  #main-content {
    margin-left: 260px;
    padding: 20px;
  }
}

/* --- Tabs & Right Menu --- */
.tab-header {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: none;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  border-bottom: 2px solid var(--primary-blue);
  color: var(--primary-blue);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 12px;
}

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

.right-menu ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.right-menu a {
  text-decoration: none;
  font-size: 1rem;
  color: var(--text-dark);
}

.right-menu a:hover {
  color: var(--primary-blue);
}

