/* DS Jarvis Assistant v1.1.2 — Modern HUD UI (scoped + Divi safe) */
.dsj, .dsj * { box-sizing: border-box !important; }
.dsj * { float: none !important; }
.dsj {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  color: #EAF0FF;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: radial-gradient(1200px 500px at 20% -10%, rgba(0,102,255,.32), transparent 60%),
              radial-gradient(900px 450px at 110% 10%, rgba(127,176,255,.22), transparent 55%),
              linear-gradient(180deg, #0B1224 0%, #070B14 100%);
  box-shadow: 0 26px 70px rgba(0,0,0,.55);
}

/* Decorative frame/glow */
.dsj__frame{
  position:absolute; inset:10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  pointer-events:none;
  mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,.25) 100%);
}
.dsj__glow{
  position:absolute; inset:-120px;
  background: radial-gradient(circle at 30% 20%, rgba(0,102,255,.22), transparent 45%),
              radial-gradient(circle at 80% 10%, rgba(127,176,255,.18), transparent 45%);
  pointer-events:none;
  filter: blur(10px);
  opacity: .9;
}

/* Header */
.dsj__header{
  position: relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
  backdrop-filter: blur(10px);
}
.dsj__brand{display:flex; align-items:center; gap:12px; min-width:0;}
.dsj__logo{height:30px; width:auto; display:block;}
.dsj__txt{min-width:0;}
.dsj__title{
  font-weight: 950;
  letter-spacing: .4px;
  font-size: 16px;
  line-height: 1.15;
}
.dsj__sub{
  margin-top: 4px;
  color: rgba(234,240,255,.78);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* System */
.dsj__sys{display:flex; align-items:center; gap:10px;}
.dsj__dot{
  width:10px; height:10px; border-radius:99px;
  background: #00FFA3;
  box-shadow: 0 0 0 6px rgba(0,255,163,.10), 0 0 24px rgba(0,255,163,.25);
}
.dsj__sysTxt{font-size:11px; letter-spacing:.12em; color: rgba(234,240,255,.72);}
.dsj__reset{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
  color: #EAF0FF;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.dsj__reset:hover{ background: rgba(255,255,255,.08); transform: translateY(-1px); }

/* Chat area */
.dsj__chat{
  position: relative;
  padding: 16px 16px 12px;
}
.dsj__messages{
  display:flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
  max-height: 520px;
  overflow:auto;
  padding: 8px 4px 26px;
  scroll-behavior:smooth;
}
/* nice scrollbar */
.dsj__messages::-webkit-scrollbar{ width: 10px; }
.dsj__messages::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.10); border-radius: 99px; }
.dsj__messages::-webkit-scrollbar-track{ background: rgba(0,0,0,0); }

.dsj__fade{
  position:absolute; left:0; right:0; bottom:0; height:44px;
  background: linear-gradient(180deg, rgba(7,11,20,0), rgba(7,11,20,1));
  pointer-events:none;
}

/* Bubbles */
.dsj-bubble{
  max-width: 78%;
  border-radius: 16px;
  padding: 12px 14px;
  line-height: 1.55;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: dsjPop .18s ease-out;
}
@keyframes dsjPop { from { transform: translateY(4px); opacity: .0; } to { transform: translateY(0); opacity: 1; } }

.dsj-bubble--bot{
  align-self:flex-start;
  background: linear-gradient(180deg, rgba(127,176,255,.16), rgba(255,255,255,.04));
  border-color: rgba(127,176,255,.28);
}
.dsj-bubble--user{
  align-self:flex-end;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.18);
}
.dsj-meta{margin-top:8px; font-size:11px; color: rgba(234,240,255,.70);}

/* Composer */
.dsj__composer{
  position: relative;
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  backdrop-filter: blur(10px);
}

