:root {
  --bs-card-spacer-y: 0 !important;
  --bs-card-spacer-x: 0 !important;
}

html {
  height: 100vh;
  background-color: #f2f7f8;
}

body {
  position: relative;
}

input[type="range"]::-webkit-slider-runnable-track {
  background-color: #ddd;
}

/*  ---------------- layout ---------------- */
.container {
  width: 100%;
  height: 100%;
  display: flex;
  overflow: hidden;
}

.left {
  position: relative;
  flex: 0 0 240px;
  max-width: 240px;
  min-width: 240px;
  height: 100vh;
  box-shadow: 1px 0px 20px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  overflow-x: hidden;
}

.right {
  position: relative;
  flex: 1 1 880px;
  max-width: 880px;
  background-color: #f2f7f8;
  padding-top: 1rem;
  padding-bottom: 1rem;
  height: 100vh;
  overflow-y: auto;
}

/*  ---------------- layout ---------------- */

/* --------------- player  --------------- */

.player {
  position: relative;
  width: 100%;
  height: 220px;
}

.local-player-name,
.remote-player-name {
  position: absolute;
  right: 4px;
  top: 4px;
  color: #fcfafa;
  z-index: 1;
  font-size: 14px;
  font-weight: bold;
}

.video-group .card-body {
  padding: 0;
  border-radius: 0 0 0.375rem 0.375rem;
  overflow: hidden;
}

#remote-playerlist {
  min-height: 220px;
  width: 100%;
}

#remote-playerlist > div + div {
  margin-top: 1rem;
}

/* --------------- player  --------------- */

/* ------------- slider -------------   */
.sidebar {
  position: relative;
  padding: 1rem;
  min-width: 240px;
  box-sizing: border-box;
}

.sidebar-top {
  padding-right: 1rem;
  position: relative;
}

.sidebar-top-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.sidebar-menu {
  cursor: pointer;
}

.sidebar-title {
  position: relative;
  margin-bottom: 0.25rem !important;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
}

.triangle {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid rgba(0, 0, 0, 0.85);
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

/* hover */
.sidebar-title.hover {
  color: #009efb !important;
  border-top-color: #009efb;
}

.sidebar-title.hover .triangle {
  border-top-color: #009efb;
}

/* :active */
.sidebar-title.active {
  color: #009efb !important;
}

.sidebar-title.active .triangle {
  border-top-color: #009efb;
}

.sidebar-title .triangle.open {
  border-bottom: 0.3em solid;
  border-top: 0;
}

.sidebar-top a {
  display: inline-block;
}

.sidebar-item {
  font-size: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar-item a {
  padding: 6px 35px 6px 15px;
  display: inline-block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: black;
}

/* hover */
.sidebar-item.hover {
  border-left: 3px solid #009efb;
  border-radius: 2px;
}

.sidebar-item.hover a {
  color: #009efb !important;
}

/* active */
.sidebar-item.active {
  background-color: #f2f7f8;
  border-left: 3px solid #009efb;
  border-radius: 2px;
}

.sidebar-item.active a {
  color: #009efb !important;
  font-weight: 500;
}

/* ------------- slider -------------   */

/* -------------- utils -------------- */
.mw-700px {
  max-width: 700px;
}

.hidden {
  display: none;
}

/* -------------- utils -------------- */

/* ------------------- mixing  ------------------- */
.play-audio-mixing {
  display: block;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 12px solid #2c3e50;
  transform: translate(10px, 5px);
  position: relative;
  z-index: 1;
  transition: all 0.3s;
  -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  left: 2px;
}

.play-audio-mixing:before {
  content: "";
  position: absolute;
  top: -15px;
  left: -23px;
  bottom: -15px;
  right: -7px;
  border-radius: 50%;
  border: 2px solid #2c3e50;
  z-index: 2;
  transition: all 0.3s;
  box-sizing: content-box;
}

.play-audio-mixing:after {
  box-sizing: content-box;
  content: "";
  opacity: 0;
  transition: opacity 0.6s;
}

.play-audio-mixing:hover:before {
  transform: scale(1.1);
}

.play-audio-mixing.active {
  border-color: transparent;
}

.play-audio-mixing.active:after {
  content: "";
  opacity: 1;
  width: 10px;
  height: 16px;
  background: #2c3e50;
  position: absolute;
  right: 1px;
  top: -8px;
  border-left: 4px solid #2c3e50;
  box-shadow: inset 6px 0 0 0 #f9f9f9;
}

/* ------------------- mixing  ------------------- */

/* --------------- step ------------------ */
.step {
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: #fcfafa;
  border-radius: 0.5rem;
}

.step button {
  margin: 5px 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------- step ------------------ */

/* ----------------- offcanvasNavbar -------------- */
#offcanvas-navbar {
  max-width: 280px;
}

#offcanvas-navbar .offcanvas-body {
  padding: 0;
}

#offcanvas-navbar .close-wrapper {
  position: relative;
  display: inline-block;
  padding: 0 1rem;
  display: flex;
  justify-content: flex-end;
  z-index: 99999;
}

