html {
  visibility: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #fff;
  color: #222;
  overflow-x: hidden;
}

#mainModal {
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mode-item.active {
  color: white !important;
  box-shadow: 0 4px 12px rgba(75, 84, 170, 0.25);
  background: linear-gradient(135deg, rgb(75, 84, 170), rgb(90, 99, 196));
}

.brand-gradient {
  background: linear-gradient(135deg, rgb(75, 84, 170), rgb(90, 99, 196));
}

.brand-text {
  background: linear-gradient(135deg, rgb(75, 84, 170), rgb(90, 99, 196));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-brand {
  background: linear-gradient(135deg, rgb(75, 84, 170), rgb(90, 99, 196));
  color: #fff;
  box-shadow: 0 4px 14px rgba(75, 84, 170, 0.3);
  transition: all 0.3s ease;
}

.btn-brand:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(75, 84, 170, 0.4);
}

.btn-brand:active,
.btn-outline:active {
  transform: scale(0.95);
}

.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.2);
}

.btn-brand:disabled,
.btn-brand[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.2);
}

.btn-outline {
  border: 2px solid rgb(75, 84, 170);
  color: rgb(75, 84, 170);
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: linear-gradient(135deg, rgb(75, 84, 170), rgb(90, 99, 196));
  color: #fff;
  box-shadow: 0 6px 20px rgba(75, 84, 170, 0.4);
}

@keyframes rise-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-help {
  flex: 1 1 25%;
  opacity: 0;
  border: 2px solid rgb(75, 84, 170);
  color: rgb(75, 84, 170);
  transition: all 0.3s ease;
  animation: rise-up 0.5s ease forwards;
  animation-delay: 1s;
}

.btn-help:hover {
  background: linear-gradient(135deg, rgb(75, 84, 170), rgb(90, 99, 196));
  color: #fff;
  box-shadow: 0 6px 20px rgba(75, 84, 170, 0.4);
}

.btn-help:active {
  transform: scale(0.95) !important;
}

summary {
  transition: all 0.3s ease;
}

details[open] summary {
  background-color: rgba(99, 102, 241, 0.08);
  color: #4b54aa;
  padding-left: 4px;
}

.nav-anim {
  opacity: 0;
  transform: translateY(-50px);
  animation: fadeInDown 0.5s ease-out forwards;
}

.logo-brand {
  transition: transform 0.2s ease-in-out;
}

.logo-brand:hover {
  cursor: pointer;
  transform: scale(1.03);
}

.vertical {
  transition: transform 0.2s ease-in-out;
}

.vertical:hover {
  transform: scale(1.03);
}

.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgb(75, 84, 170), rgb(90, 99, 196));
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  box-shadow: 0 6px 20px rgba(75, 84, 170, 0.4);
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.35s ease;
  z-index: 50;
  pointer-events: none;
  cursor: default;
}

.scroll-top-btn svg {
  width: 26px;
  height: 26px;
  color: #fff;
  transition: transform 0.25s ease;
}

.scroll-top-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  cursor: pointer;
}

.scroll-top-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 10px 25px rgba(75, 84, 170, 0.55);
}

.my-bag-btn {
  background: linear-gradient(135deg, rgb(75, 84, 170), rgb(90, 99, 196));
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(75, 84, 170, 0.4);
  transition: all 0.35s ease;
}

.my-bag-btn svg {
  color: #fff;
  transition: transform 0.25s ease;
}

.my-bag-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 10px 25px rgba(75, 84, 170, 0.55);
}

.chat-container {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(75, 84, 170, 0.1);
  border: 1px solid rgba(75, 84, 170, 0.1);
  overflow: hidden;
}

.chat-window {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 20px;
  background: linear-gradient(180deg, #eef0ff 0%, #ffffff 100%);
  height: 470px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-bubble {
  display: inline-block;
  padding: 14px 18px;
  margin: 8px 0;
  line-height: 1.55;
  font-size: 15.5px;
  border-radius: 16px;
  word-wrap: break-word;
  white-space: normal;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
  text-align: left;
  font-size: 18px;
  transform: font-size 1s ease-in;
}

.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4b54aa, #5a63c4);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(75, 84, 170, 0.25);
}

.bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid rgba(75, 84, 170, 0.15);
  color: #2d2d2d;
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 10px rgba(75, 84, 170, 0.08);
}

.bot .reply-btn {
  display: inline-block;
  background: linear-gradient(135deg, #4b54aa, #5a63c4);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(75, 84, 170, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
  margin-right: 8px;
  margin-bottom: 8px;
}

.bot .reply-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(75, 84, 170, 0.35);
}

