/**
 * Admin Help Chat Styles
 * Simple AI chat widget for admin users
 */
#epkb-admin-help-chat-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.epkb-help-chat-button {
  background: #2271B1;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.epkb-help-chat-button:hover {
  background: #135E96;
}
.epkb-help-chat-button.epkb-help-chat-button--pulse {
  animation: epkb-pulse 2s infinite;
}

.epkb-help-chat-intro {
  position: absolute;
  bottom: 65px;
  right: 0;
  background: white;
  border: 1px solid #DDDDDD;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 280px;
  animation: epkb-slide-up 0.3s ease-out;
}
.epkb-help-chat-intro::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 30px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}
.epkb-help-chat-intro::before {
  content: "";
  position: absolute;
  bottom: -9px;
  right: 30px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #DDDDDD;
}
.epkb-help-chat-intro .epkb-help-chat-intro__text {
  color: #333333;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
}
.epkb-help-chat-intro .epkb-help-chat-intro__text strong {
  color: #2271B1;
}
.epkb-help-chat-intro .epkb-help-chat-intro__dismiss {
  background: none;
  border: none;
  color: #999999;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.epkb-help-chat-intro .epkb-help-chat-intro__dismiss:hover {
  color: #666666;
}

.epkb-help-chat-window {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 450px;
  height: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (max-height: 768px) {
  .epkb-help-chat-window {
    height: 500px;
  }
}
@media (max-width: 600px) {
  .epkb-help-chat-window {
    width: 350px;
  }
}

.epkb-help-chat-header {
  background: #2271B1;
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.epkb-help-chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.epkb-help-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.epkb-help-chat-beta-badge {
  background: #FF3333;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.epkb-help-chat-clear,
.epkb-help-chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.epkb-help-chat-clear:hover,
.epkb-help-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.epkb-help-chat-clear:disabled,
.epkb-help-chat-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.epkb-help-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #F5F5F5;
}

.epkb-help-chat-message {
  margin-bottom: 12px;
}
.epkb-help-chat-message--user {
  text-align: right;
}
.epkb-help-chat-message--user .epkb-message-bubble {
  background: #2271B1;
  color: white;
  margin-left: auto;
}
.epkb-help-chat-message--assistant .epkb-message-bubble {
  background: white;
  color: #333333;
}

.epkb-message-bubble {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
}
.epkb-message-bubble p {
  margin: 0 0 0.5em 0;
  line-height: 1.4;
}
.epkb-message-bubble p:last-child {
  margin-bottom: 0;
}
.epkb-message-bubble p:last-of-type strong {
  font-weight: 600;
}
.epkb-message-bubble strong {
  font-weight: 600;
  color: inherit;
}

.epkb-help-chat-input {
  display: flex;
  padding: 15px;
  background: white;
  border-top: 1px solid #DDDDDD;
}
.epkb-help-chat-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #DDDDDD;
  border-radius: 20px;
  outline: none;
}
.epkb-help-chat-input button {
  margin-left: 8px;
  background: #2271B1;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
}
.epkb-help-chat-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.epkb-help-typing {
  padding: 10px 14px;
  background: white;
  border-radius: 12px;
  display: inline-block;
}
.epkb-help-typing span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999999;
  margin: 0 2px;
  animation: epkb-typing 1.4s infinite;
}
.epkb-help-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.epkb-help-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes epkb-typing {
  0%, 60%, 100% {
    opacity: 0.3;
  }
  30% {
    opacity: 1;
  }
}
@keyframes epkb-pulse {
  0% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 2px 15px rgba(34, 113, 177, 0.6);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}
@keyframes epkb-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.epkb-help-chat-human-wrapper {
  padding: 10px 15px;
  background: #F9F9F9;
  border-top: 1px solid #DDDDDD;
  text-align: center;
}

.epkb-help-chat-human-button {
  background: white;
  color: #2271B1;
  border: 1px solid #2271B1;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}
.epkb-help-chat-human-button:hover {
  background: #2271B1;
  color: white;
}

.epkb-help-chat-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: epkb-fade-in 0.2s ease;
}

.epkb-help-chat-dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  width: 500px;
  max-width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: epkb-scale-in 0.3s ease;
}

.epkb-help-chat-dialog-header {
  padding: 20px;
  border-bottom: 1px solid #DDDDDD;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.epkb-help-chat-dialog-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333333;
}

.epkb-help-chat-dialog-close {
  background: none;
  border: none;
  color: #999999;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.epkb-help-chat-dialog-close:hover {
  color: #666666;
}

.epkb-help-chat-dialog-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.epkb-help-chat-dialog-intro {
  background: #F0F8FF;
  border-left: 3px solid #2271B1;
  padding: 12px 15px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: #333333;
}

.epkb-help-chat-field {
  margin-bottom: 20px;
}
.epkb-help-chat-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333333;
  font-size: 14px;
}
.epkb-help-chat-field input,
.epkb-help-chat-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #DDDDDD;
  border-radius: 6px;
  font-size: 14px;
}
.epkb-help-chat-field input:focus,
.epkb-help-chat-field textarea:focus {
  outline: none;
  border-color: #2271B1;
  box-shadow: 0 0 0 1px rgba(34, 113, 177, 0.2);
}
.epkb-help-chat-field input[readonly],
.epkb-help-chat-field textarea[readonly] {
  background: #F5F5F5;
  color: #666666;
  cursor: not-allowed;
}
.epkb-help-chat-field textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.epkb-required {
  color: #D63638;
}

.epkb-help-chat-field-note {
  font-size: 12px;
  color: #666666;
  font-style: italic;
  margin-top: -10px;
  margin-bottom: 15px;
}

.epkb-help-chat-dialog-footer {
  padding: 20px;
  border-top: 1px solid #DDDDDD;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.epkb-help-chat-dialog-cancel,
.epkb-help-chat-dialog-submit {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.epkb-help-chat-dialog-cancel {
  background: white;
  color: #666666;
  border: 1px solid #DDDDDD;
}
.epkb-help-chat-dialog-cancel:hover {
  background: #F5F5F5;
}

.epkb-help-chat-dialog-submit {
  background: #2271B1;
  color: white;
}
.epkb-help-chat-dialog-submit:hover {
  background: #135E96;
}
.epkb-help-chat-dialog-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes epkb-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes epkb-scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
