/* ============================================ */
/* RESET & BASE STYLES */
/* ============================================ */

/* Apply border-box sizing to all elements */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Screen reader only - visually hidden but accessible to assistive technologies */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

body {
  height: 100vh; /* 100% of the viewport height */
  margin: 0; /* Remove default margin */
  background-color: #171717;
  font-family: verdana;
  color: white;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

a {
  color: white;
}

button {
  background-color: #171717;
  color: white;
}

/* ============================================ */
/* LAYOUT & CONTAINER STYLES */
/* ============================================ */

.container {
  display: flex; /* This enables flexbox */
  align-items: stretch; /* Stretch children to fill height */
  justify-content: space-around; /* This will space out the items evenly */
  position: relative; /* Ensure absolute positioning context */
  height: 100vh;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

.center {
  height: 100%;
  background-color: #171717;
  display: flex; /* Add flex display to center the chat-container */
  flex-direction: column; /* Stack children vertically */
  align-items: center; /* Horizontally center the chat-container */
  text-align: center;
  padding: 10px;
  min-width: 0; /* Allow flex item to shrink below content size */
  width: 100%; /* Ensure it takes full width and can shrink */
}

.center-wrapper {
  background-color: #171717;
  margin: auto;
  display: inline-block;
}

.text-wrapper {
  width: 90%;
  max-width: 100%;
}

/* ============================================ */
/* MENU & NAVIGATION */
/* ============================================ */

.menu {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  z-index: 200;
  overflow-y: auto; /* Make the menu scrollable */
  background-color: #171717; /* Ensure the background color covers the menu */
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5); /* Add shadow for overlay depth */
  border-right: 1px solid #333;
}

.menu .center {
  height: auto;
  min-height: 100%;
}

.menu form {
  width: 100%;
}

.menu .container {
  height: auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

/* Menu hidden state */
.container.menu-hidden .menu {
  display: none !important;
}

.container.menu-hidden .main-content {
  width: 100%;
}

.main-content {
  display: flex;
  width: 100%;
  height: 100%;
}

.main-content .center {
  flex-grow: 1;
  padding-top: 50px;
}

.quick-menu {
  width: 60px;
  height: 100%;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
  background-color: #171717;
  flex-shrink: 0;
  z-index: 10;
}

.hamburger-menu-button {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-block;
  padding: 10px;
}

.hamburger-menu-button:hover .icon-bar {
  background-color: white;
}

.icon-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px 0;
  background-color: #a8a8a8;
}

.quick-menu-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #a8a8a8;
  margin-top: 10px;
  text-decoration: none;
}

.quick-menu-button:hover {
  color: white;
}

.quick-menu-button svg {
  width: 24px;
  height: 24px;
}

.quick-menu-spacer {
  flex-grow: 1;
}

/* Customize the scrollbar for the menu */
.menu::-webkit-scrollbar {
  width: 8px; /* Set the width of the scrollbar */
}

.menu::-webkit-scrollbar-thumb {
  background-color: #333; /* Set the color of the scrollbar thumb */
}

.menu::-webkit-scrollbar-thumb:hover {
  background-color: #555; /* Set the color of the scrollbar thumb on hover */
}

/* ============================================ */
/* CHAT INTERFACE */
/* ============================================ */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 800px;
  min-width: 0; /* Allow flex item to shrink below content size */
}

.chat-window {
  flex-grow: 1;
  overflow-y: auto; /* Make it scrollable */
  padding: 10px;
}

/* Customize the scrollbar for chat window */
.chat-window::-webkit-scrollbar {
  width: 8px; /* Set the width of the scrollbar */
}

.chat-window::-webkit-scrollbar-thumb {
  background-color: #333; /* Set the color of the scrollbar thumb */
}

.chat-window::-webkit-scrollbar-thumb:hover {
  background-color: #555; /* Set the color of the scrollbar thumb on hover */
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 20px;
}

.input-container {
  flex: 0 0 auto; /* Do not grow, do not shrink, take up the space needed */
  display: flex;
  padding: 10px;
}

