/* Washnah AI Assistant — current website content edition */
:root {
  --wa-brand: #801922;
  --wa-brand-dark: #30090f;
  --wa-water: #4994b9;
  --wa-eco: #004741;
  --wa-surface: rgba(33, 8, 14, 0.975);
  --wa-line: rgba(255, 255, 255, 0.13);
  --wa-text: #ffffff;
  --wa-muted: rgba(255, 255, 255, 0.68);
  --wa-sand: #f0ede4;
  --wa-shadow: 0 30px 90px rgba(20, 4, 8, 0.42);
}

.washnah-ai {
  position: fixed;
  inset-inline-start: max(15px, env(safe-area-inset-left));
  inset-inline-end: auto;
  bottom: max(15px, env(safe-area-inset-bottom));
  z-index: 9998;
  font-family: var(--default-font, "Poppins", "Tajawal", system-ui, sans-serif);
}

.washnah-ai__launcher {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.24), transparent 30%),
    linear-gradient(145deg, var(--wa-brand), var(--wa-brand-dark));
  box-shadow: 0 18px 46px rgba(128,25,34,.4), inset 0 0 0 5px rgba(255,255,255,.045);
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}

.washnah-ai__launcher:hover,
.washnah-ai__launcher:focus-visible {
  transform: translateY(-3px) scale(1.035);
  box-shadow: 0 25px 58px rgba(128,25,34,.48), inset 0 0 0 5px rgba(255,255,255,.07);
  outline: none;
}
.washnah-ai__launcher i { font-size: 25px; }
.washnah-ai__pulse { position: absolute; inset: -7px; border: 1px solid rgba(128,25,34,.48); border-radius: 50%; pointer-events: none; animation: washAIpulse 2.8s ease-out infinite; }
@keyframes washAIpulse { 0% { transform: scale(.78); opacity: .72; } 100% { transform: scale(1.28); opacity: 0; } }

.washnah-ai__panel {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: auto;
  bottom: 80px;
  width: min(410px, calc(100vw - 32px));
  height: min(660px, calc(100vh - 120px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--wa-line);
  border-radius: 28px;
  color: var(--wa-text);
  background:
    linear-gradient(rgba(48,9,15,.95), rgba(22,6,10,.985)),
    url('../img/patterns/washnah-pattern-light.png');
  background-size: auto, 310px auto;
  box-shadow: var(--wa-shadow);
  backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(.965);
  transform-origin: bottom left;
  transition: opacity .28s ease, visibility .28s ease, transform .32s cubic-bezier(.2,.8,.2,1);
}
html[dir="rtl"] .washnah-ai__panel { transform-origin: bottom right; }
.washnah-ai.is-open .washnah-ai__panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.washnah-ai__header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px;
  border-bottom: 1px solid var(--wa-line);
  background: linear-gradient(135deg, rgba(128,25,34,.98), rgba(48,9,15,.95));
}
.washnah-ai__avatar { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.22); border-radius: 15px; background: rgba(255,255,255,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.washnah-ai__avatar i { font-size: 20px; }
.washnah-ai__identity { min-width: 0; flex: 1 1 auto; }
.washnah-ai__identity strong { display: block; margin-bottom: 2px; color: #fff; font-size: 14px; font-weight: 700; }
.washnah-ai__identity span { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.72); font-size: 11px; }
.washnah-ai__identity span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5fd8a7; box-shadow: 0 0 10px rgba(95,216,167,.82); }
.washnah-ai__header-actions { display: flex; align-items: center; gap: 7px; }
.washnah-ai__close, .washnah-ai__reset { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; color: #fff; background: rgba(255,255,255,.06); cursor: pointer; transition: background .22s ease, transform .22s ease; }
.washnah-ai__close:hover, .washnah-ai__reset:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }

