.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  /* Adjust opacity here */
  z-index: 0;
}

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

@font-face {
  font-family: 'stolf';
  src: url('stolf.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'albert';
  src: url('albertsan.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

body,
html {
  height: 100%;
  font-family: 'albert';
  background: url('background.webp') no-repeat center center/cover;
  background-attachment: fixed;
  color: rgb(0, 0, 0);
}

body::before {
  content: '';
  position: fixed;
  top: 40px;
  left: 0;
  width: 100%;
  height: 50px;
  /* Adjust the height of the fade effect */
  background: linear-gradient(to bottom, rgba(240, 229, 229, 1) 25%, rgba(240, 229, 229, 0) 100%);
  z-index: 2;
  /* Make sure it's above the content but below the nav */
  pointer-events: none;
  /* Allow clicks to go through */
}

/* VERY HIGH z-index and fixed positioning for nav and popup to always be on top */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  /* Make sure it's very high */
  background-color: #1F1F28;
  padding: 10px 20px;
  border-radius: 0;
}

.top-nav button {
  background: transparent;
  color: white;
  border: none;
  padding: 0px 10px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
}

.page-buttons button {
  margin-right: 4px;
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgb(240, 229, 229);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  width: 220px;
  border-radius: 6px;
  z-index: 999;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease;
}


.popup ul {
  list-style: none;
}

/* .popup li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
}

.popup li a {
  text-decoration: none;
  color: inherit;
} */

.hidden {
  display: none;
}

/* CONTENT AREA */
.content {
  padding: 60px 20px 20px;
  max-width: 900px;
  margin-left: 10px;
  /* so content doesn't cover left nav */
  position: relative;
  z-index: 1;
  /* BELOW nav and popup */
  pointer-events: auto;
  /* allow interactions inside content */
}

.content>* {
  padding: 10px;
  /* background-color: rgba(149, 24, 24, 0.6); */
  border-radius: 8px;
}

.icon-btn {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* 
.popup li.selected {
  background-color: #4E4948;
  border-radius: 4px;
  color: gold;
} */

.spacer {
  height: 15px;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  color: #111;
  line-height: 1.3;
  margin: 0.2em;
}

h1 {
  font-family: 'stolf', monospace;
  font-size: 2em;
  margin-bottom: 0.2em;
}

h2 {
  font-weight: 400;
  font-size: 1.2em;
  margin-top: 0;
  margin-bottom: 0.25em;
}

a {
  color: #0073e6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p {
  margin: 0.4em 0 0.8em 0;
}

i,
em {
  font-style: italic;
  font-weight: 600;
}

b,
strong {
  font-weight: 800;
}

b em,
em b,
strong em,
em strong {
  font-style: italic;
  font-weight: 800;
}

.role-header {
  display: flex;
  align-items: flex-start;
  gap: 1em;
}

.role-title {
  font-weight: 800;
}

.role-info {
  font-size: 0.9em;
  margin-top: 0.2em;
}

img.icon {
  height: 4em;
  aspect-ratio: 1 / 1;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

img.responsive {
  width: 100%;
  height: auto;
  max-width: 900px;
  /* Optional: limits how large it can get */
}

ul {
  list-style-type: "- ";
  /* mimics your dash */
  padding-left: 1em;
}

li {
  margin-bottom: 0.5em;
}

/* AI Chat Widget Styles */
.chat-widget-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-toggle-btn {
  background: #1F1F28;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, background 0.2s;
}

.chat-toggle-btn:hover {
  transform: scale(1.05);
  background: #2a2a35;
}

.chat-modal {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 350px;
  height: 500px;
  background: rgba(31, 31, 40, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transition: opacity 0.3s, transform 0.3s;
  color: #e0e0e0;
}

.chat-modal.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.chat-header {
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a24;
}

.chat-header h3 {
  margin: 0;
  font-size: 1.1em;
  font-family: 'stolf', monospace;
  color: white;
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.chat-close-btn:hover {
  color: white;
}

.chat-history {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95em;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
  white-space: pre-line;
  position: relative;
  transition: all 0.2s ease;
}

.bot-message {
  background: #2d2d3a;
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  margin-left: 5px;
}

.user-message {
  background: #4a4a6a;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  margin-right: 5px;
}

/* Welcome Message Special Styling */
.welcome-message {
  align-self: center;
  max-width: 90%;
  text-align: center;
  background: linear-gradient(135deg, rgba(66, 66, 84, 0.4), rgba(31, 31, 40, 0.4));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 10px 0 20px 0;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Header với dấu chấm xanh nhấp nháy */
.header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }

  100% {
    transform: scale(0.95);
    opacity: 1;
  }
}

/* Khung tin nhắn chào mừng */
.welcome-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
  border-radius: 12px 12px 12px 2px;
  /* Bo góc kiểu bubble chat */
  margin: 10px;
}

.welcome-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e5e7eb;
}

/* Khu vực nhập liệu */
.chat-input-area {
  padding: 12px 16px;
  background: #1f2023;
  display: flex;
  align-items: flex-end;
  /* Để textarea giãn lên trên */
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#chatInput {
  flex: 1;
  background: #2d2e32;
  border: 1px solid #3f3f46;
  border-radius: 20px;
  /* Bo tròn kiểu hiện đại */
  color: #fff;
  padding: 10px 16px;
  font-size: 0.9rem;
  max-height: 120px;
  overflow-y: auto;
  transition: all 0.2s;
}

#chatInput:focus {
  outline: none;
  border-color: #6366f1;
  background: #333438;
}

/* Nút Send tròn tinh tế */
#chatSendBtn {
  background: #6366f1;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
  flex-shrink: 0;
}

#chatSendBtn:hover {
  background: #4f46e5;
  transform: scale(1.05);
}

.chat-input-area {
  padding: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
  background: #1a1a24;
}

.chat-input-area textarea {
  flex: 1;
  resize: none;
  height: 40px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #2d2d3a;
  color: white;
  padding: 8px;
  font-family: inherit;
  font-size: 0.9em;
}

.chat-input-area textarea:focus {
  outline: none;
  border-color: #666699;
}

.chat-input-area button {
  background: #4a4a6a;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.chat-input-area button:hover {
  background: #5a5a8a;
}