*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100vh;
  background: linear-gradient(to bottom, #eceaf8 0%, #fdfcff 70%, #e8e4f8 100%);
  transition: background 0.3s ease;
}
html[data-theme=dark] {
  background: linear-gradient(to bottom, #0d0c1a, #13121f 70%, #0a0917);
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1e1b3a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html[data-theme=dark] body {
  color: #e5e3f5;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #6b5ce7;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

.header {
  background: #ffffff;
  border-bottom: 1px solid #e2e0f0;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6b5ce7;
  margin: 0;
}

.header-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0.25rem 0 0 0;
}

.main {
  flex: 1;
  padding-bottom: 3rem;
}

.footer {
  background: #1a1735;
  border-top: none;
  padding: 1.5rem 0;
  margin-top: 3rem;
  text-align: center;
}
html[data-theme=dark] .footer {
  background: #0d0c1a;
}

.footer p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.8);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-between {
  justify-content: space-between;
}

.flex-center {
  justify-content: center;
  align-items: center;
}

.gap-sm {
  gap: 0.5rem;
}

.gap-md {
  gap: 1rem;
}

.gap-lg {
  gap: 1.5rem;
}

.mt-sm {
  margin-top: 0.5rem;
}

.mt-md {
  margin-top: 1rem;
}

.mt-lg {
  margin-top: 1.5rem;
}

.mt-xl {
  margin-top: 2rem;
}

.mb-sm {
  margin-bottom: 0.5rem;
}

.mb-md {
  margin-bottom: 1rem;
}

.mb-lg {
  margin-bottom: 1.5rem;
}

.mb-xl {
  margin-bottom: 2rem;
}

.p-sm {
  padding: 0.5rem;
}

.p-md {
  padding: 1rem;
}

.p-lg {
  padding: 1.5rem;
}

.p-xl {
  padding: 2rem;
}

.btn {
  display: inline-block;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #6b5ce7;
  color: white;
}
.btn-primary:hover {
  background-color: #5449c4;
}

.btn-success {
  background-color: #52b788;
  color: white;
}
.btn-success:hover {
  background-color: rgb(62.8897959184, 151.1102040816, 110.0571428571);
}

.btn-secondary {
  background-color: #f3f2fa;
  color: #1e1b3a;
}
.btn-secondary:hover {
  background-color: rgb(226, 223.5833333333, 242.9166666667);
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}
.btn-danger:hover {
  background-color: rgb(234.9802955665, 21.0197044335, 21.0197044335);
}

.btn-sm {
  padding: 0.25rem 1rem;
  font-size: 0.875rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #e2e0f0;
  color: #1e1b3a;
}
.btn-ghost:hover {
  background: #f3f2fa;
  border-color: #6b5ce7;
}
html[data-theme=dark] .btn-ghost {
  border-color: #3d3a60;
  color: #e5e3f5;
}
html[data-theme=dark] .btn-ghost:hover {
  background: rgb(28.887755102, 27.3673469388, 47.1326530612);
  border-color: #6b5ce7;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e0f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}
html[data-theme=dark] .card {
  background: #13121f;
  border-color: #2a2845;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
html[data-theme=dark] .card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  border-color: #3d3a60;
}

.card-clickable {
  cursor: pointer;
}
.card-clickable:hover {
  border-color: #6b5ce7;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1e1b3a;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #1e1b3a;
}

.input,
.textarea {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-family: system-ui, -apple-system, sans-serif;
  border: 1px solid #e2e0f0;
  border-radius: 6px;
  transition: all 0.2s;
}
.input:focus,
.textarea:focus {
  outline: none;
  border-color: #6b5ce7;
  box-shadow: 0 0 0 3px rgba(107, 92, 231, 0.1);
}
.input::placeholder,
.textarea::placeholder {
  color: #6b7280;
}
html[data-theme=dark] .input,
html[data-theme=dark] .textarea {
  background: #3d3a60;
  border-color: #3d3a60;
  color: #e5e3f5;
}
html[data-theme=dark] .input:focus,
html[data-theme=dark] .textarea:focus {
  border-color: #6b5ce7;
  background: #13121f;
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.chat-message {
  padding: 1rem;
  border-radius: 8px;
  max-width: 80%;
  word-wrap: break-word;
}

.chat-message-user {
  background-color: #6b5ce7;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message-assistant {
  background-color: white;
  color: #1e1b3a;
  align-self: flex-start;
  border: 1px solid #e2e0f0;
  border-bottom-left-radius: 4px;
}
html[data-theme=dark] .chat-message-assistant {
  background-color: #13121f;
  color: #e5e3f5;
  border-color: #2a2845;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
}
.chat-form .input {
  flex: 1;
}
.chat-form .btn {
  white-space: nowrap;
}

.progress {
  background-color: #f3f2fa;
  border-radius: 4px;
  overflow: hidden;
  height: 8px;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  background-color: #6b5ce7;
  transition: width 0.3s ease;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  color: white;
  font-size: 1rem;
  width: 100%;
  justify-content: space-between;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}
.theme-toggle .theme-icon {
  font-size: 1.5rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}
.breadcrumb a {
  color: #6b5ce7;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb .separator {
  color: #6b7280;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 1.5rem;
  background-color: transparent;
  box-shadow: none;
  transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
}

.navbar.active {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
html[data-theme=dark] .navbar.active {
  background-color: #13121f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.navbar-brand {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1e1b3a;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
html[data-theme=dark] .navbar-brand {
  color: #e5e3f5;
}

.navbar-brand:hover {
  text-decoration: none;
}

.navbar-brand-icon {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.navbar.active .navbar-brand {
  color: #1e1b3a;
}

.sidemenu-toggle {
  width: 24px;
  height: 18px;
  position: relative;
  padding: 10px;
  transform: rotate(0deg);
  transition: 0.5s ease-in-out;
  cursor: pointer;
  z-index: 2000;
  flex-shrink: 0;
}

.sidemenu-toggle span {
  display: block;
  position: absolute;
  height: 3px;
  width: 24px;
  background: #333;
  border-radius: 1px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}
html[data-theme=dark] .sidemenu-toggle span {
  background: #e5e3f5;
}

.sidemenu-toggle span:nth-child(1) {
  top: 0px;
  width: 85%;
}

.sidemenu-toggle span:nth-child(2) {
  top: 8px;
}

.sidemenu-toggle span:nth-child(3) {
  top: 16px;
  width: 65%;
}

.sidemenu-toggle.open span:nth-child(1) {
  top: 8px;
  width: 28px;
  height: 4px;
  transform: rotate(135deg);
}

.sidemenu-toggle.open span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.sidemenu-toggle.open span:nth-child(3) {
  top: 8px;
  width: 28px;
  height: 4px;
  transform: rotate(-135deg);
}

.sidemenu-main {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.sidemenu-open {
  overflow-y: hidden;
}

.sidemenu-open .sidemenu-main {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.sidemenu-close {
  position: absolute;
  top: 0.65rem;
  left: 0.85rem;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.85;
}
.sidemenu-close:hover {
  opacity: 1;
}
.sidemenu-close span {
  display: block;
  position: absolute;
  height: 4px;
  width: 28px;
  background: #c8c5e8;
  border-radius: 1px;
  left: 8px;
  transition: 0.25s ease-in-out;
}
.sidemenu-close span:nth-child(1) {
  top: 20px;
  transform: rotate(135deg);
}
.sidemenu-close span:nth-child(2) {
  top: 20px;
  opacity: 0;
}
.sidemenu-close span:nth-child(3) {
  top: 20px;
  transform: rotate(-135deg);
}

.sidemenu-left {
  z-index: 1001;
  position: relative;
  height: 100vh;
  width: 100%;
  max-width: 600px;
  padding: 0 2rem;
  background: #1a1735;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidemenu-left ul {
  list-style: none;
  padding-top: 8vh;
  margin-top: 1rem;
  padding-bottom: 3vh;
  flex-grow: 1;
}

.sidemenu-left ul li {
  padding: 0.5rem 0;
  margin: 0;
}

.sidemenu-left ul li h3 {
  padding: 0;
  margin: 0;
  font-size: 2rem;
}

.sidemenu-left ul li h3 a {
  text-decoration: none;
  color: #c8c5e8;
  transition: opacity 0.2s;
}

.sidemenu-left ul li h3 a:hover {
  opacity: 0.8;
}

.sidemenu-left ul.nav-secondary {
  list-style: none;
  padding: 1rem 0 0 1.5rem;
  margin: 0;
}
.sidemenu-left ul.nav-secondary li {
  padding: 0.25rem 0;
}
.sidemenu-left ul.nav-secondary a {
  text-decoration: none;
  color: #c8c5e8;
  font-size: 1.25rem;
  transition: opacity 0.2s;
}
.sidemenu-left ul.nav-secondary a:hover {
  opacity: 0.8;
}

.sidemenu-left footer {
  padding: 2rem 0;
}

.sidemenu-right {
  position: fixed;
  width: 100%;
  height: 100vh;
  right: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
}

@media (max-width: 768px) {
  .sidemenu-left {
    max-width: 100%;
  }
  .sidemenu-right {
    display: none;
  }
}
@media (min-width: 769px) {
  .sidemenu-left {
    max-width: 40%;
  }
}