/* =====================================================================
   Uzita Travel — "Le Fennec du Sahara" Animated 3D & Voice/Text AI Agent
   ===================================================================== */
.fennec-sec {
  position: relative;
  padding-block: clamp(56px, 7vw, 96px);
  background: radial-gradient(110% 95% at 15% 15%, #173c52 0%, #0f2233 58%, #091622 100%);
  color: #e6eef4;
  overflow: hidden;
}
.fennec-sec::before {
  content: "";
  position: absolute;
  inset: -30% -10%;
  background:
    radial-gradient(circle at 22% 38%, rgba(214, 168, 102, .16) 0%, transparent 42%),
    radial-gradient(circle at 82% 70%, rgba(13, 134, 134, .2) 0%, transparent 46%);
  pointer-events: none;
}
.fennec-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(290px, .88fr) minmax(0, 1.22fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
}

/* 3D & Nano Banana Animated Mascot Stage */
.fennec-stage-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .07) 0%, rgba(15, 34, 51, .65) 100%);
  border: 1px solid rgba(214, 168, 102, .28);
  box-shadow: 0 32px 70px -28px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
}
.fennec-stage {
  position: relative;
  width: min(370px, 84vw);
  height: min(400px, 88vw);
  display: grid;
  place-items: center;
  border-radius: 26px;
  overflow: hidden;
  border: 2px solid rgba(214, 168, 102, .55);
  background: radial-gradient(circle at 50% 34%, #214e67 0%, #10283d 62%, #0a1a29 100%);
  box-shadow: 0 22px 54px -18px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .14);
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}
.fennec-stage:active { cursor: grabbing; }
.fennec-aura {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 168, 102, .32) 0%, rgba(13, 134, 134, .22) 50%, transparent 74%);
  filter: blur(22px);
  animation: fennecBreathe 4.2s ease-in-out infinite;
  transition: transform .3s, opacity .3s, background .3s;
  pointer-events: none;
}

