/* ViewTitan theme for Chatwoot — injected by nginx */
@import url("/vt-theme/fonts/cairo.css");
@import url("/vt-theme/brand.css?v=2");

/* ---------- Font: Cairo everywhere (except code) ---------- */
html body,
html body *:not(code):not(pre):not(kbd):not(samp):not(.font-mono) {
  font-family: "Cairo", -apple-system, "Segoe UI", Tahoma, Arial, sans-serif !important;
}
html body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
}

/* ---------- Brand: ViewTitan emerald (replaces Chatwoot blue) ---------- */
:root {
  --blue-1: 248 254 251;
  --blue-2: 236 252 244;
  --blue-3: 216 247 232;
  --blue-4: 192 240 217;
  --blue-5: 160 230 198;
  --blue-6: 120 216 174;
  --blue-7: 72 196 146;
  --blue-8: 32 178 128;
  --blue-9: 15 164 122;
  --blue-10: 11 145 107;
  --blue-11: 6 112 82;
  --blue-12: 6 60 45;
  --text-blue: 6 60 45;
  --solid-blue: 214 245 229;
  --solid-blue-2: 248 254 251;
  --border-blue-strong: 6 112 82;
  --background-color: 241 246 244;
  --vt-accent: 245 166 35;
  --vt-dark-1: 6 46 36;
  --vt-dark-2: 9 74 57;
}
.dark {
  --blue-1: 10 22 18;
  --blue-2: 13 30 24;
  --blue-3: 12 48 36;
  --blue-4: 10 62 46;
  --blue-5: 15 78 59;
  --blue-6: 22 96 74;
  --blue-7: 30 118 92;
  --blue-8: 36 142 110;
  --blue-9: 20 175 131;
  --blue-10: 34 192 146;
  --blue-11: 74 226 172;
  --blue-12: 190 246 222;
  --text-blue: 190 246 222;
  --solid-blue: 12 66 50;
  --border-blue-strong: 15 78 59;
}

/* ---------- Sidebar: deep emerald with light text ---------- */
aside.bg-n-background {
  --slate-1: 7 46 36;
  --slate-2: 9 54 42;
  --slate-3: 13 66 51;
  --slate-4: 17 78 61;
  --slate-5: 22 90 71;
  --slate-6: 31 104 83;
  --slate-7: 46 122 99;
  --slate-8: 74 144 121;
  --slate-9: 124 176 157;
  --slate-10: 158 198 183;
  --slate-11: 205 232 222;
  --slate-12: 255 255 255;
  --background-color: 7 50 39;
  --alpha-1: 255, 255, 255, 0.05;
  --alpha-2: 255, 255, 255, 0.1;
  --alpha-3: 255, 255, 255, 0.16;
  --button-color: 14 82 64;
  --border-weak: 22 92 72;
  --border-strong: 30 104 83;
  --border-container: 22 92 72;
  --solid-1: 10 60 47;
  --solid-2: 12 68 53;
  --solid-3: 14 76 59;
  --blue-11: 110 231 183;
  --blue-9: 52 211 153;
  background-image: linear-gradient(180deg, rgb(var(--vt-dark-2)) 0%, rgb(var(--vt-dark-1)) 100%) !important;
  color: rgb(205 232 222);
  border-inline-end: 0 !important;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.06);
}
aside.bg-n-background a[aria-current="page"],
aside.bg-n-background a.router-link-exact-active {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 rgb(var(--vt-accent));
}
[dir="rtl"] aside.bg-n-background a[aria-current="page"],
[dir="rtl"] aside.bg-n-background a.router-link-exact-active {
  box-shadow: inset -3px 0 0 rgb(var(--vt-accent));
}
aside.bg-n-background input {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}
aside.bg-n-background input::placeholder { color: rgb(158 198 183); }
aside.bg-n-background .pointer-events-none.bg-gradient-to-t { display: none; }

