/* ============================================================
   FanSeat: Floating chat widget, social bar & auth modal
   ============================================================ */

/* ---------- launcher ---------- */
.chat-launcher {
  position: fixed; right: 26px; bottom: 26px; z-index: 2000;
  width: 62px; height: 62px; border-radius: 50%; border: 0;
  background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow);
  display: grid; place-items: center; transition: transform .2s ease;
}
.chat-launcher:hover { transform: scale(1.07); }
.chat-launcher .cls-ico { display: none; }
.chat-launcher.open .open-ico { display: none; }
.chat-launcher.open .cls-ico { display: block; }
.chat-launcher svg { width: 26px; height: 26px; }
.chat-head .ch-av svg { width: 22px; height: 22px; }
.chat-close svg { width: 16px; height: 16px; }
.chat-send svg { width: 19px; height: 19px; }
.chat-empty .ce-ico svg { width: 24px; height: 24px; }
.modal-close svg { width: 16px; height: 16px; }
.chat-launcher .pulse { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(37, 99, 235, .45); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .4); }
  70% { box-shadow: 0 0 0 16px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.launcher-badge {
  position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 5px;
  background: var(--danger); color: #fff; border-radius: var(--r-full);
  font-size: 12px; font-weight: 800; display: none; align-items: center; justify-content: center;
  border: 2px solid #fff; font-variant-numeric: tabular-nums;
}
.launcher-badge.show { display: inline-flex; }

/* ---------- panel ---------- */
.chat-panel {
  position: fixed; right: 26px; bottom: 100px; z-index: 2001;
  width: 384px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 130px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  transform: translateY(20px) scale(.98); opacity: 0; pointer-events: none;
  transition: transform .22s cubic-bezier(.2,.9,.3,1.2), opacity .18s;
}
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }

/* header */
.chat-head {
  background: var(--grad-navy); color: #fff; padding: 16px 18px;
  display: flex; align-items: center; gap: 12px; position: relative;
}
.chat-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--grad-brand);
}
.chat-head .ch-av {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  background: var(--grad-brand); display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.chat-head .ch-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 7px; }
.chat-head .ch-sub { font-size: 12px; color: rgba(220,232,247,.85); display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.chat-head .ch-sub .live { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.5); animation: blink 1.8s infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 5px rgba(52,211,153,0); } }
.chat-close { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; }
.chat-close:hover { background: rgba(255,255,255,.2); }