.washnah-ai__messages { min-height: 0; overflow-y: auto; padding: 18px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.washnah-ai__message { max-width: 88%; margin-bottom: 12px; padding: 11px 13px; border-radius: 17px; font-size: 13px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.washnah-ai__message--assistant { margin-inline-end: auto; border: 1px solid rgba(255,255,255,.1); border-start-start-radius: 5px; color: rgba(255,255,255,.92); background: rgba(255,255,255,.078); }
.washnah-ai__message--user { margin-inline-start: auto; border-end-end-radius: 5px; color: #fff; background: linear-gradient(135deg, #9d2834, #70141d); box-shadow: 0 10px 24px rgba(128,25,34,.23); }
.washnah-ai__typing { display: inline-flex; align-items: center; gap: 5px; min-width: 56px; }
.washnah-ai__typing i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.72); animation: washAIDot 1.1s ease-in-out infinite; }
.washnah-ai__typing i:nth-child(2) { animation-delay: .14s; } .washnah-ai__typing i:nth-child(3) { animation-delay: .28s; }
@keyframes washAIDot { 0%,80%,100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }

.washnah-ai__suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.washnah-ai__suggestion { padding: 8px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: var(--wa-sand); background: rgba(255,255,255,.06); font-size: 10px; line-height: 1.45; cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.washnah-ai__suggestion:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.12); }