.sender-input {
  flex: 1; /* Fill out the remaining space */
  display: flex;
  align-items: center; /* Align items vertically */
  max-width: min(800px, 100%);
  width: 100%;
}

.sender-input textarea {
  flex: 1; /* Fill out the remaining space */
  width: 100%; /* Ensure it takes up the full width */
  background-color: #171717;
  color: white;
  font-size: 13px;
  border-radius: 15px;
  padding: 10px;
  margin: 10px;
}

.sender-input button {
  display: none;
}

.input-status-active {
  /* Style for when input is in status mode (disabled) */
  opacity: 0.7;
}

/* ============================================ */
/* MESSAGE STYLES */
/* ============================================ */

.message-row {
  display: flex;
  width: 100%;
  max-width: min(800px, 100%);
  margin: 0 auto 10px auto;
  min-width: 0; /* Allow flex item to shrink below content size */
}

.row-sender {
  justify-content: flex-end;
}

.row-receiver {
  justify-content: flex-start;
}

.message-container {
  display: block;
  max-width: 80%; /* Ensure message bubble doesn't exceed 80% of the row width */
  min-width: 0; /* Allow container to shrink below content size */
  overflow-wrap: break-word; /* Break long words if needed */
}

.sender-message {
  background-color: #007bff;
  color: #fff;
  font-size: 13px;
  text-align: left;
  border-radius: 15px 15px 0 15px;
  padding: 10px;
  margin-right: 10px;
  overflow-wrap: break-word; /* Break long words if needed */
  word-break: break-word; /* Additional word breaking support */
}

.receiver-message {
  background-color: #333;
  color: #fff;
  font-size: 13px;
  text-align: left;
  border-radius: 15px 15px 15px 0;
  padding: 10px;
  margin-left: 10px;
  position: relative;
  display: block;
  overflow-wrap: break-word; /* Break long words if needed */
  word-break: break-word; /* Additional word breaking support */
}

.receiver-message .message-content {
  padding: 0;
}

/* Bottom action bar that appears on hover - overlays the content */
.message-actions-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 10px;
  background-color: rgba(23, 23, 23, 0.9);
  border-radius: 0 0 15px 0;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.receiver-message:hover .message-actions-bar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.message-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #a8a8a8;
  font-size: 16px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-radius: 4px;
}

.message-action-btn:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.message-action-btn svg {
  width: 16px;
  height: 16px;
}

.code-block-container {
  background-color: rgba(0, 0, 0, 0.24);
  overflow-x: auto;
  border-radius: 15px 15px 0px 0px;
  padding: 10px;
  white-space: pre-wrap; /* Preserve white spaces and wrap text */
  min-width: 0; /* Allow code block to shrink and enable horizontal scroll */
  word-break: break-word; /* Break long words in code blocks */
  position: relative; /* For absolute positioning of copy button */
}

.code-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(23, 23, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: #a8a8a8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  opacity: 0; /* Hidden by default, shown on hover */
}

.code-block-container:hover .code-copy-button {
  opacity: 1;
}

/* Always show copy button on touch devices */
@media (hover: none) and (pointer: coarse) {
  .code-copy-button {
    opacity: 0.7; /* Slightly visible on touch devices */
  }
  
  .code-block-container:active .code-copy-button,
  .code-copy-button:active {
    opacity: 1;
  }
}

.code-copy-button:hover {
  background-color: rgba(23, 23, 23, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.code-copy-button:active {
  transform: scale(0.95);
}

.code-copy-button.copied {
  background-color: rgba(23, 23, 23, 0.95);
  border-color: rgba(255, 255, 255, 0.6);
  color: white;
}

.code-copy-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.code-copy-button .check-icon {
  color: #4ade80; /* Green checkmark for better visibility */
  stroke-width: 3; /* Slightly thicker for emphasis */
}

/* Customize the scrollbar for code blocks */
.code-block-container::-webkit-scrollbar {
  height: 8px; /* Set the width of the scrollbar */
}

.code-block-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.36); /* Set the color of the scrollbar thumb */
}

