/* Embedded Chatbot Styles - For integration into other pages */
@import url("https://fonts.googleapis.com/css2?family=Baloo+2&display=swap");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css");

:root {
  --msger-bg: #0e0e0e;
  --left-msg-bg: linear-gradient(to right, #4a9db5, #4a9db5);
  --right-msg-bg: #ececec;
}

.chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: "Baloo 2", cursive;
}

.msger {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 386px;
  height: 600px;
  max-height: 90vh;
  border-radius: 10px;
  background: var(--msger-bg);
  box-shadow: 0 15px 15px -5px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.msger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px 10px 0px 0px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e3e7ee 100%);
  color: #666;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.msger-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: column;
}

.msger-header-title img {
  height: 2.5rem;
  width: auto;
}

.msger-header-title p {
  letter-spacing: 1px;
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0;
}

.msger-header-subtitle {
  font-size: 0.75rem;
  font-weight: normal;
  color: #888;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.msger-minimize-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.msger-minimize-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.msger-minimize-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.msger-minimize-btn i {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #fff;
}

.msger-minimize-btn:hover i {
  transform: rotate(10deg);
}

.msger-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background-color: #ecf8f8;
}

.msger-chat::-webkit-scrollbar {
  width: 6px;
}

.msger-chat::-webkit-scrollbar-track {
  background: #ddd;
}

.msger-chat::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 10px;
}

.msg {
  display: flex;
  align-items: flex-end;
  margin-bottom: 10px;
}

.msg:last-of-type {
  margin: 0;
}

.msg-img {
  width: 60px;
  height: 60px;
  margin-right: 10px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.msg-bubble {
  max-width: 350px;
  padding: 15px;
  border-radius: 15px;
  background: var(--left-msg-bg);
}

.msg-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.msg-info-name {
  margin-right: 10px;
  font-weight: bold;
}

.msg-info-time {
  font-size: 0.85em;
}

.left-msg .msg-bubble {
  color: #fff;
  border-bottom-left-radius: 0;
}

.right-msg {
  flex-direction: row-reverse;
}

.right-msg .msg-bubble {
  background: var(--right-msg-bg);
  color: #000;
  border-bottom-right-radius: 0;
}

.right-msg .msg-img {
  margin: 0 0 0 10px;
}

.msger-inputarea {
  display: flex;
  padding: 10px;
  background: #add8f4;
  border-radius: 0px 0px 10px 10px;
  flex-shrink: 0;
}

.msger-inputarea * {
  padding: 5px;
  border: none;
  border-radius: 3px;
  font-size: 1em;
}

.msger-input {
  flex: 1;
  background: transparent;
  outline: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-family: "Baloo 2", cursive;
}

.msger-send-btn {
  margin-left: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msger-send-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: scale(1.05);
}

.msger-send-btn:active {
  transform: scale(0.95);
}

/* MINIMIZE/HIDDEN STATES */
.chatbot-widget.minimized .msger {
  height: 60px;
  max-height: 60px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.chatbot-widget.minimized .msger-chat,
.chatbot-widget.minimized .msger-inputarea {
  display: none;
}

.chatbot-widget.minimized .msger-header {
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

.chatbot-widget.minimized .msger-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow: hidden;
}

.chatbot-widget.minimized .msger-header-title p {
  color: #fff;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 1;
}

.chatbot-widget.minimized .msger-header-title img {
  filter: brightness(1.2);
  flex-shrink: 0;
  height: 2rem;
  width: auto;
}

.msger-minimize-btn.minimized {
  background: linear-gradient(135deg, #48c774 0%, #209c2f 100%);
  box-shadow: 0 4px 8px rgba(72, 199, 116, 0.3);
}

.msger-minimize-btn.minimized:hover {
  background: linear-gradient(135deg, #209c2f 0%, #48c774 100%);
  box-shadow: 0 6px 12px rgba(72, 199, 116, 0.4);
}

.msger-minimize-btn.minimized i {
  color: #fff;
  font-size: 1.2rem;
}

/* Alternative minimize state using #chatbot-container */
#chatbot-container.minimized {
  height: 60px;
  max-height: 60px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

#chatbot-container.minimized .msger-chat,
#chatbot-container.minimized .msger-inputarea {
  display: none;
}

#chatbot-container.minimized .msger-header {
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

#chatbot-container.minimized .msger-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow: hidden;
}

#chatbot-container.minimized .msger-header-title p {
  color: #fff;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 1;
}

#chatbot-container.minimized .msger-header-title img {
  filter: brightness(1.2);
}

/* Responsive */
@media (max-width: 480px) {
  .chatbot-widget {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }

  .msger {
    max-width: 100%;
    height: 500px;
  }
}
