/* =============================================================
   widgets.css  —  SignX modal widget styles
   Load via:  <link rel="stylesheet" href="{% static 'signx/css/widgets.css' %}">
============================================================= */


/* ── Shared overlay backdrop ── */
.widget-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 30, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  animation: overlayFadeIn 0.25s ease;
}
.widget-overlay.is-open { display: flex; }

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ── Shared content shell ── */
.widget-content {
  position: relative;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.35);
  animation: widgetSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
}

@keyframes widgetSlideUp {
  from { transform: translateY(40px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}


/* ── Close button ── */
.close-widget {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #94A3B8;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 2;
}
.close-widget:hover { color: #0F172A; transform: rotate(90deg); }


/* ═══════════════════════════════════
   VIDEO WIDGET
═══════════════════════════════════ */
.widget-content--video {
  max-width: 900px;
  padding: 28px 28px 24px;
}

.widget-video-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 16px;
  padding-right: 36px; /* clearance for close button */
}

.widget-video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16 : 9 */
  height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #0F172A;
}

.widget-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* ═══════════════════════════════════
   TEXT WIDGET
═══════════════════════════════════ */
.widget-content--text {
  max-width: 520px;
  padding: 40px 44px 44px;
  text-align: center;
}

.widget-text-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.widget-text-icon i {
  font-size: 26px;
  background: linear-gradient(135deg, #2563EB, #06B6D4, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.widget-text-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #0F172A;
  margin-bottom: 16px;
}

.widget-text-divider {
  width: 48px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #2563EB, #06B6D4);
  margin: 0 auto 20px;
}

.widget-text-body {
  font-size: 15px;
  color: #475569;
  line-height: 1.8;
}


/* ═══════════════════════════════════
   SOLUTIONS ACTION ITEMS (shared)
═══════════════════════════════════ */
.sol-action-item {
  cursor: pointer;
}

.sol-action-item:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 4px;
  border-radius: 8px;
}

.sol-header-sub {
  font-size: 17px;
  color: #64748B;
  margin-top: 14px;
}
/* ============================================================
   SIGN LANGUAGE WIDGET
   Floating corner button + popup panel
============================================================ */

/* ── Trigger Button ─────────────────────────────────────── */
.slw-trigger {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9000;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.38);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.22s ease;
  outline: none;
}

.slw-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.50);
}

.slw-trigger:active {
  transform: scale(0.96);
}

.slw-trigger svg {
  width: 30px;
  height: 30px;
  fill: #fff;
  transition: transform 0.3s ease;
}

.slw-trigger.slw-open svg.slw-icon-hand {
  display: none;
}
.slw-trigger svg.slw-icon-close {
  display: none;
}
.slw-trigger.slw-open svg.slw-icon-close {
  display: block;
}

/* Pulse ring */
.slw-trigger::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.40);
  animation: slwPulse 2.2s ease-out infinite;
}

@keyframes slwPulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.slw-trigger.slw-open::before {
  animation: none;
  opacity: 0;
}

/* ── Panel ──────────────────────────────────────────────── */
.slw-panel {
  position: fixed;
  bottom: 108px;
  right: 32px;
  z-index: 8999;
  width: 320px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(16px);
  border: 1.5px solid rgba(6, 182, 212, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;

  /* hidden state */
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.slw-panel.slw-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Panel Header (logo area) ───────────────────────────── */
.slw-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

.slw-header img.slw-logo {
  height: 36px;
  width: auto;
  display: block;
}

/* fallback text logo if image fails */
.slw-logo-fallback {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.slw-header-text {
  display: flex;
  flex-direction: column;
}

.slw-header-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  line-height: 1.2;
}

.slw-header-sub {
  font-size: 11px;
  color: rgba(6, 182, 212, 0.85);
  margin-top: 2px;
}

/* live indicator dot */
.slw-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #06B6D4;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6);
  animation: slwDotPulse 1.8s ease-out infinite;
}

@keyframes slwDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

/* ── Video area ─────────────────────────────────────────── */
.slw-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #060e1e;
  overflow: hidden;
}

.slw-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* idle / no-hover state overlay */
.slw-idle-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(6, 14, 30, 0.72);
  transition: opacity 0.3s ease;
}

.slw-idle-overlay.slw-hidden {
  opacity: 0;
  pointer-events: none;
}

.slw-idle-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.18);
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slw-idle-icon svg {
  width: 24px;
  height: 24px;
  fill: rgba(255,255,255,0.7);
}

.slw-idle-text {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  text-align: center;
  max-width: 180px;
  line-height: 1.5;
}

/* ── Caption bar ────────────────────────────────────────── */
.slw-caption {
  padding: 12px 18px 16px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.slw-caption-label {
  font-size: 11px;
  color: rgba(6, 182, 212, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.slw-caption-text {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
  font-style: italic;
  transition: opacity 0.3s ease;
}

.slw-caption-text.slw-fade {
  opacity: 0;
}

/* ── RTL support ────────────────────────────────────────── */
[dir="rtl"] .slw-trigger {
  right: auto;
  left: 32px;
}

[dir="rtl"] .slw-panel {
  right: auto;
  left: 32px;
  transform-origin: bottom left;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .slw-trigger {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
  }

  [dir="rtl"] .slw-trigger { right: auto; left: 20px; }

  .slw-panel {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
  }

  [dir="rtl"] .slw-panel { right: auto; left: 12px; }
}


/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (max-width: 600px) {
  .widget-content--video { padding: 20px 16px 16px; }
  .widget-content--text  { padding: 32px 24px 32px; }
  .widget-video-title    { font-size: 15px; }
  .widget-text-title     { font-size: 19px; }
}
