/* ===== Chat Styles ===== */

/* Chatbox container */
#chatbox {
  position: fixed;
  right: 0;
  bottom: 0;
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 700;
  background: linear-gradient(135deg,
    rgba(30, 41, 59, 0.98) 0%,
    rgba(15, 23, 42, 0.98) 100%);
  width: 40%;
  backdrop-filter: blur(12px);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Header / collapse button */
#collapseButton {
  color: #fff;
  padding: 12px 16px;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: 1.1em;
  flex-shrink: 0;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

#collapseButton::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

#collapseButton:hover::before {
  left: 100%;
}

/* Closed (default) */
#chatbox.closed #collapseButton {
  position: absolute;
  background: linear-gradient(135deg,
    rgba(239, 68, 68, 0.95) 0%,
    rgba(220, 38, 38, 1) 100%);
  height: 6.1vh;
  z-index: 1000;
  width: 20%;
  bottom: 0;
  right: 0;
  border-radius: 8px 0 0 0;
  box-shadow:
    0 -4px 16px rgba(239, 68, 68, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

#chatbox.closed #collapseButton:hover {
  background: linear-gradient(135deg,
    rgba(248, 113, 113, 0.95) 0%,
    rgba(239, 68, 68, 1) 100%);
  box-shadow:
    0 -6px 24px rgba(239, 68, 68, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Open */
#chatbox.open #collapseButton {
  background: linear-gradient(135deg,
    rgba(34, 197, 94, 0.95) 0%,
    rgba(22, 163, 74, 1) 100%);
  box-shadow:
    0 4px 16px rgba(34, 197, 94, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

#chatbox.open #collapseButton:hover {
  background: linear-gradient(135deg,
    rgba(74, 222, 128, 0.95) 0%,
    rgba(34, 197, 94, 1) 100%);
  box-shadow:
    0 4px 24px rgba(34, 197, 94, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

  /* Chat content */
  #chatContent {
    flex-direction: column;
    height: 30vh; /* 30% of screen height */
  }

  #chatbox.open #chatContent {
    display: flex;
  }
  
  #chatbox.closed #chatContent {
    display: none;
	height: 6vh;
  }


  /* Messages list */
  #messageschat {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 15px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.5);
    scroll-behavior: smooth;
  }

  #messageschat::-webkit-scrollbar {
    width: 8px;
  }

  #messageschat::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
  }

  #messageschat::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
  }

  #messageschat::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
  }

  /* Individual messages */
  #messageschat li {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(102, 126, 234, 0.5);
    border-radius: 4px;
    transition: all 0.2s ease;
  }

  #messageschat li:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: rgba(102, 126, 234, 0.8);
    transform: translateX(3px);
  }

  /* Form */
  #form {
    display: flex;
    flex-direction: row;
    padding: 12px;
    background: linear-gradient(135deg,
      rgba(51, 65, 85, 0.98) 0%,
      rgba(30, 41, 59, 0.98) 100%);
    border-top: 1px solid rgba(102, 126, 234, 0.3);
    gap: 8px;
  }

  #input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    font-size: 0.95em;
    transition: all 0.3s ease;
    height: 2em;
  }

  #input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
  }

  #input::placeholder {
    color: rgba(255, 255, 255, 0.4);
  }

  #form button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg,
      rgba(102, 126, 234, 0.9) 0%,
      rgba(79, 70, 229, 0.9) 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  }

  #form button:hover {
    background: linear-gradient(135deg,
      rgba(124, 148, 248, 0.9) 0%,
      rgba(102, 126, 234, 0.9) 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
  }

  #form button:active {
    transform: translateY(0);
  }