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

body {
  background: #1a1a1a;
  color: #f1f1f1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ======================================================
     HEADER
  ====================================================== */

.header {
  height: 76px;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px; /* ❗️ не дає злипатися */
}

.logo {
  font-size: 20px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px; /* ❗️відступи між елементами */
}

.head-btn {
  padding: 10px 16px;
  border-radius: 50px;
  background: #2b2b2b;
  border: 1px solid #3b3b3b;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.head-btn.white {
  background: #fff;
  color: #000;
}

/* ======================================================
     CHAT SCROLL AREA
  ====================================================== */

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  justify-content: center;
}

.chat-container {
  width: 740px;
  max-width: 100%;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 20px; /* ❗️між повідомленнями */
}

/* ======================================================
     MESSAGES
  ====================================================== */

.msg-bot,
.msg-user {
  width: 100%;
  padding: 12px 16px;
}

.msg-bot {
  padding: 12px 16px;
  background: #2c2c2c;
  border-radius: 16px;
  line-height: 1.6;
  border: 1px solid #3a3a3a;
  font-size: 18px;
}

.msg-user {
  display: flex;
  justify-content: flex-end;
}

.user-bubble {
  background: #3b3b3b;
  padding: 12px 16px;
  border-radius: 40px;
  font-size: 18px;
  border: 1px solid #4a4a4a;
  max-width: 75%;
}

/* ======================================================
     INPUT PANEL
  ====================================================== */

.input-panel {
  padding: 20px;
  display: flex;
  justify-content: center;
  background: transparent;
}

.input-main {
  width: 740px;
  max-width: 100%;
  background: #2b2b2b;
  border: 1px solid #3c3c3c;
  border-radius: 40px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px; /* ❗️кнопки не злипаються */
}

/* INPUT FIELD */

#chat-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 18px;
  color: #fff;
}

body:not(.light) #chat-input {
  background: #303030; /* твоє значення */
  padding: 10px 14px;
  border-radius: 14px;
}

#chat-input::placeholder {
  color: #888;
}

/* BUTTONS */

.input-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #ddd;
}

.input-btn img {
  width: 22px;
  height: 22px;
  filter: invert(0.8);
}

.attach-btn {
  font-size: 32px;
  color: #aaa;
}

/* SEND BUTTON */

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff !important;
}

body:not(.light) .send-btn {
  background: #fff;
}

body:not(.light) .send-btn svg {
  fill: #000 !important;
}

/* ======================================================
     LIGHT MODE
  ====================================================== */

body.light {
  background: #ffffff;
  color: #222;
}

body.light .header {
  background: #fafafa;
  border-bottom: 1px solid #e6e6e6;
}

body.light .msg-bot {
  background: #f7f7f8;
  border: 1px solid #ececec;
}

body.light .user-bubble {
  background: #e2e8f0;
  border-color: #cbd5e0;
  color: #000;
}

body.light .input-main {
  background: #fff;
  border: 1px solid #dcdcdc;
}

body.light #chat-input {
  color: #000;
}

body.light .input-btn img {
  filter: invert(0);
}

body.light .send-btn {
  background: #000;
}

body.light .send-btn svg {
  fill: #fff;
}

/* ======================================================
     DROPDOWN (як у GPT)
  ====================================================== */

.info-dropdown {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
}

.info-dropdown.open .info-menu {
  display: flex;
}

/* TEXT INSIDE MENU */

.info-item-title {
  font-size: 22px;
  font-weight: 600;
}

.info-mode {
  opacity: 0.4;
  font-size: 18px;
}

.info-desc {
  opacity: 0.8;
  line-height: 1.5;
  margin-bottom: 6px;
}

.info-check {
  font-size: 22px;
}

/* ======================================================
     RESPONSIVE
  ====================================================== */

