/**
 * Morocco Tours Engine - Modern Floating WhatsApp Concierge Widget Styles
 * Version: 1.0.0 - Executive Redesign (Zero Emojis, Compact 2-Column Grid)
 */

:root {
  --mte-wa-green: #25D366;
  --mte-wa-green-hover: #20bd5a;
  --mte-wa-green-dark: #128C7E;
  --mte-wa-teal: #075E54;
  --mte-wa-slate-900: #0f172a;
  --mte-wa-slate-800: #1e293b;
  --mte-wa-slate-700: #334155;
  --mte-wa-slate-600: #475569;
  --mte-wa-slate-400: #94a3b8;
  --mte-wa-slate-300: #cbd5e1;
  --mte-wa-slate-200: #e2e8f0;
  --mte-wa-slate-100: #f1f5f9;
  --mte-wa-slate-50: #f8fafc;
  --mte-wa-radius: 16px;
  --mte-wa-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Container */
.mte-wa-widget-wrapper {
  position: fixed;
  z-index: 999999;
  font-family: var(--mte-wa-font);
  direction: ltr;
  text-align: left;
  line-height: 1.4;
  box-sizing: border-box;
}

.mte-wa-widget-wrapper *,
.mte-wa-widget-wrapper *::before,
.mte-wa-widget-wrapper *::after {
  box-sizing: border-box;
}

/* RTL Support */
.mte-wa-widget-wrapper.mte-wa-rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Positions */
.mte-wa-pos-bottom-right {
  bottom: 24px;
  right: 24px;
}

.mte-wa-pos-bottom-left {
  bottom: 24px;
  left: 24px;
}

/* ==========================================================================
   Teaser Bubble
   ========================================================================== */
.mte-wa-bubble {
  position: absolute;
  bottom: 74px;
  width: 290px;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.16), 0 3px 8px -2px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--mte-wa-slate-200);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  animation: mteWaBubbleBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  z-index: 10;
}

.mte-wa-pos-bottom-right .mte-wa-bubble {
  right: 0;
  transform-origin: bottom right;
}

.mte-wa-pos-bottom-left .mte-wa-bubble {
  left: 0;
  transform-origin: bottom left;
}

.mte-wa-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -4px rgba(15, 23, 42, 0.2);
}

.mte-wa-bubble-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.mte-wa-bubble-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mte-wa-slate-900);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.mte-wa-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.mte-wa-pos-bottom-left .mte-wa-online-dot {
  right: auto;
  left: -1px;
}

.mte-wa-bubble-content {
  flex: 1;
  min-width: 0;
}

.mte-wa-bubble-sender {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--mte-wa-green-dark);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mte-wa-status-badge {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.mte-wa-bubble-text {
  font-size: 12px;
  color: var(--mte-wa-slate-800);
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.mte-wa-bubble-close {
  background: none;
  border: none;
  color: var(--mte-wa-slate-400);
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.mte-wa-bubble-close:hover {
  color: #ef4444;
  background: #fee2e2;
}

.mte-wa-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  width: 0;
  height: 0;
  border-style: solid;
}

.mte-wa-pos-bottom-right .mte-wa-bubble::after {
  right: 20px;
  border-width: 7px 7px 0 7px;
  border-color: #ffffff transparent transparent transparent;
}

.mte-wa-pos-bottom-left .mte-wa-bubble::after {
  left: 20px;
  border-width: 7px 7px 0 7px;
  border-color: #ffffff transparent transparent transparent;
}

/* ==========================================================================
   Floating Action Button
   ========================================================================== */
.mte-wa-trigger-btn {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border: none;
  outline: none;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.42), 0 3px 8px rgba(18, 140, 126, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  padding: 0;
}

.mte-wa-trigger-btn:hover {
  transform: scale(1.07);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.52);
}

.mte-wa-trigger-btn:active {
  transform: scale(0.96);
}

.mte-wa-trigger-btn svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

.mte-wa-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.mte-wa-pos-bottom-left .mte-wa-notif-badge {
  right: auto;
  left: -2px;
}

.mte-wa-pulse-wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #25D366;
  opacity: 0.65;
  z-index: -1;
  animation: mteWaPulse 2.2s infinite cubic-bezier(0.24, 0, 0.38, 1);
}

.mte-wa-icon-close {
  display: none;
  color: #fff;
}

.mte-wa-widget-wrapper.mte-wa-modal-open .mte-wa-trigger-btn {
  background: #0f172a;
  transform: rotate(90deg);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
}

.mte-wa-widget-wrapper.mte-wa-modal-open .mte-wa-icon-whatsapp,
.mte-wa-widget-wrapper.mte-wa-modal-open .mte-wa-notif-badge {
  display: none;
}

.mte-wa-widget-wrapper.mte-wa-modal-open .mte-wa-icon-close {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mte-wa-widget-wrapper.mte-wa-modal-open .mte-wa-pulse-wave {
  display: none;
}

.mte-wa-widget-wrapper.mte-wa-modal-open .mte-wa-bubble {
  display: none !important;
}

/* ==========================================================================
   Interactive WhatsApp Modal Card (Compact & Clean)
   ========================================================================== */
.mte-wa-modal {
  position: absolute;
  bottom: 76px;
  width: 390px;
  max-width: calc(100vw - 28px);
  background: #ffffff;
  border-radius: var(--mte-wa-radius);
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--mte-wa-slate-200);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
}