/* body */
.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: #f3f6fb; display: flex; flex-direction: column; gap: 10px; }
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-date {
  align-self: center; font-size: 11px; color: var(--text-400); background: #e7ecf4;
  padding: 4px 12px; border-radius: 999px; font-weight: 600;
}
.msg { max-width: 82%; display: flex; flex-direction: column; }
.msg .bubble {
  padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-sm);
}
.msg .meta { display: flex; gap: 7px; align-items: center; font-size: 10.5px; color: var(--text-400); margin-top: 4px; padding: 0 4px; }
.msg .meta .read { color: var(--teal-500); font-weight: 600; }
.msg.from-client { align-self: flex-end; align-items: flex-end; }
.msg.from-client .bubble { background: var(--grad-brand); color: #fff; border-bottom-right-radius: 6px; }
.msg.from-admin { align-self: flex-start; align-items: flex-start; }
.msg.from-admin .who { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--navy-700); margin-bottom: 3px; padding-left: 4px; }
.msg.from-admin .who .av { width: 16px; height: 16px; border-radius: 50%; background: var(--grad-brand); }
.msg.from-admin .bubble { background: #fff; color: var(--text-900); border: 1px solid var(--line); border-bottom-left-radius: 6px; }

.chat-empty { margin: auto; text-align: center; padding: 18px; }
.chat-empty .ce-ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; background: var(--grad-brand-soft); color: var(--blue-600); display: grid; place-items: center; }
.chat-empty p { font-size: 13px; color: var(--text-500); }
.chat-empty p b { color: var(--navy-800); }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 12px; }
.qchip {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-700);
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 6px 12px; transition: all .15s;
}
.qchip:hover { border-color: var(--blue-500); color: var(--blue-600); background: #f0f6ff; }

/* typing */
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #b6c3d6; animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* compose */
.chat-compose { border-top: 1px solid var(--line); background: #fff; padding: 12px; display: flex; gap: 9px; align-items: flex-end; }
.chat-compose textarea {
  flex: 1; border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 10px 13px;
  font: inherit; font-size: 14px; resize: none; max-height: 100px; outline: none; line-height: 1.4;
}
.chat-compose textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.chat-send {
  width: 44px; height: 44px; flex: none; border-radius: 14px; border: 0;
  background: var(--grad-brand); color: #fff; display: grid; place-items: center;
  transition: transform .12s, box-shadow .15s;
}
.chat-send:hover { box-shadow: var(--shadow-glow); }
.chat-send:active { transform: scale(.94); }
.chat-send[disabled] { opacity: .5; }

/* social bar inside widget footer */
.chat-social {
  background: #0b1f3a; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.chat-social .cs-label { color: #9fb1c9; font-size: 11.5px; line-height: 1.3; }
.chat-social .cs-label b { color: #fff; display: block; font-size: 12.5px; }
.social-btns { display: flex; gap: 9px; flex: none; }
.soc-btn {
  width: 36px; height: 36px; border-radius: 12px; border: 0; color: #fff;
  display: grid; place-items: center; transition: transform .15s, box-shadow .18s;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}
.soc-btn:hover { transform: translateY(-3px) scale(1.05); }
.soc-fb { background: linear-gradient(135deg, #1877f2, #0f5cc9); }
.soc-tt { background: linear-gradient(135deg, #25f4ee 0%, #25f4ee 35%, #fe2c55 90%); color: #0b0b12; }
.soc-tg { background: linear-gradient(135deg, #29a9eb, #1d8fd1); }
.soc-btn svg { width: 18px; height: 18px; }

/* ============================================================
   Auth modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2500; background: rgba(7, 21, 39, 0.55);
  backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 440px; background: #fff; border-radius: 26px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: translateY(14px) scale(.98); transition: transform .22s cubic-bezier(.2,.9,.3,1.15);
}
.modal-overlay.show .modal { transform: none; }
.modal-head {
  position: relative; background: var(--grad-navy); color: #fff; padding: 26px 28px 22px; overflow: hidden;
}
.modal-head::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,212,191,.4), transparent 65%);
}
.modal-head h3 { color: #fff; font-size: 24px; position: relative; z-index: 1; }
.modal-head p { color: rgba(220,232,247,.85); font-size: 13.5px; margin-top: 6px; position: relative; z-index: 1; }
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 34px; height: 34px;
  border-radius: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center;
}
.modal-close:hover { background: rgba(255,255,255,.22); }
.modal-body { padding: 26px 28px 30px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #eef2f8; border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.tab {
  border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 700; font-size: 14px;
  color: var(--text-500); transition: all .18s;
}
.tab.active { background: #fff; color: var(--blue-600); box-shadow: var(--shadow-sm); }
.modal .btn-primary { box-shadow: none; }
.form-note {
  margin-top: 14px; font-size: 12.5px; color: var(--text-400); text-align: center;
}
.form-note a { color: var(--blue-600); font-weight: 600; cursor: pointer; }
.form-error {
  display: none; background: var(--danger-bg); color: var(--danger); border: 1px solid #f9c8d3;
  font-size: 13px; border-radius: 10px; padding: 10px 13px; margin-bottom: 14px;
}
.form-error.show { display: block; }

/* ---------- auth modal extras ---------- */
.form-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -2px 0 16px; font-size: 13px;
}
.form-row .check {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-500); font-weight: 500; cursor: pointer;
}
.form-row .check input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue-600); cursor: pointer; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue-600); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.reset-note {
  font-size: 13.5px; color: var(--text-500); background: var(--grad-brand-soft);
  border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; margin-bottom: 16px;
}
.reset-note b { color: var(--navy-900); }

/* ---------- country picker ---------- */
.country-picker { position: relative; }
.cp-box { position: relative; display: flex; align-items: center; }
.cp-box .cp-flag {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 17px; line-height: 1; pointer-events: none; display: none;
}
.cp-box .cp-flag.show { display: block; }
.cp-box .cp-input { padding-left: 14px; }
.cp-box .cp-input.has-flag { padding-left: 40px; }
.cp-box .cp-input.cp-has-clear { padding-right: 34px; }
.cp-box .cp-clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: #e8eef7; color: var(--text-500); font-size: 11px; line-height: 1;
  display: grid; place-items: center;
}
.cp-clear:hover { background: var(--danger-bg); color: var(--danger); }
.cp-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 30;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 216px; overflow: auto;
  padding: 6px; margin: 0; list-style: none;
}
.cp-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--text-700);
}
.cp-list li .f { font-size: 17px; line-height: 1; }
.cp-list li:hover, .cp-list li.hl { background: #f0f6ff; color: var(--blue-600); }
.cp-list .cp-empty { color: var(--text-400); justify-content: center; cursor: default; }
.cp-list .cp-empty:hover { background: none; color: var(--text-400); }

/* ---------- compact, phone-friendly auth modal ---------- */
.modal { max-width: 402px; }
.modal-head { padding: 18px 20px 16px; }
.modal-head h3 { font-size: 21px; }
.modal-head p { font-size: 12px; margin-top: 3px; }
.modal-close { top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; }
.modal-body { padding: 16px 18px 20px; }
.tabs { margin-bottom: 14px; padding: 3px; border-radius: 10px; }
.tab { padding: 8px 10px; font-size: 13px; }
.field { gap: 4px; margin-bottom: 11px; }
.field label { font-size: 11.5px; }
.field .hint { font-size: 11px; }
.input { padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.form-note { margin-top: 10px; font-size: 11.5px; }
.form-error { padding: 8px 11px; font-size: 12px; border-radius: 9px; margin-bottom: 11px; }
.form-row { margin: -1px 0 11px; font-size: 12px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reset-note { padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px; }
.cp-box .cp-flag { font-size: 14px; left: 11px; }
.cp-box .cp-input.has-flag { padding-left: 31px; }
.cp-list { max-height: 176px; }
.cp-list li { padding: 7px 9px; font-size: 13px; }
.cp-list li .f { font-size: 14px; }

/* profile modal password reveal */
.pass-box { position: relative; }
.pass-box .input { padding-right: 46px; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; background: none; color: var(--text-400);
  display: grid; place-items: center; border-radius: 9px; transition: all .15s;
}
.pass-toggle:hover { color: var(--blue-600); background: var(--surface-2); }
.pass-toggle svg { width: 18px; height: 18px; }

/* bell "mark all read" + chat "clear" small controls */
.bell-head { gap: 8px; }
.bell-head-actions { display: flex; align-items: center; gap: 2px; }
.link-btn.sm { font-size: 11px; }
.chat-mini {
  margin-left: auto; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1);
  color: #fff; font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  transition: background .15s;
}
.chat-mini:hover { background: rgba(255, 255, 255, 0.2); }
.chat-head .chat-close { margin-left: 0; }

@media (max-width: 480px) {
  .modal-body { padding: 14px 14px 18px; }
  .row-2 { grid-template-columns: 1fr; gap: 0; }
  .chat-panel { right: 12px; left: 12px; width: auto; height: min(560px, calc(100vh - 150px)); }
  .chat-launcher { right: 16px; bottom: 16px; }
}