/* Quick buttons */
.dsj__quick{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom: 10px;
}
.dsj__qbtn{
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  color:#EAF0FF;
  border-radius: 999px;
  padding: 10px 12px;
  cursor:pointer;
  font-size: 13px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.dsj__qbtn:hover{ background: rgba(255,255,255,.08); transform: translateY(-1px); }
.dsj__qbtn.is-primary{
  background: linear-gradient(180deg, #1B76FF, #0057FF);
  border-color:#2C7BFF;
  box-shadow: 0 14px 35px rgba(0,102,255,.22);
}

/* Input row */
.dsj__inputRow{ display:flex; gap: 10px; align-items: stretch; }
.dsj__input{
  flex: 1;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.96);
  color: #0B1224;
  padding: 14px 14px;
  font-size: 15px;
  outline: none;
}
.dsj__input::placeholder{ color: rgba(11,18,36,.55); }
.dsj__input:focus{
  border-color: #2C7BFF;
  box-shadow: 0 0 0 5px rgba(0,102,255,.22);
}
.dsj__send{
  border-radius: 14px;
  background: linear-gradient(180deg, #1B76FF, #0057FF);
  border: 1px solid #2C7BFF;
  color: #fff;
  padding: 0 16px;
  min-width: 132px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(0,102,255,.22);
  transition: transform .12s ease, filter .12s ease;
}
.dsj__send:hover{ transform: translateY(-1px); filter: brightness(1.05); }
.dsj__send[disabled]{ opacity:.7; cursor:not-allowed; transform:none; filter:none; }

/* File row */
.dsj__fileRow{
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
}
.dsj__fileTop{display:flex; gap:10px; align-items:center; margin-bottom: 10px;}
.dsj__fileIcon{ width: 26px; height: 26px; border-radius: 10px; object-fit:cover; opacity:.92; }
.dsj__fileTitle{ font-weight: 950; font-size: 12px; letter-spacing:.04em; }
.dsj__fileHint{ font-size: 12px; color: rgba(234,240,255,.72); margin-top: 2px; }
.dsj__file{
  width: 100%;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.96);
  color: #0B1224;
}

/* Hint */
.dsj__hint{ margin-top: 10px; font-size: 12px; color: rgba(234,240,255,.70); line-height: 1.5; }
.dsj__sr{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }

@media (max-width: 720px){
  .dsj__messages{ min-height: 260px; max-height: 420px; }
  .dsj-bubble{ max-width: 92%; }
  .dsj__send{ min-width: 108px; }
  .dsj__sub{ display:none; }
}

/* ===== Fullscreen shell (Option A) ===== */
.dsj-shell{ position: relative; }
.dsj-shell--fullscreen{
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display:flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 22px !important;
}
.dsj-shell__backdrop{
  position:absolute; inset:0;
  background: radial-gradient(1200px 700px at 20% 10%, rgba(0,102,255,.24), transparent 55%),
              radial-gradient(900px 600px at 90% 20%, rgba(127,176,255,.18), transparent 55%),
              rgba(3,6,12,.80);
  backdrop-filter: blur(10px);
}
.dsj-shell--fullscreen .dsj{
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 44px));
}
body.dsj-body--fullscreen{
  overflow: hidden !important;
}
/* Small screens */
@media (max-width: 520px){
  .dsj-shell--fullscreen{ padding: 14px !important; }
  .dsj-shell--fullscreen .dsj{ width: min(980px, calc(100vw - 28px)); }
}


/* === Cosmetic tweaks v3.0.2 === */

/* Marges latérales */
/* Hauteur des champs / centrage texte */
.dsj__input {
  min-height: 54px;
  padding: 14px 16px;
  line-height: 1.4;
}

/* Zone message (bulles) */
.dsj__messages {
  padding: 20px 8px;
}

/* Validation finale plus lisible */
.dsj__confirm,
.dsj__final,
.dsj__summary {
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Boutons confirmer / modifier plus visibles */
.dsj__actions button {
  min-height: 46px;
  font-size: 1rem;
}

.dsj__main{padding-left:28px;padding-right:28px;}

@media (max-width: 600px){.dsj__main{padding-left:20px;padding-right:20px;}}

/* === v3.0.6 : remove background overlay (video-friendly) === */
.dsj-shell__backdrop {
  display: none !important;
}
.dsj-shell {
  background: transparent !important;
}

/* === v3.0.8 : Divi compatibility (header/footer overlap) === */

/* Ensure Jarvis stays in normal flow */
.dsj-shell {
  position: relative !important;
  z-index: 1 !important;
}

/* Navbar should not overlap Divi header */
.ds-navbar {
  position: relative !important;
  z-index: 2 !important;
}

/* Prevent footer from overlaying assistant */
footer,
.et_pb_section.et_pb_section_0_tb_footer {
  position: relative !important;
  z-index: 0 !important;
}

/* Safety spacing above assistant */
.dsj {
  margin-top: 40px;
}

/* === Client ticket viewer (conversation) === */
.ds-client-ticket{max-width:980px;margin:28px auto 40px auto;padding:0 16px}
.ds-client-ticket__card{background:rgba(8,18,35,.72);border:1px solid rgba(255,255,255,.10);border-radius:22px;box-shadow:0 20px 70px rgba(0,0,0,.35);overflow:hidden}
.ds-client-ticket__head{padding:18px 20px;border-bottom:1px solid rgba(255,255,255,.08)}
.ds-client-ticket__title{font-size:20px;font-weight:800;color:rgba(255,255,255,.92)}
.ds-client-ticket__meta{margin-top:8px;display:flex;flex-wrap:wrap;gap:12px;font-size:13px;color:rgba(255,255,255,.72)}
.ds-client-ticket__timeline{padding:18px 20px;display:flex;flex-direction:column;gap:12px}
.ds-client-ticket__item{display:flex}
.ds-client-ticket__item--client{justify-content:flex-end}
.ds-client-ticket__item--admin{justify-content:flex-start}
.ds-client-ticket__bubble{max-width:740px;padding:14px 14px 10px 14px;border-radius:16px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.06);color:rgba(255,255,255,.90)}
.ds-client-ticket__item--admin .ds-client-ticket__bubble{background:rgba(0,160,255,.10);border-color:rgba(0,160,255,.25)}
.ds-client-ticket__who{font-size:12px;opacity:.85;margin-bottom:6px;font-weight:700}
.ds-client-ticket__msg{font-size:14px;line-height:1.55}
.ds-client-ticket__time{margin-top:8px;font-size:11px;opacity:.65;text-align:right}