/* Animated 3D loading overlay (replaces 2D photo until WebGL 3D Fennec is rendered!) */
.fennec-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  transition: opacity .45s ease, visibility .45s ease;
}
.fennec-loader__orb {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  color: var(--gold-2);
}
.fennec-loader__orb svg {
  width: 34px;
  height: 34px;
  animation: fennecBreathe 2.1s ease-in-out infinite;
}
.fennec-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid rgba(214, 168, 102, .22);
  border-top-color: var(--gold-2);
  animation: fennecSpin 1.35s linear infinite;
}
.fennec-loader__ring--2 {
  inset: 11px;
  border-color: rgba(44, 224, 200, .2);
  border-bottom-color: #2ce0c8;
  animation: fennecSpinRev 2.1s linear infinite;
}
.fennec-loader__txt {
  margin: 0;
  font-size: .88rem;
  font-weight: 600;
  color: #e6f0f6;
  letter-spacing: .01em;
  max-width: 24ch;
  animation: fennecPulseTxt 1.8s ease-in-out infinite;
}
.fennec-loader__bar {
  width: 170px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.fennec-loader__bar span {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2ce0c8, var(--gold-2));
  transition: width .22s ease;
}
.fennec-webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 4;
  transition: opacity .45s ease;
}
.fennec-webgl canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.fennec-webgl[data-3d-ready="1"] { opacity: 1; }
.fennec-stage.has-3d .fennec-loader { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes fennecPulseTxt { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.fennec-3d-tag {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 12px;
  z-index: 6;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 24, 38, .72);
  border: 1px solid rgba(214, 168, 102, .5);
  color: #f6ddb0;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
.fennec-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* State Animations: Listening / Thinking / Speaking */
[data-fennec-state="listening"] .fennec-stage {
  border-color: #2ce0c8;
  box-shadow: 0 0 0 5px rgba(44, 224, 200, .2), 0 0 42px rgba(44, 224, 200, .42);
}
[data-fennec-state="listening"] .fennec-aura {
  background: radial-gradient(circle, rgba(44, 224, 200, .55) 0%, rgba(11, 110, 110, .35) 55%, transparent 74%);
  animation: fennecPulseFast 1.05s ease-in-out infinite;
}
[data-fennec-state="speaking"] .fennec-stage {
  border-color: #f3c276;
  box-shadow: 0 0 0 5px rgba(243, 194, 118, .22), 0 0 46px rgba(214, 168, 102, .55);
}

/* Equalizer voice bars */
.fennec-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
}
.fennec-eq i {
  display: block;
  width: 4px;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(to top, var(--teal-2), var(--gold-2));
  transition: height .09s ease;
}
[data-fennec-state="listening"] .fennec-eq i,
[data-fennec-state="speaking"] .fennec-eq i {
  animation: fennecBar .65s ease-in-out infinite alternate;
}
.fennec-eq i:nth-child(2) { animation-delay: .1s; }
.fennec-eq i:nth-child(3) { animation-delay: .22s; }
.fennec-eq i:nth-child(4) { animation-delay: .06s; }
.fennec-eq i:nth-child(5) { animation-delay: .18s; }
.fennec-eq i:nth-child(6) { animation-delay: .28s; }
.fennec-eq i:nth-child(7) { animation-delay: .12s; }

.fennec-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(11, 110, 110, .28);
  border: 1px solid rgba(44, 224, 200, .35);
  color: #d9f6f3;
  font-size: .8rem;
  font-weight: 600;
}
.fennec-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ce0c8;
  box-shadow: 0 0 10px #2ce0c8;
}
[data-fennec-state="listening"] .fennec-badge__dot { background: #ff6b6b; box-shadow: 0 0 12px #ff6b6b; }
[data-fennec-state="speaking"] .fennec-badge__dot { background: var(--gold-2); box-shadow: 0 0 12px var(--gold-2); }

.fennec-meta { text-align: center; }
.fennec-meta h3 { color: #fff; margin: 0 0 4px; font-size: 1.35rem; }
.fennec-meta p { margin: 0; font-size: .86rem; color: #b6c8d6; }
.fennec-intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(214, 168, 102, .55);
  background: rgba(214, 168, 102, .14);
  color: #fce5be;
  font: 600 .85rem/1.2 var(--f-body);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.fennec-intro-btn:hover { background: rgba(214, 168, 102, .28); transform: translateY(-1px); }
.fennec-intro-btn svg { width: 16px; height: 16px; }

/* Right Column: Interactive Conversation Box */
.fennec-chat-col h2 { color: #fff; margin-bottom: 10px; }
.fennec-chat-col .lead { color: #bfd0dc; margin-bottom: 20px; max-width: 680px; }

.fennec-box {
  background: #ffffff;
  color: var(--ink);
  border-radius: 24px;
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, .6);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .15);
}
.fennec-box__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  background: var(--sand);
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
}
.fennec-learn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f4f4;
  color: var(--teal);
  font-weight: 700;
}
.fennec-msgs {
  padding: 18px;
  max-height: 310px;
  min-height: 175px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  align-content: start;
  scroll-behavior: smooth;
}
.fmsg {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.fmsg--user {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}
.fmsg__av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: var(--navy);
}
.fmsg__bubble {
  padding: 12px 15px;
  border-radius: 16px;
  border-top-left-radius: 4px;
  background: #f4f6f9;
  color: var(--ink);
  font-size: .94rem;
  line-height: 1.55;
}
[dir="rtl"] .fmsg__bubble { border-top-left-radius: 16px; border-top-right-radius: 4px; }
.fmsg--user .fmsg__bubble {
  background: var(--navy);
  color: #fff;
  border-radius: 16px;
  border-top-right-radius: 4px;
  max-width: 85%;
}
[dir="rtl"] .fmsg--user .fmsg__bubble { border-top-right-radius: 16px; border-top-left-radius: 4px; }
.fmsg__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .73rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.fmsg--user .fmsg__tag { color: var(--gold-2); }
.fmsg__links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}
.fmsg__links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--teal);
  color: var(--teal);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
}
.fmsg__links a:hover { background: var(--teal); color: #fff; }
.fmsg__fb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: .75rem;
  color: var(--muted);
}
.fmsg__fb button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 2px 9px;
  cursor: pointer;
  font-size: .76rem;
  transition: background .15s, border-color .15s;
}
.fmsg__fb button:hover { border-color: var(--gold); background: var(--sand); }

