.goftyar-chat-box {
  position: absolute;
  bottom: 85px;
  width: 350px;
  height: 450px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 30;
}
.goftyar-pos-bottom-right .goftyar-chat-box {
  right: 0;
  transform-origin: bottom right;
}
.goftyar-pos-bottom-left .goftyar-chat-box {
  left: 0;
  transform-origin: bottom left;
}
.goftyar-chat-box.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.goftyar-header {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}
.goftyar-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.goftyar-header-info .dashicons {
  font-family: "dashicons";
  font-size: 20px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.goftyar-title {
  font-weight: 700;
  font-size: 16px;
}
.goftyar-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.goftyar-icon-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 0;
}
.goftyar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}
.goftyar-icon-btn.goftyar-end-chat {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
  width: 30px;
  height: 30px;
}
.goftyar-icon-btn.goftyar-end-chat:hover {
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
  transform: scale(1.15) rotate(90deg);
}
.goftyar-body {
  flex: 1;
  background: #f9fafb;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.goftyar-empty-state {
  text-align: center;
  color: #6b7280;
  margin-top: auto;
  margin-bottom: auto;
  font-size: 14px;
  line-height: 1.6;
}
.goftyar-footer {
  padding: 15px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.goftyar-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.goftyar-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 14px;
  outline: none;
  direction: rtl;
  background: #f9fafb;
  transition: border 0.2s;
}
.goftyar-input:focus {
  border-color: #6366f1;
  background: #fff;
}
.goftyar-char-counter {
  position: absolute;
  left: 8px;
  bottom: 50%;
  transform: translateY(50%);
  font-size: 10px;
  color: #9ca3af;
  pointer-events: none;
  direction: ltr;
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 6px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  display: none;
  z-index: 5;
}
.goftyar-char-counter.error {
  color: #ef4444;
  font-weight: bold;
  border-color: #fecaca;
  background: #fef2f2;
}
.goftyar-send-btn {
  background: #6366f1;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  padding: 0;
  flex-shrink: 0;
}
.goftyar-send-btn:hover:not(:disabled) {
  background: #4f46e5;
  transform: scale(1.05);
}
.goftyar-send-btn svg {
  width: 20px;
  height: 20px;
  stroke: white;
}
.goftyar-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
.goftyar-resolution-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.goftyar-resolution-box {
  text-align: center;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  width: 80%;
}
.goftyar-resolution-box p {
  margin: 0 0 15px 0;
  font-weight: 700;
  color: #374151;
}
.goftyar-res-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.res-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.1s;
}
.res-btn:hover {
  transform: translateY(-1px);
}
.res-btn.success {
  background: #10b981;
  color: white;
}
.res-btn.danger {
  background: #ef4444;
  color: white;
}

.goftyar-msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  opacity: 0.6;
  transition: opacity 0.2s;

  direction: rtl;
  justify-content: flex-start;
}
.goftyar-msg-content:hover .goftyar-msg-actions {
  opacity: 1;
}
.gf-action-btn {
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 3px 6px;
  color: #9ca3af;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}
.gf-action-btn:hover {
  background: #e5e7eb;
  color: #4b5563;
}
.gf-action-btn .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}
.gf-action-btn.like.active {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}
.gf-action-btn.dislike.active {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
@media (max-width: 600px) {
  .goftyar-chat-box {
    width: 300px;
    height: 400px;
  }
}