/* === Ticket Viewer (client) === */
.ds-tv{max-width:980px;margin:24px auto 60px auto;padding:0 12px;position:relative;z-index:2}
.ds-tv__card{border:1px solid rgba(255,255,255,.10);background:rgba(8,18,34,.72);backdrop-filter:blur(14px);border-radius:22px;box-shadow:0 18px 60px rgba(0,0,0,.35);padding:18px}
.ds-tv__head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.ds-tv__title{font-size:20px;font-weight:800;color:#fff}
.ds-tv__meta{display:flex;gap:8px;flex-wrap:wrap}
.ds-tv__pill{font-size:12px;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.10);color:rgba(255,255,255,.92);border:1px solid rgba(255,255,255,.10)}
.ds-tv__pill--muted{opacity:.85}
.ds-tv__timeline{display:flex;flex-direction:column;gap:12px;padding:10px 0 16px 0}
.ds-tv__msg{display:flex;flex-direction:column;gap:6px}
.ds-tv__msg--client{align-items:flex-end}
.ds-tv__msg--support{align-items:flex-start}
.ds-tv__bubble{max-width:78%;padding:12px 14px;border-radius:18px;border:1px solid rgba(255,255,255,.10);color:rgba(255,255,255,.92);background:rgba(255,255,255,.06)}
.ds-tv__msg--client .ds-tv__bubble{background:rgba(0,160,255,.16)}
.ds-tv__stamp{font-size:11px;opacity:.75;color:rgba(255,255,255,.78)}
.ds-tv__reply{margin-top:8px;padding-top:14px;border-top:1px solid rgba(255,255,255,.10)}
.ds-tv__replyTitle{font-size:14px;font-weight:800;color:#fff;margin-bottom:8px}
.ds-tv__textarea{width:100%;border-radius:16px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);color:#fff;padding:12px 12px;outline:none}
.ds-tv__textarea:focus{border-color:rgba(255,255,255,.22)}
.ds-tv__actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}
.ds-tv__btn{border-radius:14px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.10);color:#fff;padding:10px 14px;font-weight:800;cursor:pointer}
.ds-tv__btn:hover{background:rgba(255,255,255,.14)}
.ds-tv__hint{font-size:12px;opacity:.85;color:rgba(255,255,255,.85)}
@media (max-width:680px){.ds-tv__bubble{max-width:92%}.ds-tv__head{flex-direction:column;align-items:flex-start}}


/* === Client Portal (Mes tickets) — UI alignée avec l'assistant === */
.ds-portal{
  max-width: 980px;
  margin: 28px auto 70px auto;
  padding: 0 18px;
  position: relative;
  z-index: 2;
}
.ds-portal__card{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(8,18,34,.72);
  backdrop-filter: blur(14px);
  border-radius: 22px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  padding: 20px;
  overflow: hidden;
}
.ds-portal__title{
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin: 0;
}
.ds-portal__sub{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  opacity: .86;
  color: rgba(255,255,255,.90);
}
.ds-portal__form{
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.ds-portal__label{
  grid-column: 1 / -1;
  font-size: 12px;
  opacity: .85;
  color: rgba(255,255,255,.86);
}
.ds-portal__input{
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
  padding: 14px 14px;
  min-height: 52px;
  outline: none;
}
.ds-portal__input:focus{
  border-color: rgba(255,255,255,.22);
}
.ds-portal__btn{
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(0,140,255,.95), rgba(0,95,210,.92));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.ds-portal__btn:hover{
  filter: brightness(1.05);
}
.ds-portal__hint{
  grid-column: 1 / -1;
  font-size: 12px;
  opacity: .9;
  color: rgba(255,255,255,.86);
  margin-top: 4px;
}
.ds-portal__pill{
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.10);
}
.ds-portal__list{
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ds-portal__item{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  text-decoration: none;
}
.ds-portal__item:hover{ background: rgba(255,255,255,.08); }
.ds-portal__itemTitle{ font-weight: 900; color:#fff; }
.ds-portal__itemMeta{ font-size: 12px; opacity:.75; color: rgba(255,255,255,.85); margin-top:2px; }
.ds-portal__status{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.10);
}
.ds-portal__empty{ margin-top: 14px; opacity:.85; color: rgba(255,255,255,.86); }
.ds-portal__small{ margin-top: 12px; font-size: 12px; opacity:.8; color: rgba(255,255,255,.84); }

@media (max-width: 720px){
  .ds-portal__form{ grid-template-columns: 1fr; }
  .ds-portal__btn{ width: 100%; }
}

/* Force readable typing on dark background (theme overrides) */
.ds-tv .ds-tv__textarea{color:#fff !important;caret-color:#fff !important;}
.ds-tv .ds-tv__textarea::placeholder{color:rgba(255,255,255,.55) !important;}