/* Quick chips */
.fennec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 18px 12px;
}
.fennec-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sand);
  color: var(--navy);
  font: 500 .81rem/1.3 var(--f-body);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.fennec-chip:hover { border-color: var(--gold); background: #efe4d2; }

/* Input Bar */
.fennec-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fcfbfa;
}
.fennec-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font: 400 .94rem var(--f-body);
  color: var(--ink);
}
.fennec-input:focus { outline: none; border-color: var(--teal); }
.fennec-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--teal);
  background: #eef8f8;
  color: var(--teal);
  font: 700 .86rem var(--f-body);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s, box-shadow .2s;
  white-space: nowrap;
}
.fennec-mic svg, .fennec-send svg { width: 18px; height: 18px; flex: none; }
.fennec-mic:hover { background: var(--teal); color: #fff; }
.fennec-mic.is-rec {
  background: #d93838;
  border-color: #d93838;
  color: #fff;
  box-shadow: 0 0 0 5px rgba(217, 56, 56, .22);
  animation: fennecRecPulse 1.1s infinite;
}
.fennec-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  background: var(--gold);
  color: #fff;
  font: 700 .88rem var(--f-body);
  cursor: pointer;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}
.fennec-send:hover { background: #a3743c; }
.fennec-send:disabled, .fennec-mic:disabled { opacity: .55; cursor: not-allowed; }

/* Global Floating Fennec Launcher & Drawer (for inner pages & scrolled home) */
.fennec-fab {
  position: fixed;
  inset-inline-end: 18px;
  bottom: 84px;
  z-index: 68;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 2px solid var(--gold-2);
  background: var(--navy);
  color: #fff;
  box-shadow: 0 14px 32px -8px rgba(15, 34, 51, .65);
  cursor: pointer;
  font: 700 .83rem/1.1 var(--f-body);
  transition: transform .22s var(--ease), box-shadow .22s;
}
.fennec-fab:hover { transform: translateY(-3px) scale(1.02); }
.fennec-fab.is-hidden { opacity: 0; pointer-events: none; transform: translateY(14px); }
.fennec-fab img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold-2);
}
.fennec-drawer {
  position: fixed;
  inset-inline-end: 18px;
  bottom: 146px;
  z-index: 75;
  width: min(410px, calc(100vw - 28px));
  display: none;
}
.fennec-drawer.is-open { display: block; animation: fennecPop .22s var(--ease); }
.fennec-drawer .fennec-box { border: 1.5px solid var(--gold); }
.fennec-drawer__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: linear-gradient(125deg, var(--navy), #163b50);
  color: #fff;
}
.fennec-drawer__head img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold-2);
  object-fit: cover;
}
.fennec-drawer__head div { flex: 1; min-width: 0; }
.fennec-drawer__head strong { display: block; font-size: .95rem; color: #fff; }
.fennec-drawer__head small { display: block; font-size: .74rem; color: #bed0dc; }
.fennec-drawer__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

@keyframes fennecFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes fennecBreathe { 0%, 100% { transform: scale(.96); opacity: .75; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes fennecSpin { to { transform: rotate(360deg); } }
@keyframes fennecSpinRev { to { transform: rotate(-360deg); } }
@keyframes fennecPulseFast { 0%, 100% { transform: scale(.98); } 50% { transform: scale(1.12); } }
@keyframes fennecTalkBounce { 0% { transform: translateY(0) scale(1); } 100% { transform: translateY(-4px) scale(1.025); } }
@keyframes fennecBar { 0% { height: 5px; } 100% { height: 22px; } }
@keyframes fennecRecPulse { 50% { box-shadow: 0 0 0 10px rgba(217, 56, 56, 0); } }
@keyframes fennecPop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
  .fennec-wrap { grid-template-columns: minmax(0, 1fr); }
  .fennec-stage { width: min(320px, 82vw); height: min(350px, 88vw); }
}
@media (max-width: 560px) {
  .fennec-form { flex-wrap: wrap; }
  .fennec-input { flex: 1 1 100%; }
  .fennec-mic, .fennec-send { flex: 1; }
  .fennec-fab span { display: none; }
  .fennec-fab { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .fennec-avatar-3d, .fennec-aura, .fennec-ring { animation: none !important; }
}