@media (max-width: 820px) {
  .header {
    padding: 8px 14px;
    gap: 12px;
  }

  .info-menu {
    width: 300px;
  }

  .chat-container {
    padding: 0 14px;
  }

  .input-panel {
    padding:  10px;
  }

  .input-main {
    padding: 12px 16px;
    border-radius: 34px;
  }

  #chat-input {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .info-menu {
    width: 92vw;
    left: 4vw;
  }

  .msg-bot,
  .user-bubble {
    font-size: 15px;
  }

  .input-main {
    border-radius: 30px;
    padding: 10px 14px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
  }
}
/* ===== CENTER PAGE CONTENT ON DESKTOP ===== */

.page-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.page-inner {
  width: 100%;
  max-width: 980px; /* ← як у ChatGPT */
  padding: 0 20px;
}
/* ===========================
DROPDOWN BUTTON
=========================== */

.info-btn {
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 17px;
  border: 1px solid #d8d8d8;
  background: #f0f0f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-btn .arrow {
  font-size: 14px;
  opacity: 0.7;
}

/* Dark theme */
body:not(.light) .info-btn {
  background: #2b2b2b;
  border: 1px solid #444;
  color: #fff;
}

body:not(.light) .info-btn .arrow {
  opacity: 0.9;
}

/* ===========================
MENU
=========================== */

.info-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;

  width: 330px; /* ширше, як у GPT */
  padding: 22px; /* більше простору */
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e5e5e5;

  display: none;
  flex-direction: column;
  gap: 22px;

  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.14);
  animation: fadeIn 0.15s ease-out;

  z-index: 200;
}

/* Dark Theme */
body:not(.light) .info-menu {
  background: #2b2b2b;
  border-color: #3a3a3a;
  color: #f1f1f1;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* ===========================
CONTENT INSIDE MENU
=========================== */

.info-title {
  font-size: 15px;
  font-weight: 600;
  opacity: 0.8;
}

/* One row */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-row .name {
  font-size: 17px;
  font-weight: 600;
}

.desc {
  font-size: 14px;
  color: #666;
  margin-top: 3px;
}

/* Dark theme text correction */
body:not(.light) .info-row .desc {
  color: #aaa;
}

/* Selected Row */
.info-row.selected .name {
  opacity: 1;
  color: inherit;
}

.info-row.selected .check {
  font-size: 20px;
  color: #000;
}

/* Dark theme check */
body:not(.light) .info-row.selected .check {
  color: #fff;
}

/* Grey (disabled) rows */
.info-row.disabled .name,
.info-row.disabled .desc {
  opacity: 0.35;
}

/* Separator */
.separator {
  width: 100%;
  height: 1px;
  background: #e4e4e4;
}

body:not(.light) .separator {
  background: #3b3b3b;
}

/* Last row */
.arrow-row {
  display: flex;
  justify-content: space-between;
  opacity: 0.45;
}

.arrow-small {
  opacity: 0.6;
}

/* CHECK SVG ICON */
.info-row .check svg {
  width: 18px;
  height: 18px;
  color: #000;
  opacity: 0.9;
}

/* Dark mode */
body:not(.light) .info-row .check svg {
  color: #fff;
  opacity: 1;
}

.theme-dropdown {
  position: relative;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid #3c3c3c;
  background: #2b2b2b;
  color: #fff;
  cursor: pointer;
}

.theme-btn svg {
  width: 20px;
  height: 20px;
}

.theme-btn .arrow {
  font-size: 14px;
  opacity: 0.6;
}

body.light .theme-btn {
  background: #f3f3f3;
  color: #222;
  border: 1px solid #ddd;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  background: #2b2b2b;
  color: #fff;
  border-radius: 14px;
  border: 1px solid #3c3c3c;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.15s ease-out;
}

body.light .theme-menu {
  background: #fff;
  color: #000;
  border-color: #e2e2e2;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.theme-option {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.light .theme-option:hover {
  background: #f0f0f0;
}

.theme-option.selected::after {
  content: "✓";
  float: right;
  opacity: 0.7;
}

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