/* WP WhatsApp Chat - Professional styling */
#wpwac-chat-widget,
#wpwac-chat-widget * {
  box-sizing: border-box;
}
#wpwac-chat-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999999;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  direction: rtl;
  --wpwac-primary: #0ea5e9;
  --wpwac-primary-dark: #0284c7;
  --wpwac-bg: #f8fafc;
  --wpwac-surface: #ffffff;
  --wpwac-border: #e2e8f0;
  --wpwac-text: #1e293b;
  --wpwac-text-muted: #64748b;
  --wpwac-outgoing: #0ea5e9;
  --wpwac-incoming: #f1f5f9;
}

.wpwac-toggle {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}

.wpwac-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.4);
}

.wpwac-toggle svg {
  width: 28px;
  height: 28px;
}

.wpwac-panel {
  display: none;
  position: absolute;
  bottom: 76px;
  left: 0;
  width: 392px;
  max-width: calc(100vw - 48px);
  height: 560px;
  background: var(--wpwac-surface);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.08);
  flex-direction: column;
  overflow: hidden;
  animation: wpwac-slideUp 0.25s ease-out;
}

@keyframes wpwac-slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

#wpwac-chat-widget.wpwac-open .wpwac-panel {
  display: flex;
}

.wpwac-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wpwac-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wpwac-header-title strong {
  font-size: 17px;
  font-weight: 600;
}

.wpwac-header-title span {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 400;
}

.wpwac-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.wpwac-close:hover {
  background: rgba(255,255,255,0.25);
}

.wpwac-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--wpwac-bg);
  min-height: 200px;
}

.wpwac-msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  margin-bottom: 10px;
  word-wrap: break-word;
  line-height: 1.5;
  animation: wpwac-msgIn 0.2s ease-out;
}

@keyframes wpwac-msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.wpwac-msg.outgoing {
  background: linear-gradient(135deg, var(--wpwac-outgoing) 0%, #06b6d4 100%);
  color: #fff;
  margin-right: auto;
  margin-left: 0;
  border-bottom-right-radius: 4px;
}

.wpwac-msg.incoming {
  background: var(--wpwac-surface);
  color: var(--wpwac-text);
  margin-left: auto;
  margin-right: 0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.wpwac-msg-content {
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.wpwac-msg-time {
  font-size: 11px;
  color: var(--wpwac-text-muted);
  margin-top: 6px;
}

.wpwac-msg.outgoing .wpwac-msg-time {
  color: rgba(255,255,255,0.8);
}

.wpwac-input-area {
  display: flex;
  padding: 16px;
  gap: 10px;
  background: var(--wpwac-surface);
  border-top: 1px solid var(--wpwac-border);
}

.wpwac-input-area input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--wpwac-border);
  border-radius: 24px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.wpwac-input-area input:focus {
  border-color: var(--wpwac-primary);
}

.wpwac-input-area button {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--wpwac-primary) 0%, #06b6d4 100%);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.wpwac-input-area button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.wpwac-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
}

.wpwac-form-title {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--wpwac-text);
}

.wpwac-form-desc {
  font-size: 14px;
  color: var(--wpwac-text-muted);
  margin: -8px 0 8px 0;
  line-height: 1.5;
}

.wpwac-form input,
.wpwac-form textarea {
  padding: 14px 16px;
  border: 2px solid var(--wpwac-border);
  border-radius: 12px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.wpwac-form input:focus,
.wpwac-form textarea:focus {
  outline: none;
  border-color: var(--wpwac-primary);
}

.wpwac-form textarea {
  resize: vertical;
  min-height: 100px;
}

.wpwac-form button {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--wpwac-primary) 0%, #06b6d4 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}

.wpwac-form button:hover {
  transform: translateY(-1px);
}

.wpwac-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.wpwac-welcome {
  text-align: center;
  padding: 24px 16px;
  color: var(--wpwac-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.wpwac-closed-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  width: 100%;
}
.wpwac-closed-banner p {
  margin: 0;
  color: var(--wpwac-text-muted);
  font-size: 14px;
}
.wpwac-closed-banner #wpwac-start-new-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--wpwac-primary) 0%, #06b6d4 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}
.wpwac-closed-banner #wpwac-start-new-btn:hover {
  transform: translateY(-1px);
}
