/* SICD Chat Widget Styles */
.sicd-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c93530, #dc2626);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(201, 53, 48, 0.55), 0 0 20px rgba(201, 53, 48, 0.35);
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.sicd-chat-launcher:hover {
  transform: scale(1.1);
  box-shadow: 0 14px 36px rgba(201, 53, 48, 0.7);
}

.sicd-chat-launcher:active {
  transform: scale(0.95);
}

.sicd-chat-launcher svg {
  width: 28px;
  height: 28px;
  display: block;
}

.sicd-chat-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  background: #10b981;
  border-radius: 50%;
  border: 2.5px solid #111827;
  box-shadow: 0 0 6px #10b981;
}

/* Chat Container */
.sicd-chat-panel {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 390px;
  max-width: calc(100vw - 36px);
  height: 580px;
  max-height: calc(100vh - 130px);
  background: rgba(15, 19, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100000 !important;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sicd-chat-panel.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.sicd-chat-header {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sicd-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sicd-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(201, 53, 48, 0.18);
  border: 1px solid rgba(201, 53, 48, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c93530;
}

.sicd-chat-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f9fafb;
  line-height: 1.2;
}

.sicd-chat-status {
  font-size: 0.75rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sicd-chat-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.sicd-chat-close-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.sicd-chat-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Message Body */
.sicd-chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sicd-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.sicd-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.sicd-chat-msg {
  max-width: 88%;
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  word-wrap: break-word;
}

.sicd-chat-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e5e7eb;
  border-bottom-left-radius: 4px;
}

.sicd-chat-msg.bot strong {
  color: #ffffff;
}

.sicd-chat-msg.bot a, .chat-link-btn {
  color: #38bdf8;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.sicd-chat-msg.user {
  align-self: flex-end;
  background: #c93530;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.sicd-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
}

.sicd-typing span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: sicdDotBounce 1.2s infinite ease-in-out;
}
.sicd-typing span:nth-child(2) { animation-delay: 0.2s; }
.sicd-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sicdDotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Quick Suggestion Pills */
.sicd-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1.25rem 0.75rem;
}

.sicd-sugg-pill {
  font-size: 0.76rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sicd-sugg-pill:hover {
  background: rgba(201, 53, 48, 0.2);
  border-color: #c93530;
  color: #ffffff;
}

/* Input Area */
.sicd-chat-input-area {
  padding: 0.85rem 1.25rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sicd-chat-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 4px 6px 4px 12px;
  transition: border-color 0.2s;
}

.sicd-chat-form:focus-within {
  border-color: #c93530;
}

.sicd-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.88rem;
  font-family: inherit;
}

.sicd-chat-input::placeholder {
  color: #6b7280;
}

.sicd-chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #c93530;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.sicd-chat-send-btn:hover {
  background: #b91c1c;
}

@media (max-width: 480px) {
  .sicd-chat-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
}
