#gapgpt-chat-widget.gapgpt-chat-floating{position:fixed;bottom:20px;right:20px;z-index:99999;font-family:Tahoma,Arial,sans-serif;direction:rtl}
.gapgpt-chat-toggle{width:56px;height:56px;border-radius:50%;border:none;background:#2b6cb0;color:#fff;font-size:24px;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.2)}
.gapgpt-chat-panel{display:none;width:340px;max-width:90vw;height:460px;max-height:70vh;background:#fff;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.25);flex-direction:column;overflow:hidden;position:absolute;bottom:70px;right:0}
#gapgpt-chat-widget.gapgpt-open .gapgpt-chat-panel{display:flex}
#gapgpt-chat-widget.gapgpt-open .gapgpt-chat-toggle{display:none}
.gapgpt-chat-header{background:#2b6cb0;color:#fff;padding:12px 14px;display:flex;justify-content:space-between;align-items:center;font-weight:bold}
.gapgpt-chat-close{background:none;border:none;color:#fff;font-size:22px;cursor:pointer;line-height:1}
.gapgpt-chat-messages{flex:1;overflow-y:auto;padding:12px;background:#f7fafc}
.gapgpt-msg{margin-bottom:10px;padding:8px 12px;border-radius:10px;max-width:85%;line-height:1.6;white-space:pre-wrap;word-wrap:break-word}
.gapgpt-msg.user{background:#2b6cb0;color:#fff;margin-left:auto}
.gapgpt-msg.assistant{background:#edf2f7;color:#1a202c;margin-right:auto}
.gapgpt-msg.error{background:#fed7d7;color:#822727;margin-right:auto}
.gapgpt-chat-form{display:flex;border-top:1px solid #e2e8f0;padding:8px}
#gapgpt-chat-input{flex:1;border:1px solid #cbd5e0;border-radius:8px;padding:8px;outline:none;font-family:inherit}
#gapgpt-chat-send{margin-right:6px;background:#2b6cb0;color:#fff;border:none;border-radius:8px;padding:0 16px;cursor:pointer}
#gapgpt-chat-send:disabled{opacity:.6;cursor:not-allowed}
/* ===== Container ===== */
.gapgpt-chat {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  direction: rtl;
  text-align: right;
}

/* ===== Floating Mode ===== */
.gapgpt-chat--floating {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  width: 22rem;
  max-width: calc(100vw - 3rem);
}

/* Toggle Button (Floating only) */
.gapgpt-toggle {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: #2b6cb0;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gapgpt-toggle:hover {
  transform: scale(1.05);
  background: #2c5aa0;
}

/* Panel (Hidden by default in floating) */
.gapgpt-chat--floating .gapgpt-box {
  display: none;
  margin-bottom: 0.75rem;
}

.gapgpt-chat--floating.gapgpt-open .gapgpt-box {
  display: flex;
}

/* Hide toggle when open (optional, remove if you want it visible) */
.gapgpt-chat--floating.gapgpt-open .gapgpt-toggle {
  display: none;
}

/* ===== Chat Box ===== */
.gapgpt-box {
  display: flex;
  flex-direction: column;
  height: 28rem;
  max-height: 70vh;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* ===== Messages Area ===== */
.gapgpt-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gapgpt-message {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.5;
}

.gapgpt-message--user {
  background: #2b6cb0;
  color: #fff;
  align-self: flex-end;
  border-bottom-left-radius: 0.25rem;
}

.gapgpt-message--assistant {
  background: #e2e8f0;
  color: #1a202c;
  align-self: flex-start;
  border-bottom-right-radius: 0.25rem;
}

.gapgpt-message--error {
  background: #fed7d7;
  color: #c53030;
  align-self: center;
  max-width: 90%;
  border-radius: 0.5rem;
}

/* ===== Form ===== */
.gapgpt-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  background: #f7fafc;
}

.gapgpt-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.gapgpt-input:focus {
  border-color: #2b6cb0;
}

.gapgpt-submit {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: #2b6cb0;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gapgpt-submit:hover:not(:disabled) {
  background: #2c5aa0;
}

.gapgpt-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Inline Mode ===== */
.gapgpt-chat--inline .gapgpt-box {
  display: flex;
}
