/* Miku Blue/Cyan Theme for Widget */
#crabchat-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: #1a1a1a;
  color: white;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  font-family: sans-serif;
}

#crabchat-header {
  padding: 10px;
  background: #00CED1;
  color: white;
  font-weight: bold;
}

#crabchat-messages {
  height: 200px;
  padding: 10px;
  overflow-y: auto;
}

#crabchat-form {
  border-top: 1px solid #333;
}

#crabchat-input {
  width: 100%;
  padding: 8px;
  border: none;
  outline: none;
}

.msg.you {
  text-align: right;
  margin-bottom: 6px;
}

/* Toggle Button */
#crabchat-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #00CED1 0%, #39C5BB 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 206, 209, 0.4);
  transition: all 0.3s ease;
  z-index: 9999;
}

#crabchat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0, 206, 209, 0.6);
}

#crabchat-toggle.active {
  bottom: 430px;
}

#crabchat {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 320px;
  background: #252525;
  color: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 206, 209, 0.3);
  border: 1px solid #333333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

#crabchat.hidden {
  opacity: 0;
  transform: translateY(20px);
  visibility: hidden;
  pointer-events: none;
}

#crabchat .header {
  background: linear-gradient(135deg, #00CED1 0%, #39C5BB 100%);
  color: white;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 10px rgba(0, 206, 209, 0.2);
}

#crabchat .status {
  float: right;
  font-size: 12px;
}

#crabchat .messages {
  height: 300px;
  padding: 12px;
  overflow-y: auto;
  background: #1a1a1a;
}

#crabchat .messages::-webkit-scrollbar {
  width: 6px;
}

#crabchat .messages::-webkit-scrollbar-track {
  background: #0f0f0f;
}

#crabchat .messages::-webkit-scrollbar-thumb {
  background: #00CED1;
  border-radius: 3px;
}

#crabchat .input {
  border: none;
  padding: 12px;
  outline: none;
  background: #252525;
  color: white;
  font-size: 14px;
  border-top: 1px solid #333;
  transition: background 0.2s ease;
}

#crabchat .input:focus {
  background: #2a2a2a;
}

#crabchat .input::placeholder {
  color: #666;
}

.msg {
  margin-bottom: 8px;
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.msg.you {
  margin-left: auto;
  background: linear-gradient(135deg, #00CED1 0%, #39C5BB 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 206, 209, 0.3);
}

.msg.agent {
  background: #333333;
  color: #ffffff;
}

.msg.system {
  background: transparent;
  color: #999;
  font-size: 12px;
  text-align: center;
  max-width: 100%;
  padding: 4px;
}