.code-block-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.18); /* Set the color of the scrollbar thumb on hover */
}

.audio-play-btn .play-icon,
.audio-play-btn .pause-icon {
  display: inline;
}

/* ============================================ */
/* FORM ELEMENTS */
/* ============================================ */

form select {
  border: 1px solid #333;
  border-radius: 12px;
  padding: 6px;
  margin: 3px;
  text-align: center;
  background-color: #171717;
  color: white;
  width: 90%;
}

.textarea-input {
  background-color: #171717;
  color: white;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 10px;
  margin: 3px;
  width: 90%;
  text-align: left;
  resize: vertical;
}

/* Customize the scrollbar for textarea-input */
.textarea-input::-webkit-scrollbar {
  width: 8px; /* Set the width of the scrollbar */
}

.textarea-input::-webkit-scrollbar-thumb {
  background-color: #333; /* Set the color of the scrollbar thumb */
}

.textarea-input::-webkit-scrollbar-thumb:hover {
  background-color: #555; /* Set the color of the scrollbar thumb on hover */
}

/* ============================================ */
/* ACTIVATOR & ANIMATIONS */
/* ============================================ */

.activator-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -15px; /* Negative margin to compensate for the extra whitespace from scaling */
  position: relative; /* Added for absolute positioning of status */
}

/* Use transform scale instead of width/height change to preserve animation ratios */
.activator-wrapper #activator {
  transform: scale(0.6);
  width: 80px; /* Increased to match animation native size */
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Loading animation */
.lds-loading {
  display: inline-block;
  position: relative;
  margin: auto;
  width: 80px;
  height: 80px;
}

.lds-loading div {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: lds-loading 1.2s linear infinite;
}

.lds-loading div:nth-child(1) {
  animation-delay: 0s;
  top: 37px;
  left: 66px;
}

.lds-loading div:nth-child(2) {
  animation-delay: -0.1s;
  top: 22px;
  left: 62px;
}

.lds-loading div:nth-child(3) {
  animation-delay: -0.2s;
  top: 11px;
  left: 52px;
}

.lds-loading div:nth-child(4) {
  animation-delay: -0.3s;
  top: 7px;
  left: 37px;
}

.lds-loading div:nth-child(5) {
  animation-delay: -0.4s;
  top: 11px;
  left: 22px;
}

.lds-loading div:nth-child(6) {
  animation-delay: -0.5s;
  top: 22px;
  left: 11px;
}

.lds-loading div:nth-child(7) {
  animation-delay: -0.6s;
  top: 37px;
  left: 7px;
}

.lds-loading div:nth-child(8) {
  animation-delay: -0.7s;
  top: 52px;
  left: 11px;
}

.lds-loading div:nth-child(9) {
  animation-delay: -0.8s;
  top: 62px;
  left: 22px;
}

.lds-loading div:nth-child(10) {
  animation-delay: -0.9s;
  top: 66px;
  left: 37px;
}

.lds-loading div:nth-child(11) {
  animation-delay: -1s;
  top: 62px;
  left: 52px;
}

.lds-loading div:nth-child(12) {
  animation-delay: -1.1s;
  top: 52px;
  left: 62px;
}

@keyframes lds-loading {
  0%, 20%, 80%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.5);
  }
}

/* Talking animation */
.lds-talking {
  display: inline-block;
  position: relative;
  margin: auto;
  width: 80px;
  height: 80px;
}

.lds-talking div {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: lds-talking 1.2s linear infinite;
}

.lds-talking div:nth-child(1) {
  animation-delay: 0s;
  top: 37px;
  left: 66px;
}

.lds-talking div:nth-child(2) {
  animation-delay: 0s;
  top: 22px;
  left: 62px;
}

.lds-talking div:nth-child(3) {
  animation-delay: 0s;
  top: 11px;
  left: 52px;
}

.lds-talking div:nth-child(4) {
  animation-delay: 0s;
  top: 7px;
  left: 37px;
}

.lds-talking div:nth-child(5) {
  animation-delay: 0s;
  top: 11px;
  left: 22px;
}

