/* DeepseekChat Styles */
#deepseekchat-container {
    margin-top: 20px;
    padding: 40px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    max-width: 100%;
    width: 100%;
    font-family: "Segoe UI", sans-serif;
}

#deepseekchat-box div {
    margin: 8px 0;
    padding: 12px;
    border-radius: 6px;
    line-height: 1.5;
}

.assistant-message {
    background-color: #f9f9f9;
    border-left: 4px solid #3399cc;
    color: #333;
}

.user-message {
    background-color: #eef6fb;
    border-left: 4px solid #66b3e0;
    color: #222;
}

.deepseekchat-button {
    background-color: #3399cc;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 15px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.deepseekchat-button:hover {
    background-color: #2a80aa;
}

.deepseekchat-input[type="text"] {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
}
/* Container for popup - initially hidden */
#deepseekchat-popup {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 320px;
  max-height: 400px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: max-height 0.3s ease, padding 0.3s ease;
  max-height: 0;       /* collapsed */
  padding: 0 15px;     /* no padding when collapsed */
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
}

#deepseekchat-popup.open {
  max-height: 400px;   /* open height */
  padding: 15px;
  opacity: 1;
  pointer-events: auto;
}

/* Chat messages container */
#deepseekchat-box {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 5px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

/* Messages styling */
.user-message, .assistant-message {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 15px;
  max-width: 80%;
  word-wrap: break-word;
}

.user-message {
  background-color: #d1e7ff;
  color: #084298;
  align-self: flex-end;
  border-bottom-right-radius: 0;
}

.assistant-message {
  background-color: #f1f1f1;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 0;
}

/* Error message style */
.assistant-message.error {
  background-color: #ffd6d6;
  color: #a70000;
}

/* Loading message style */
.assistant-message.loading {
  font-style: italic;
  color: #777;
  text-align: center;
}

/* Loading animation dots */
.assistant-message.loading::after {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 5px;
  border-radius: 50%;
  background: #777;
  animation: blink 1.2s infinite ease-in-out;
}

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Input and button container */
#deepseekchat-container {
  display: flex;
  gap: 10px;
}

/* Input styling */
.deepseekchat-input {
  flex-grow: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 20px;
  outline: none;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

/* Input focus style */
.deepseekchat-input:focus {
  border-color: #3399cc;
}

/* Disabled input */
.deepseekchat-input:disabled {
  background-color: #eee;
  cursor: not-allowed;
}

/* Send button styling */
.deepseekchat-button {
  background-color: #3399cc;
  border: none;
  color: white;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
  white-space: nowrap;
}

/* Send button hover */
.deepseekchat-button:hover:not(:disabled) {
  background-color: #2672a4;
}

/* Disabled button */
.deepseekchat-button:disabled {
  background-color: #9ecce6;
  cursor: not-allowed;
}

/* Floating launcher button (chat icon) */
#deepseekchat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #3399cc;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: background-color 0.3s ease;
  border: none!important;
}

#deepseekchat-launcher:hover {
  background-color: #2672a4;
}

/* Example chat icon (you can replace with an SVG or font icon) */
#deepseekchat-launcher::before {
  content: "💬";
  font-size: 28px;
  color: white;
  user-select: none;
}
.assistant-message pre {
    background: #f4f4f4;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: monospace;
    white-space: pre-wrap;
}

.assistant-message code {
    background: #eee;
    padding: 2px 4px;
    border-radius: 4px;
}

:where(.wp-site-blocks *:focus) {
    outline-width: 2px;
    outline-style: none!important;
}