#digsure-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  font-family: Arial, Helvetica, sans-serif;
}

#digsure-chat-widget .dcw-bubble {
  height: 56px;
  width: 56px;
  border-radius: 50%;
  background-color: #111111;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  position: relative;
  transition: transform 0.15s ease;
}

#digsure-chat-widget .dcw-bubble:hover {
  transform: scale(1.05);
  background-color: #000000;
}

#digsure-chat-widget .dcw-bubble-icon {
  height: 30px;
  width: 30px;
  object-fit: contain;
  filter: invert(1) brightness(2);
}

#digsure-chat-widget .dcw-unread-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background-color: #ef4444;
  border: 2px solid #fff;
}

#digsure-chat-widget .dcw-panel {
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 460px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid #e5e7eb;
}

#digsure-chat-widget .dcw-header {
  background: #111111;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#digsure-chat-widget .dcw-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#digsure-chat-widget .dcw-header-avatar {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

#digsure-chat-widget .dcw-header-avatar img {
  height: 22px;
  width: 22px;
  object-fit: contain;
}

#digsure-chat-widget .dcw-header-text {
  min-width: 0;
}

#digsure-chat-widget .dcw-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#digsure-chat-widget .dcw-subtitle {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#digsure-chat-widget .dcw-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#digsure-chat-widget .dcw-end {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  padding: 0;
}

#digsure-chat-widget .dcw-end:hover {
  color: #fff;
}

#digsure-chat-widget .dcw-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

#digsure-chat-widget .dcw-close:hover {
  color: #fff;
}

#digsure-chat-widget .dcw-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Pre-chat form */
#digsure-chat-widget .dcw-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px 20px;
  overflow-y: auto;
}

#digsure-chat-widget .dcw-form-title {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111111;
  line-height: 1.4;
}

#digsure-chat-widget .dcw-form-label {
  font-size: 13px;
  color: #4b5563;
  margin-top: 4px;
}

#digsure-chat-widget .dcw-form-input {
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

#digsure-chat-widget .dcw-form-input:focus {
  border-color: #111111;
}

#digsure-chat-widget .dcw-form-submit {
  margin-top: 10px;
  background: #111111;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#digsure-chat-widget .dcw-form-submit:hover {
  background: #000000;
}

#digsure-chat-widget .dcw-form-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Chat view */
#digsure-chat-widget .dcw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#digsure-chat-widget .dcw-empty {
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  margin-top: 30px;
}

#digsure-chat-widget .dcw-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

#digsure-chat-widget .dcw-row-visitor {
  justify-content: flex-end;
}

#digsure-chat-widget .dcw-row-admin {
  justify-content: flex-start;
}

#digsure-chat-widget .dcw-msg-avatar {
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

#digsure-chat-widget .dcw-msg-avatar img {
  height: 14px;
  width: 14px;
  object-fit: contain;
  filter: invert(1) brightness(2);
}

#digsure-chat-widget .dcw-message {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

#digsure-chat-widget .dcw-message-visitor {
  background: #111111;
  color: #fff;
  border-bottom-right-radius: 4px;
}

#digsure-chat-widget .dcw-message-admin {
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

#digsure-chat-widget .dcw-input-row {
  border-top: 1px solid #e5e7eb;
  padding: 10px;
  display: flex;
  gap: 8px;
  background: #fff;
}

#digsure-chat-widget .dcw-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

#digsure-chat-widget .dcw-input:focus {
  border-color: #111111;
}

#digsure-chat-widget .dcw-send {
  background: #111111;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#digsure-chat-widget .dcw-send:hover {
  background: #000000;
}

@media (max-width: 480px) {
  #digsure-chat-widget .dcw-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 140px);
  }
}