/* ---------- Message bubbles (WhatsApp feel) ---------- */
.right-bubble.bg-n-solid-blue {
  background: rgb(var(--solid-blue)) !important;
  color: rgb(var(--slate-12)) !important;
  box-shadow: 0 1px 1.5px rgba(6, 60, 45, 0.12);
}
.left-bubble {
  background: rgb(var(--solid-1, 255 255 255)) !important;
  box-shadow: 0 1px 1.5px rgba(16, 35, 29, 0.1);
  border: 1px solid rgb(var(--slate-3));
}
.dark .left-bubble { border-color: transparent; }

/* chat background: soft tint + faint doodle pattern */
ul.conversation-panel {
  background-color: rgb(236 243 239) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%230fa47a' stroke-opacity='.09' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 22h26a6 6 0 0 1 6 6v12a6 6 0 0 1-6 6H32l-8 7v-7h-4a6 6 0 0 1-6-6V28a6 6 0 0 1 6-6Z'/%3E%3Cpath d='m104 30 8 8 14-16'/%3E%3Ccircle cx='128' cy='104' r='12'/%3E%3Cpath d='M40 112c6-8 14-8 20 0s14 8 20 0'/%3E%3Cpath d='M98 128h22M109 117v22'/%3E%3Ccircle cx='76' cy='66' r='3'/%3E%3Ccircle cx='146' cy='60' r='3'/%3E%3C/g%3E%3C/svg%3E");
}
.dark ul.conversation-panel {
  background-color: rgb(11 20 17) !important;
}

/* ---------- Conversation list: clear selected state ---------- */
.conversations-list .conversation.active,
.conversations-list .conversation.selected {
  background: rgb(var(--blue-2)) !important;
  box-shadow: inset -3px 0 0 rgb(var(--blue-9));
}
[dir="ltr"] .conversations-list .conversation.active,
[dir="ltr"] .conversations-list .conversation.selected {
  box-shadow: inset 3px 0 0 rgb(var(--blue-9));
}
.conversations-list .conversation:hover { background: rgb(var(--slate-2)); }