.mte-wa-pos-bottom-right .mte-wa-modal {
  right: 0;
  transform-origin: bottom right;
}

.mte-wa-pos-bottom-left .mte-wa-modal {
  left: 0;
  transform-origin: bottom left;
}

.mte-wa-widget-wrapper.mte-wa-modal-open .mte-wa-modal {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Modal Header */
.mte-wa-modal-header {
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  color: #ffffff;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mte-wa-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mte-wa-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mte-wa-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.mte-wa-header-title-wrap h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.mte-wa-header-title-wrap p {
  margin: 2px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 5px;
}

.mte-wa-live-badge {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #25D366;
  border-radius: 50%;
  box-shadow: 0 0 6px #25D366;
}

.mte-wa-modal-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.mte-wa-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Segmented Tab Switcher (No Emojis)
   ========================================================================== */
.mte-wa-tabs-wrapper {
  background: #ffffff;
  padding: 8px 14px 0 14px;
}

.mte-wa-tabs-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--mte-wa-slate-100);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--mte-wa-slate-200);
}

.mte-wa-tab-btn {
  background: transparent;
  border: none;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mte-wa-slate-600);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  font-family: inherit;
}

.mte-wa-tab-btn:hover {
  color: var(--mte-wa-slate-900);
}

.mte-wa-tab-btn.mte-wa-tab-active {
  background: #ffffff;
  color: var(--mte-wa-slate-900);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Form Fields & 2-Column Grid
   ========================================================================== */
.mte-wa-tab-body {
  padding: 12px 14px 14px 14px;
}

.mte-wa-tab-pane {
  display: none;
  animation: mteWaFadeIn 0.2s ease-in-out;
}

.mte-wa-tab-pane.mte-wa-pane-active {
  display: block;
}

.mte-wa-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.mte-wa-field {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.mte-wa-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mte-wa-slate-700);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.mte-wa-label .mte-wa-req {
  color: #ef4444;
}

.mte-wa-input,
.mte-wa-textarea,
.mte-wa-select {
  width: 100%;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--mte-wa-slate-800);
  background: var(--mte-wa-slate-50);
  border: 1px solid var(--mte-wa-slate-300);
  border-radius: 6px;
  padding: 7px 9px;
  height: 35px;
  transition: all 0.15s ease;
  outline: none;
}

.mte-wa-select {
  appearance: auto;
  cursor: pointer;
}

.mte-wa-input:focus,
.mte-wa-textarea:focus,
.mte-wa-select:focus {
  border-color: var(--mte-wa-green);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

.mte-wa-textarea {
  height: auto;
  min-height: 65px;
  resize: vertical;
  line-height: 1.4;
  padding: 8px 10px;
}

/* Stepper for Travelers */
.mte-wa-stepper-wrap {
  display: flex;
  align-items: center;
  background: var(--mte-wa-slate-50);
  border: 1px solid var(--mte-wa-slate-300);
  border-radius: 6px;
  height: 35px;
  overflow: hidden;
}

.mte-wa-step-btn {
  background: #ffffff;
  border: none;
  color: var(--mte-wa-slate-800);
  font-size: 15px;
  font-weight: 700;
  width: 32px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  user-select: none;
}

.mte-wa-step-btn:hover {
  background: var(--mte-wa-slate-200);
}

.mte-wa-step-input {
  flex: 1;
  text-align: center;
  font-weight: 700;
  border: none;
  background: transparent;
  padding: 0;
  outline: none;
  font-size: 12.5px;
  color: var(--mte-wa-slate-800);
}

/* Submit Action Button */
.mte-wa-submit-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: all 0.2s ease;
}

.mte-wa-submit-btn:hover {
  background: linear-gradient(135deg, #20bd5a 0%, #0e786b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.mte-wa-submit-btn:active {
  transform: translateY(0);
}

.mte-wa-submit-btn svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

/* Footer Notice */
.mte-wa-footer-notice {
  margin-top: 8px;
  text-align: center;
  font-size: 10.5px;
  color: var(--mte-wa-slate-400);
}

/* Validation Errors */
.mte-wa-error-tip {
  color: #ef4444;
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
  display: none;
}

.mte-wa-field.mte-wa-has-error .mte-wa-input,
.mte-wa-field.mte-wa-has-error .mte-wa-textarea,
.mte-wa-field.mte-wa-has-error .mte-wa-select {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
}

.mte-wa-field.mte-wa-has-error .mte-wa-error-tip {
  display: block;
}

/* Animations */
@keyframes mteWaPulse {
  0% { transform: scale(0.95); opacity: 0.75; }
  50% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

@keyframes mteWaBubbleBounce {
  0% { opacity: 0; transform: scale(0.8) translateY(16px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes mteWaFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 440px) {
  .mte-wa-pos-bottom-right,
  .mte-wa-pos-bottom-left {
    bottom: 16px;
    right: 16px;
    left: auto;
  }
  .mte-wa-pos-bottom-left {
    left: 16px;
    right: auto;
  }
  .mte-wa-modal {
    position: fixed;
    bottom: 0;
    left: 0 !important;
    right: 0 !important;
    width: 100vw;
    max-width: 100vw;
    border-radius: 16px 16px 0 0;
  }
}
