.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-close-chat {
  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: background 0.2s;
  padding: 0;
}

.goftyar-close-chat:hover {
  background: rgba(255, 255, 255, 0.3);
}

.goftyar-close-chat .dashicons {
  font-family: "dashicons";
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 18px;
}

.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;
}

/* Wrapper to hold input and counter */
.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 10px 50px;
  font-size: 14px;
  outline: none;
  direction: rtl;
  background: #f9fafb;
  transition: border 0.2s;
}

.goftyar-input:focus {
  border-color: #6366f1;
  background: #fff;
}

/* Character Counter Styles */
.goftyar-char-counter {
  position: absolute;
  left: 10px;
  font-size: 10px;
  color: #9ca3af;
  pointer-events: none;
  direction: ltr;
}

.goftyar-char-counter.error {
  color: #ef4444;
  font-weight: bold;
}

.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, opacity 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;
  margin-top: 2px;
  margin-right: 2px;
}

.goftyar-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 600px) {
  .goftyar-chat-box {
    width: 300px;
    height: 400px;
  }
}
