/* COMIT Chatbot Widget Styles */

#comit-chatbot-widget {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

#comit-chatbot-widget *,
#comit-chatbot-widget *::before,
#comit-chatbot-widget *::after {
  box-sizing: border-box;
}

/* Launcher button */
.comit-chatbot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF851E, #FD6F0C);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(253, 111, 12, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}

.comit-chatbot-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 32px rgba(253, 111, 12, 0.5);
}

.comit-chatbot-launcher:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.comit-chatbot-launcher svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.comit-chatbot-launcher-label {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #110D0D;
  color: #EDECED;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.comit-chatbot-launcher:hover .comit-chatbot-launcher-label {
  opacity: 1;
}

/* Popup container */
.comit-chatbot-popup {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 99998;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 660px;
  max-height: calc(100vh - 120px);
  background: #110D0D;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: comitChatbotFadeIn 0.25s ease;
}

.comit-chatbot-popup.open {
  display: flex;
}

@keyframes comitChatbotFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.comit-chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, #08121F, #110D0D);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.comit-chatbot-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.comit-chatbot-header-desc {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: #57585C;
}

.comit-chatbot-header-close {
  background: none;
  border: none;
  color: #57585C;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comit-chatbot-header-close:hover {
  color: #EDECED;
  background: rgba(255,255,255,0.08);
}

.comit-chatbot-header-close:focus-visible {
  outline: 2px solid #FD6F0C;
  outline-offset: 2px;
}

/* Header action buttons */
.comit-chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.comit-chatbot-header-popout {
  background: none;
  border: none;
  color: #57585C;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comit-chatbot-header-popout:hover {
  color: #EDECED;
  background: rgba(255,255,255,0.08);
}

.comit-chatbot-header-popout:focus-visible {
  outline: 2px solid #FD6F0C;
  outline-offset: 2px;
}

/* Full-page pop-out mode */
#comit-chatbot-fullpage {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  height: 100vh;
}

.comit-chatbot-fullpage-active {
  display: flex !important;
  flex-direction: column;
}

.comit-chatbot-fullpage {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #110D0D;
  border-radius: 0;
  overflow: hidden;
}

.comit-chatbot-fullpage .comit-chatbot-messages {
  flex: 1;
}

/* Messages area */
.comit-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.comit-chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.comit-chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.comit-chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}

/* Messages */
.comit-chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  word-wrap: break-word;
  animation: comitChatbotMsgIn 0.2s ease;
}

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

.comit-chatbot-msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  color: #EDECED;
  border-bottom-left-radius: 4px;
}

.comit-chatbot-msg.bot a {
  color: #FD6F0C;
  text-decoration: underline;
}

.comit-chatbot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #FD6F0C, #FF851E);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.comit-chatbot-msg.typing {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  color: #57585C;
  font-style: italic;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.comit-chatbot-msg.typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #57585C;
  animation: comitChatbotTyping 1.2s ease-in-out infinite;
}

.comit-chatbot-msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.comit-chatbot-msg.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes comitChatbotTyping {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

/* Quick actions */
.comit-chatbot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 12px;
  flex-shrink: 0;
}

.comit-chatbot-quick-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #EDECED;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.comit-chatbot-quick-btn:hover {
  background: rgba(253, 111, 12, 0.15);
  border-color: #FD6F0C;
}

/* Show options bar */
.comit-chatbot-options-bar {
  display: none;
  justify-content: center;
  padding: 6px 18px 4px;
  flex-shrink: 0;
}

.comit-chatbot-show-options {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: #57585C;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  font-family: inherit;
}

.comit-chatbot-show-options:hover,
.comit-chatbot-show-options:focus-visible {
  color: #EDECED;
  border-color: #FD6F0C;
  background: rgba(253, 111, 12, 0.15);
}

.comit-chatbot-show-options:focus-visible {
  outline: 2px solid #FD6F0C;
  outline-offset: 2px;
}

.comit-chatbot-show-options:active {
  background: rgba(253, 111, 12, 0.25);
}

/* Privacy notice */
.comit-chatbot-privacy {
  padding: 8px 18px;
  font-size: 0.72rem;
  color: #57585C;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

/* Input area */
.comit-chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(8, 18, 31, 0.5);
  flex-shrink: 0;
}

.comit-chatbot-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: #EDECED;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.comit-chatbot-input:focus {
  border-color: #FD6F0C;
}

.comit-chatbot-input::placeholder {
  color: #57585C;
}

.comit-chatbot-send {
  background: linear-gradient(135deg, #FD6F0C, #FF851E);
  border: none;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.comit-chatbot-send:hover:not(:disabled) {
  opacity: 0.9;
  transform: scale(1.04);
}

.comit-chatbot-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.comit-chatbot-send svg {
  fill: #fff;
  width: 18px;
  height: 18px;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .comit-chatbot-launcher {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }

  .comit-chatbot-popup {
    bottom: 16px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    height: calc(100vh - 96px);
    max-height: calc(100vh - 96px);
    border-radius: 14px;
  }

  .comit-chatbot-launcher-label {
    display: none;
  }

  .comit-chatbot-launcher::after {
    content: 'CORA';
    position: absolute;
    bottom: -20px;
    font-size: 0.65rem;
    color: #57585C;
    white-space: nowrap;
  }
}
