/* clinbot-widget.css - ClinBot Chat Widget Styles */

#clinbot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a237e, #283593);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 9999;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  user-select: none;
}

#clinbot-bubble:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

#clinbot-bubble:active {
  transform: scale(0.95);
}

#clinbot-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 380px;
  height: 560px;
  background: #fff;
  border-radius: 12px 0 0 0;
  display: flex;
  flex-direction: column;
  z-index: 9998;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

#clinbot-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cb-header {
  background: #1a237e;
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.cb-header .cb-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.8;
}

.cb-header .cb-close:hover {
  opacity: 1;
}

.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cb-msg-bot {
  background: #e8eaf6;
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 85%;
  font-size: 13px;
  line-height: 1.4;
  color: #1a237e;
  align-self: flex-start;
  word-wrap: break-word;
}

.cb-msg-user {
  background: #283593;
  color: white;
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 85%;
  font-size: 13px;
  align-self: flex-end;
  word-wrap: break-word;
}

.cb-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.cb-option-btn {
  border: 1px solid #1a237e;
  color: #1a237e;
  background: white;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}

.cb-option-btn:hover {
  background: #1a237e;
  color: white;
}

.cb-typing {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  align-items: center;
  flex-shrink: 0;
}

.cb-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9e9e9e;
  animation: cb-bounce 1.4s infinite ease-in-out both;
}

.cb-typing-dot:nth-child(1) { animation-delay: 0s; }
.cb-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.cb-typing-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes cb-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.cb-result-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #ddd;
  margin-bottom: 8px;
}

.cb-result-tab {
  background: none;
  border: none;
  padding: 6px 14px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.cb-result-tab:hover {
  color: #1a237e;
}

.cb-result-tab.active {
  color: #1a237e;
  border-bottom-color: #1a237e;
}

.cb-result-pane {
  position: relative;
}

.cb-result-pane pre {
  background: #263238;
  color: #e0e0e0;
  font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 12px;
  padding: 12px;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.cb-result-pane iframe {
  width: 100%;
  height: 200px;
  border: none;
  border-radius: 6px;
}

.cb-copy-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}

.cb-copy-btn:hover {
  background: rgba(255,255,255,0.3);
}

.cb-copy-btn.copied {
  background: #4caf50;
}

.cb-input-row {
  border-top: 1px solid #ddd;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  gap: 8px;
  flex-shrink: 0;
}

.cb-input-row textarea {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  resize: none;
  outline: none;
  font-family: inherit;
  max-height: 100px;
  line-height: 1.4;
}

.cb-input-row textarea:focus {
  border-color: #1a237e;
}

.cb-input-row textarea:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.cb-input-row .cb-send-btn {
  background: #1a237e;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.cb-input-row .cb-send-btn:hover {
  background: #283593;
}

.cb-input-row .cb-send-btn:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

.cb-cdisc-row {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.cb-cdisc-row.pass {
  background: #e8f5e9;
  color: #2e7d32;
}

.cb-cdisc-row.fail {
  background: #ffebee;
  color: #c62828;
}

.cb-cdisc-row.skip {
  background: #f5f5f5;
  color: #757575;
}

.cb-error {
  color: #c62828;
  background: #ffebee;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  align-self: flex-start;
  max-width: 85%;
}

@media (max-width: 420px) {
  #clinbot-panel {
    width: 100vw;
  }
}