/* ---------- Login / auth pages ---------- */
html.vt-auth main.min-h-screen {
  background:
    radial-gradient(900px 420px at 50% -10%, rgb(var(--blue-3)), transparent 70%),
    rgb(var(--background-color)) !important;
}
html.vt-auth main.min-h-screen > section.bg-white,
html.vt-auth main.min-h-screen section.shadow {
  border-radius: 20px !important;
  box-shadow: 0 1px 2px rgba(6, 46, 36, 0.05), 0 18px 48px rgba(6, 46, 36, 0.1) !important;
  border: 1px solid rgb(var(--slate-3));
}
html.vt-auth h2.text-3xl { font-weight: 800 !important; font-size: 26px !important; }
#vt-hero { display: none; }
@media (min-width: 1024px) {
  html.vt-auth main.min-h-screen { padding-inline-end: 46vw !important; }
  #vt-hero {
    display: flex;
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: 46vw;
    z-index: 5;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #fff;
    background:
      radial-gradient(600px 400px at 85% 10%, rgba(52, 211, 153, 0.35), transparent 70%),
      radial-gradient(500px 360px at 10% 95%, rgba(245, 166, 35, 0.22), transparent 70%),
      linear-gradient(160deg, rgb(var(--vt-dark-2)) 0%, rgb(var(--vt-dark-1)) 100%);
    overflow: hidden;
  }
  #vt-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 22h26a6 6 0 0 1 6 6v12a6 6 0 0 1-6 6H32l-8 7v-7h-4a6 6 0 0 1-6-6V28a6 6 0 0 1 6-6Z'/%3E%3Cpath d='m104 30 8 8 14-16'/%3E%3Ccircle cx='128' cy='104' r='12'/%3E%3Cpath d='M40 112c6-8 14-8 20 0s14 8 20 0'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
  }
  .vt-hero-in { position: relative; z-index: 1; max-width: 460px; }
  .vt-hero-in img { height: 40px; margin-bottom: 36px; }
  .vt-hero-in h1 { font-size: 34px; line-height: 1.35; font-weight: 800; margin: 0 0 12px; }
  .vt-hero-in > p { font-size: 17px; color: rgba(255, 255, 255, 0.78); margin: 0 0 28px; }
  .vt-hero-in ul { list-style: none; padding: 0; margin: 0 0 34px; display: grid; gap: 12px; }
  .vt-hero-in li { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; }
  .vt-hero-in li i {
    width: 28px; height: 28px; flex: none; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.14); color: rgb(110 231 183);
  }
  .vt-hero-in li svg { width: 16px; height: 16px; }
  .vt-hero-chat {
    display: grid; gap: 8px; padding: 18px; border-radius: 18px;
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
  }
  .vt-hero-chat .b {
    max-width: 78%; padding: 8px 14px; border-radius: 14px; font-size: 14.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  }
  .vt-hero-chat .in { background: #fff; color: #10231d; justify-self: start; border-start-start-radius: 4px; }
  .vt-hero-chat .out { background: rgb(214 245 229); color: #10231d; justify-self: end; border-start-end-radius: 4px; }
}

/* ---------- Buttons & controls ---------- */
button.bg-n-brand,
a.bg-n-brand {
  background-image: linear-gradient(135deg, rgb(var(--blue-8)), rgb(var(--blue-10))) !important;
  box-shadow: 0 4px 12px rgba(15, 164, 122, 0.28);
}
button.bg-n-brand:hover:enabled { filter: brightness(1.06); }

/* ---------- Readability tweaks for Arabic ---------- */
[dir="rtl"] .message-text__wrap,
[dir="rtl"] .text-content,
[dir="rtl"] p {
  line-height: 1.75;
}
html body input,
html body textarea,
html body button,
html body select {
  font-family: inherit !important;
}

/* ---------- Polished scrollbars ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--slate-6)) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: rgb(var(--slate-6));
  border-radius: 8px;
}
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- "ربط واتساب" sidebar item ---------- */
.vt-wa-icon {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38a9.9 9.9 0 0 0 4.74 1.21c5.46 0 9.91-4.45 9.91-9.91S17.5 2 12.04 2Zm0 18.15c-1.48 0-2.93-.4-4.2-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.2 8.2 0 0 1-1.26-4.38c0-4.54 3.7-8.24 8.25-8.24 4.54 0 8.24 3.7 8.24 8.24 0 4.55-3.7 8.24-8.24 8.24Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38a9.9 9.9 0 0 0 4.74 1.21c5.46 0 9.91-4.45 9.91-9.91S17.5 2 12.04 2Zm0 18.15c-1.48 0-2.93-.4-4.2-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.2 8.2 0 0 1-1.26-4.38c0-4.54 3.7-8.24 8.25-8.24 4.54 0 8.24 3.7 8.24 8.24 0 4.55-3.7 8.24-8.24 8.24Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#vt-wa a { color: rgb(var(--blue-11)); font-weight: 600; }

/* ---------- Phone number under the name in the conversation header ---------- */
.vt-phone {
  direction: ltr;
  unicode-bidi: isolate;
  cursor: copy;
  letter-spacing: 0.3px;
}
.vt-phone:hover { color: rgb(var(--blue-11)) !important; }

/* ---------- Inbox title: label on top, number below ---------- */
.vt-inbox-split { display: inline-flex; flex-direction: column; line-height: 1.25; }
.vt-inbox-num {
  font-size: 12.5px;
  font-weight: 500;
  color: rgb(var(--slate-10));
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}
.vt-contact-head { cursor: pointer; }
.vt-contact-head:hover { opacity: 0.85; }

/* ---------- Contact info drawer ---------- */
#vt-drawer { position: fixed; inset: 0; z-index: 9000; }
.vt-dr-back { position: absolute; inset: 0; background: rgba(8, 16, 13, 0.35); animation: vtFade 0.15s ease-out; }
.vt-dr {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(400px, 100vw);
  background: rgb(var(--solid-1, 255 255 255));
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  animation: vtSlide 0.22s ease-out;
}
[dir="rtl"] .vt-dr { animation-name: vtSlideRtl; }
@keyframes vtSlide { from { transform: translateX(100%); } }
@keyframes vtSlideRtl { from { transform: translateX(-100%); } }
.vt-dr header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgb(var(--slate-4));
}
.vt-dr header h3 { margin: 0; font-size: 16px; font-weight: 700; color: rgb(var(--slate-12)); }
.vt-dr-x {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(var(--slate-3)); color: rgb(var(--slate-11)); font-size: 15px;
}
.vt-dr-body { flex: 1; overflow-y: auto; background: rgb(var(--slate-2)); }
.vt-dr-body section { background: rgb(var(--solid-1, 255 255 255)); padding: 16px 20px; margin-bottom: 8px; }
.vt-dr-body h4 {
  margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: rgb(var(--blue-11));
  display: flex; justify-content: space-between;
}
.vt-dr-body h4 span { color: rgb(var(--slate-10)); font-weight: 600; }
.vt-dr-body p { margin: 0 0 6px; color: rgb(var(--slate-12)); font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; }
.vt-dr-body a { color: rgb(var(--blue-11)); }
.vt-dr-hero { text-align: center; padding-top: 28px !important; }
.vt-dr-av {
  width: 150px; height: 150px; border-radius: 50%; object-fit: cover; cursor: zoom-in;
  display: block; margin: 0 auto 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.vt-dr-av0 {
  display: grid; place-items: center; cursor: default; font-size: 56px; font-weight: 700;
  background: rgb(var(--blue-3)); color: rgb(var(--blue-11));
}
.vt-dr-hero h2 { margin: 0; font-size: 21px; font-weight: 700; color: rgb(var(--slate-12)); }
.vt-dr-phone { margin-top: 4px; font-size: 16px; color: rgb(var(--slate-11)); direction: ltr; unicode-bidi: isolate; }
.vt-dr-wa { margin-top: 2px; font-size: 13.5px; color: rgb(var(--slate-10)); }
.vt-dr-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.vt-dr-actions > * {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: 12px; border: 1px solid rgb(var(--slate-4));
  background: transparent; color: rgb(var(--blue-11)) !important; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.vt-dr-actions > *:hover { background: rgb(var(--blue-2)); }
.vt-dr-actions span { font-size: 18px; line-height: 1; }
.vt-dr-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.vt-dr-media img, .vt-dr-file {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in;
  background: rgb(var(--slate-3));
}
.vt-dr-file { display: grid; place-items: center; font-size: 26px; text-decoration: none; cursor: pointer; }
.vt-dr-muted { color: rgb(var(--slate-10)) !important; font-size: 13.5px !important; }
.vt-dr-link { display: block; text-align: center; font-weight: 600; text-decoration: none; }
.vt-dr-err { padding: 24px; text-align: center; color: rgb(var(--ruby-11)); }
.vt-dr-spin {
  width: 30px; height: 30px; margin: 60px auto; border-radius: 50%;
  border: 3px solid rgb(var(--blue-4)); border-top-color: rgb(var(--blue-9));
  animation: vtSpin 0.8s linear infinite;
}
@keyframes vtSpin { to { transform: rotate(360deg); } }
.vt-lightbox { z-index: 10001; }

/* ---------- Avatar lightbox ---------- */
.vt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 16, 13, 0.82);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 24px;
  cursor: zoom-out;
  animation: vtFade 0.15s ease-out;
}
.vt-lightbox img {
  max-width: min(92vw, 640px);
  max-height: 86vh;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: #fff;
}
.vt-lightbox button {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
@keyframes vtFade { from { opacity: 0; } }
img[src*="active_storage"] { cursor: zoom-in; }
li img[src*="active_storage"], a img[src*="active_storage"] { cursor: inherit; }

/* ---------- Selection ---------- */
::selection {
  background: rgb(var(--blue-5));
  color: rgb(var(--slate-12));
}