.lds-talking div:nth-child(6) {
  animation-delay: 0s;
  top: 22px;
  left: 11px;
}

.lds-talking div:nth-child(7) {
  animation-delay: 0s;
  top: 37px;
  left: 7px;
}

.lds-talking div:nth-child(8) {
  animation-delay: 0s;
  top: 52px;
  left: 11px;
}

.lds-talking div:nth-child(9) {
  animation-delay: 0s;
  top: 62px;
  left: 22px;
}

.lds-talking div:nth-child(10) {
  animation-delay: 0s;
  top: 66px;
  left: 37px;
}

.lds-talking div:nth-child(11) {
  animation-delay: 0s;
  top: 62px;
  left: 52px;
}

.lds-talking div:nth-child(12) {
  animation-delay: 0s;
  top: 52px;
  left: 62px;
}

@keyframes lds-talking {
  80%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.5);
  }
}

/* ============================================ */
/* TABLE STYLES */
/* ============================================ */

table {
  border-collapse: separate; /* Allows for rounded corners */
  border-spacing: 5px; /* Space between cells for transparency effect */
  width: 100%; /* Adjust as needed */
  background-color: rgba(255, 255, 255, 0);
}

th, td {
  background-color: #101010; /* Adjust as needed */
  border: none; /* Remove borders for a cleaner look */
  border-radius: 12px; /* Rounded edges for cells */
  padding: 10px; /* Adjust padding as needed */
  text-align: center; /* Or center, based on your preference */
}

th {
  position: sticky;
  top: 0;
}

/* ============================================ */
/* SESSIONS PAGE */
/* ============================================ */

/* Target sessions page container by checking for #session-list child */
/* Using :has() selector (supported in modern browsers) */
.container:has(#session-list) {
  max-width: min(800px, 100%);
  margin: 0 auto;
  padding: 20px;
  color: white;
  font-family: verdana, sans-serif;
  display: block;
  height: auto;
  position: static;
  justify-content: normal;
  align-items: normal;
}

.container:has(#session-list) h1 {
  text-align: center;
  margin-bottom: 30px;
}

/* Sessions list styles */
#session-list ul {
  list-style-type: none;
  padding: 0;
}

#session-list li {
  margin-bottom: 10px;
}

#session-list a {
  display: block;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #333;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.2s;
}

#session-list a:hover {
  background-color: #444;
}

#session-list a small {
  color: #aaa;
}

/* ============================================ */
/* MEDIA QUERIES */
/* ============================================ */

/* ============================================ */
/* AUTHENTICATION PAGES STYLES */
/* ============================================ */

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background-color: #1f1f1f;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 30px;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  color: #ccc;
}

.form-group input {
  background-color: #171717;
  border: 1px solid #333;
  color: white;
  padding: 12px;
  border-radius: 4px;
  font-size: 16px;
  font-family: verdana;
}

.form-group input:focus {
  outline: none;
  border-color: #555;
}

.auth-button {
  background-color: #333;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 16px;
  font-family: verdana;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
  display: inline-block;
}

/* For button elements, use standard padding */
button.auth-button {
  padding: 12px;
}

.auth-button:hover {
  background-color: #444;
}

.auth-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-links a {
  color: #888;
  text-decoration: none;
  font-size: 14px;
}

.auth-links a:hover {
  color: white;
}

.error-message {
  background-color: #4a1a1a;
  border: 1px solid #8b2a2a;
  color: #ff6b6b;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
  display: none;
}

.error-message.show {
  display: block;
}

.success-message {
  background-color: #1a4a1a;
  border: 1px solid #2a8b2a;
  color: #6bff6b;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
  display: none;
}

.success-message.show {
  display: block;
}

/* Additional styles for confirm page */
.auth-card p {
  color: #ccc;
  margin-bottom: 20px;
}

.auth-card.text-center {
  text-align: center;
}

.error-message,
.success-message {
  margin-bottom: 20px;
}

/* Media queries removed - using flexible layout for all screen sizes */