#offcanvas-navbar .btn-close {
  position: absolute;
  top: 1.25rem;
}

/* ----------------- offcanvasNavbar -------------- */

/* --------------- other ------------------ */

button#join,
button#leave {
  min-width: 4rem;
}

.alert {
  position: fixed;
  max-width: 320px;
  min-width: auto;
  width: auto;
  left: 20px;
  top: 20px;
  z-index: 9999;
  padding: 6px 12px;
  font-size: 0.85rem;
  line-height: 1.2;
  height: 30px;
}

.alert-success {
  background-color: rgba(209, 250, 229, 0.8) !important;
  color: #065f46 !important;
  border: none !important;
  font-weight: 400 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.alert-success .btn-close {
  opacity: 0.6;
}

.alert-success .btn-close:hover {
  opacity: 1;
}

.ai-connected-message {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #10b981;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 100;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.ai-connected-message.fade-out {
  opacity: 0;
}

.modal-body {
  max-height: 500px;
  overflow-y: scroll;
}

.play-button {
  display: inline-block;
  vertical-align: middle;
  width: 30px;
  height: 30px;
}

.audio-bar {
  padding: 0 4px;
  display: inline-block;
  vertical-align: middle;
  flex: 1 1 auto;
}

.audio-time {
  display: inline-block;
  vertical-align: middle;
}

.progress-bar {
  transition: none;
}

#agora-collapse .content {
  background: #fcfafa;
  padding: 10px;
  border: 1px solid #ddd;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
  overflow: hidden;
}

#remote-audio {
  width: 100%;
  text-align: left;
  padding-left: 10px;
  font-size: 14px;
}

.collapse .profile-list {
  max-width: 300px;
}

.language-list {
  height: 30px;
  line-height: 30px;
  margin-left: 3rem;
  cursor: pointer;
}

.divide-line {
  width: 100%;
  height: 1px;
  background-color: #ddd;
}

.tips {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 12px;
  color: gray;
}

.card + .card {
  margin-top: 0.75rem;
}

.sm-navbar {
  width: 100%;
  overflow: hidden;
}

/* fix bg color */
.sm-navbar button {
  color: #f2f7f8;
  background-color: #ffffff;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* fix container */
@media (min-width: 1200px) {
  .container {
    max-width: 1120px;
    min-width: 1120px;
  }
}

/* Small on phone*/
@media (max-width: 576px) {
  .container {
    flex-direction: column;
    overflow: auto;
  }

  .left {
    max-width: 100%;
    flex: 0 0 auto;
    height: 100%;
    overflow: hidden;
    background-color: #f2f7f8;
  }

  .right {
    padding-top: 0;
    height: 100%;
    overflow: visible;
    flex: 1 1 auto;
  }
}

/* Large	 */
@media (max-width: 992px) {
  form {
    margin-top: 0.5rem !important;
  }
}

.overflow-hidden {
  overflow: hidden;
}

/* Agent History Styles */
#agent-history-container {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0;
  max-height: 500px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.3s ease-out;
}

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

.agent-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.agent-history-title {
  margin: 0;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 600;
}

.btn-close-history {
  background: transparent;
  border: none;
  color: #6b7280;
  width: 10px !important;
  height: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  font-weight: 300;
}

.btn-close-history:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.agent-history-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  background: #f9fafb;
}

.agent-history-content::-webkit-scrollbar {
  width: 6px;
}

.agent-history-content::-webkit-scrollbar-track {
  background: transparent;
}

.agent-history-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.agent-history-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.history-empty {
  text-align: center;
  color: #9ca3af;
  padding: 40px 20px;
  font-style: italic;
  font-size: 0.95rem;
}

.history-message {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

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

.history-message.assistant {
  align-items: flex-start;
}

.history-message.user {
  align-items: flex-end;
}

.history-message-role {
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 6px;
  padding: 0 4px;
  opacity: 0.7;
}

.history-message.user .history-message-role {
  color: #10b981;
  text-align: right;
}

.history-message.assistant .history-message-role {
  color: #6366f1;
  text-align: left;
}

.history-message-content {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 75%;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.95rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-message.user .history-message-content {
  background: #10b981;
  color: white;
  border-bottom-right-radius: 4px;
}

.history-message.assistant .history-message-content {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

/* View History Button */
.btn-view-history {
  background: white;
  color: #4f46e5;
  border: 2px solid #4f46e5;
  font-weight: 600;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-view-history:hover:not(:disabled) {
  background: #4f46e5;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-view-history:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
  opacity: 0.6;
}