.bot .reply-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(75, 84, 170, 0.2);
}

.input-help {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  background: #fafbff;
}

.input-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid rgba(75, 84, 170, 0.1);
  background: #fafbff;
}

.input-area textarea {
  flex-grow: 1;
  border: 1px solid rgba(75, 84, 170, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  outline: none;
  font-family: inherit;
  resize: vertical;
  min-height: 50px;
  max-height: 200px;
  transition: box-shadow 0.2s;
}

.input-area textarea:focus {
  box-shadow: 0 0 0 2px rgba(75, 84, 170, 0.25);
}

.typing {
  display: inline-block;
  font-weight: 500;
  color: #4b54aa;
  padding-left: 5px;
  animation: blink 1.2s infinite;
}

@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble h1,
.chat-bubble h2,
.chat-bubble h3,
.chat-bubble h4 {
  margin: 12px 0 8px;
  line-height: 1.35;
  font-weight: 600;
}

.chat-bubble h1 {
  font-size: 1.4em;
  color: #2d2d2d;
}

.chat-bubble h2 {
  font-size: 1.25em;
  color: #2d2d2d;
}

.chat-bubble h3 {
  font-size: 1.1em;
  color: #2d2d2d;
}

.chat-bubble h4 {
  font-size: 1em;
  color: #2d2d2d;
}

.chat-bubble p {
  margin: 8px 0;
  line-height: 1.6;
  color: #2d2d2d;
}

.chat-bubble strong {
  font-weight: 600;
  color: #2d2d2d;
}

.chat-bubble em {
  font-style: italic;
  color: #444;
}

.chat-bubble ul,
.chat-bubble ol {
  margin: 10px 0 12px 20px;
  line-height: 1.6;
}

.chat-bubble li {
  margin: 6px 0;
  padding-left: 4px;
}

.chat-bubble ul li {
  list-style-type: disc;
}

.chat-bubble ol li {
  list-style-type: decimal;
}

.chat-bubble ul li::marker,
.chat-bubble ol li::marker {
  color: #4b54aa;
  font-weight: 600;
}

.chat-bubble blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid #4b54aa;
  background: #f6f7ff;
  border-radius: 8px;
  font-style: italic;
  color: #444;
}

.chat-bubble code {
  background: #f6f7ff;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.9em;
  color: #4b54aa;
  border: 1px solid rgba(75, 84, 170, 0.1);
}

.chat-bubble pre {
  margin: 12px 0;
  border-radius: 10px;
  overflow: hidden;
}

.chat-bubble pre code {
  display: block;
  background: #f9f9ff;
  border: 1px solid rgba(75, 84, 170, 0.12);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 14px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
  color: #2d2d2d;
}

.chat-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-bubble th,
.chat-bubble td {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 10px 12px;
  text-align: left;
}

.chat-bubble th {
  background: rgba(75, 84, 170, 0.1);
  font-weight: 600;
  color: #2d2d2d;
}

.chat-bubble td {
  background: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(75, 84, 170, 0.25);
  border-top-color: #4b54aa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

.animate-spin-load {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgb(57, 72, 211);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 3px;
}

.test-selected {
  border: 1px solid rgb(60, 79, 151, 0.7) !important;
}

.file-icon {
  color: rgb(75, 84, 170);
}

.file-bg {
  background-color: rgba(75, 84, 170, 0.1);
}

.lang-btn.active {
  color: #4f46e5;
}

@media(max-width:768px) {
  #mainModal>div {
    width: 95%;
    height: 90vh;
    border-radius: 0
  }
}

.tab-btn.active {
  color: black;
  font-weight: 600;
  transform: scale(1.02);
}

#activeTabBg {
  box-shadow: 0 3px 10px rgba(75, 84, 170, 0.1);
}

::selection {
  color: white;
  background: rgb(62, 64, 149);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background-color: rgb(57, 65, 136, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgb(57, 65, 136, 0.7);
}

@keyframes fadeInDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 770px) {
  .avatar-logo {
    display: none;
  }

  .chat-bubble {
    font-size: 14px;
  }

  .btn-help {
    flex: none;
    width: 100%;
  }

  .btn-wrapper {
    width: 100%;
  }

  .input-help {}

  #sendBtn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .buttons-responsive {
    flex-direction: column;
    align-items: stretch;
  }

  .buttons-responsive a {
    width: 100%;
    margin-bottom: 12px;
  }

  .buttons-responsive a:last-child {
    margin-bottom: 0;
  }

  #userInput {
    min-height: 75px;
  }
}