.washnah-ai__composer { padding: 13px; border-top: 1px solid var(--wa-line); background: rgba(13,5,8,.58); }
.washnah-ai__form { display: grid; grid-template-columns: 1fr 46px; gap: 8px; align-items: end; }
.washnah-ai__input { width: 100%; min-height: 46px; max-height: 118px; resize: none; padding: 11px 13px; border: 1px solid rgba(255,255,255,.14); border-radius: 15px; outline: none; color: #fff; background: rgba(255,255,255,.07); font: inherit; font-size: 12px; line-height: 1.55; }
.washnah-ai__input::placeholder { color: rgba(255,255,255,.43); }
.washnah-ai__input:focus { border-color: rgba(255,255,255,.34); box-shadow: 0 0 0 3px rgba(128,25,34,.18); }
.washnah-ai__send { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #9c2834, #6d131c); box-shadow: 0 12px 24px rgba(128,25,34,.27); cursor: pointer; }
.washnah-ai__send:disabled { opacity: .5; cursor: not-allowed; }
.washnah-ai__note { margin: 8px 0 0; color: rgba(255,255,255,.42); font-size: 9px; line-height: 1.5; text-align: center; }
.washnah-ai__error { color: #ffd2d6; background: rgba(180,32,47,.18); border-color: rgba(255,120,133,.25); }

@media (max-width: 575px) {
  .washnah-ai {
    inset-inline-start: max(12px, env(safe-area-inset-left));
    inset-inline-end: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .washnah-ai__launcher { margin-inline-end: auto; width: 57px; height: 57px; }
  .washnah-ai__panel { position: fixed; inset: auto 10px 78px; width: auto; height: min(74vh, 620px); border-radius: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .washnah-ai *, .washnah-ai__pulse { animation: none !important; transition-duration: .01ms !important; }
}


/* Position the assistant opposite the back-to-top button. */
html[dir="ltr"] .washnah-ai { left: max(15px, env(safe-area-inset-left)); right: auto; }
html[dir="rtl"] .washnah-ai { right: max(15px, env(safe-area-inset-right)); left: auto; }
html[dir="ltr"] .washnah-ai__panel { left: 0; right: auto; transform-origin: bottom left; }
html[dir="rtl"] .washnah-ai__panel { right: 0; left: auto; transform-origin: bottom right; }

@media (max-width: 575px) {
  html[dir="ltr"] .washnah-ai { left: max(12px, env(safe-area-inset-left)); right: auto; }
  html[dir="rtl"] .washnah-ai { right: max(12px, env(safe-area-inset-right)); left: auto; }
}

/* Visible assistant name beside the launcher. */
.washnah-ai__launcher-label {
  position: absolute;
  bottom: 50%;
  z-index: -1;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(128, 25, 34, 0.98), rgba(48, 9, 15, 0.98));
  box-shadow: 0 16px 38px rgba(20, 4, 8, 0.34);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(50%) scale(0.94);
  animation: washAILabelReveal 0.55s 0.75s cubic-bezier(.2, .8, .2, 1) forwards;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

html[dir="ltr"] .washnah-ai__launcher-label {
  left: 50px;
  padding-left: 25px;
}

html[dir="rtl"] .washnah-ai__launcher-label {
  right: 50px;
  padding-right: 25px;
}

.washnah-ai.is-open .washnah-ai__launcher-label {
  opacity: 0 !important;
  visibility: hidden;
  transform: translateY(50%) scale(0.92);
}

.washnah-ai:hover .washnah-ai__launcher-label,
.washnah-ai:focus-within .washnah-ai__launcher-label {
  box-shadow: 0 20px 46px rgba(128, 25, 34, 0.42);
}

@keyframes washAILabelReveal {
  from {
    opacity: 0;
    transform: translateY(50%) translateX(-8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(50%) translateX(0) scale(1);
  }
}

html[dir="rtl"] .washnah-ai__launcher-label {
  animation-name: washAILabelRevealRTL;
}

@keyframes washAILabelRevealRTL {
  from {
    opacity: 0;
    transform: translateY(50%) translateX(8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(50%) translateX(0) scale(1);
  }
}

@media (max-width: 575.98px) {
  .washnah-ai__launcher-label {
    min-height: 38px;
    max-width: calc(100vw - 88px);
    padding-block: 8px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html[dir="ltr"] .washnah-ai__launcher-label {
    left: 42px;
    padding-left: 22px;
  }

  html[dir="rtl"] .washnah-ai__launcher-label {
    right: 42px;
    padding-right: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .washnah-ai__launcher-label {
    opacity: 1;
    animation: none !important;
    transform: translateY(50%);
  }
}


/* Hide the launcher title automatically after the introductory display. */
.washnah-ai__launcher-label.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
}

html[dir="ltr"] .washnah-ai__launcher-label.is-hidden {
  transform: translateY(50%) translateX(-8px) scale(0.96) !important;
}

html[dir="rtl"] .washnah-ai__launcher-label.is-hidden {
  transform: translateY(50%) translateX(8px) scale(0.96) !important;
}

/* ========================================================================== 
   Sector-aware assistant themes and refined launcher introduction
   ========================================================================== */
.washnah-ai {
  --wa-theme: #801922;
  --wa-theme-dark: #30090f;
  --wa-theme-rgb: 128, 25, 34;
  --wa-theme-highlight: #a62c38;
  --wa-theme-surface: rgba(48, 9, 15, 0.985);
  isolation: isolate;
}

.washnah-ai[data-page="eco"] {
  --wa-theme: #004741;
  --wa-theme-dark: #002b28;
  --wa-theme-rgb: 0, 71, 65;
  --wa-theme-highlight: #08766c;
  --wa-theme-surface: rgba(0, 43, 40, 0.988);
}

.washnah-ai[data-page="water"] {
  --wa-theme: #4994b9;
  --wa-theme-dark: #173a4d;
  --wa-theme-rgb: 73, 148, 185;
  --wa-theme-highlight: #67afd1;
  --wa-theme-surface: rgba(18, 53, 71, 0.988);
}

.washnah-ai__launcher {
  z-index: 3;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.27), transparent 31%),
    linear-gradient(145deg, var(--wa-theme-highlight), var(--wa-theme-dark));
  box-shadow:
    0 18px 46px rgba(var(--wa-theme-rgb), .42),
    inset 0 0 0 5px rgba(255,255,255,.05);
}

.washnah-ai__launcher:hover,
.washnah-ai__launcher:focus-visible {
  box-shadow:
    0 25px 58px rgba(var(--wa-theme-rgb), .52),
    inset 0 0 0 5px rgba(255,255,255,.08);
}

.washnah-ai__pulse {
  border-color: rgba(var(--wa-theme-rgb), .54);
}

.washnah-ai__panel {
  background:
    radial-gradient(circle at 88% 8%, rgba(var(--wa-theme-rgb), .28), transparent 30%),
    linear-gradient(160deg, rgba(var(--wa-theme-rgb), .93) 0%, var(--wa-theme-surface) 35%, rgba(13, 6, 9, .992) 100%),
    url('../img/patterns/washnah-pattern-light.png');
  background-size: auto, auto, 310px auto;
  box-shadow:
    0 32px 94px rgba(6, 5, 8, .46),
    0 16px 54px rgba(var(--wa-theme-rgb), .18);
}

.washnah-ai__header {
  background:
    linear-gradient(135deg, rgba(var(--wa-theme-rgb), .99), var(--wa-theme-dark));
}

.washnah-ai__avatar {
  background: rgba(255,255,255,.11);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.06),
    0 10px 28px rgba(var(--wa-theme-rgb), .22);
}

.washnah-ai__message--user,
.washnah-ai__send {
  background: linear-gradient(145deg, var(--wa-theme-highlight), var(--wa-theme-dark));
  box-shadow: 0 12px 26px rgba(var(--wa-theme-rgb), .29);
}

.washnah-ai__input:focus {
  border-color: rgba(var(--wa-theme-rgb), .74);
  box-shadow: 0 0 0 3px rgba(var(--wa-theme-rgb), .19);
}

.washnah-ai__suggestion:hover,
.washnah-ai__suggestion:focus-visible {
  border-color: rgba(var(--wa-theme-rgb), .72);
  background: rgba(var(--wa-theme-rgb), .2);
  outline: none;
}

/* Elegant two-line introduction next to the assistant button. */
.washnah-ai__launcher-label {
  z-index: 2;
  min-width: 224px;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 17px;
  border-color: rgba(255,255,255,.2);
  border-radius: 20px;
  background:
    radial-gradient(circle at 14% 20%, rgba(255,255,255,.13), transparent 32%),
    linear-gradient(145deg, rgba(var(--wa-theme-rgb), .98), var(--wa-theme-dark));
  box-shadow:
    0 18px 42px rgba(7, 5, 8, .34),
    0 10px 32px rgba(var(--wa-theme-rgb), .24);
  font-size: inherit;
  font-weight: inherit;
  white-space: normal;
  overflow: visible;
}

html[dir="ltr"] .washnah-ai__launcher-label {
  left: 47px;
  padding-left: 25px;
  border-bottom-left-radius: 8px;
}

html[dir="rtl"] .washnah-ai__launcher-label {
  right: 47px;
  padding-right: 25px;
  border-bottom-right-radius: 8px;
}

.washnah-ai__launcher-label-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,.1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.washnah-ai__launcher-label-icon i {
  font-size: 15px;
}

.washnah-ai__launcher-label-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: start;
}

.washnah-ai__launcher-label-copy small {
  color: rgba(255,255,255,.68);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .06em;
  text-transform: uppercase;
}

html[dir="rtl"] .washnah-ai__launcher-label-copy small {
  letter-spacing: 0;
  text-transform: none;
}

.washnah-ai__launcher-label-copy strong {
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.washnah-ai:hover .washnah-ai__launcher-label,
.washnah-ai:focus-within .washnah-ai__launcher-label {
  box-shadow:
    0 22px 48px rgba(7, 5, 8, .38),
    0 12px 38px rgba(var(--wa-theme-rgb), .32);
}

@media (max-width: 575.98px) {
  .washnah-ai__launcher-label {
    min-width: 0;
    width: min(232px, calc(100vw - 82px));
    min-height: 52px;
    gap: 8px;
    padding-block: 7px;
    border-radius: 17px;
  }

  html[dir="ltr"] .washnah-ai__launcher-label {
    left: 40px;
    padding-left: 22px;
  }

  html[dir="rtl"] .washnah-ai__launcher-label {
    right: 40px;
    padding-right: 22px;
  }

  .washnah-ai__launcher-label-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .washnah-ai__launcher-label-copy small {
    font-size: 8px;
  }

  .washnah-ai__launcher-label-copy strong {
    font-size: 11px;
  }
}
