/* URL Masking — Custom Styles */

:root {
  --brand: #4f46e5;
  --brand-light: #ede9fe;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f8f9fa;
}

/* Hero */
.hero-section {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
}
.hero-section p.lead { color: rgba(255,255,255,.85); }
.hero-section .card { background: #fff; color: #212529; }

/* Navbar */
.navbar-dark.bg-primary { background: var(--brand) !important; }

/* Cards */
.card { transition: box-shadow .15s ease; }
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08) !important; }

/* Sidebar */
.sidebar .nav-link {
  color: #495057;
  border-radius: .5rem;
  padding: .45rem .75rem;
  font-size: .92rem;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
  background: #e9ecef;
  color: var(--brand);
}
.sidebar .nav-link.active { font-weight: 600; }

/* Tables */
.table > :not(caption) > * > * { padding: .65rem .75rem; }

/* Monospace slugs */
.font-monospace { font-size: .88rem; letter-spacing: -.01em; }

/* Badge tweaks */
.badge { font-weight: 500; letter-spacing: .02em; }

/* Buttons */
.btn { font-weight: 500; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: #4338ca; border-color: #4338ca; }

/* Form controls */
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(79,70,229,.2);
}

/* Rounded cards */
.rounded-4 { border-radius: 1rem !important; }

/* Progress bars in analytics */
.progress { border-radius: 99px; background: #e9ecef; }
.progress-bar { background: var(--brand); border-radius: 99px; }

/* Code blocks */
code {
  background: var(--brand-light);
  color: var(--brand);
  padding: .15em .35em;
  border-radius: .3em;
  font-size: .88em;
}

/* Copy button feedback */
.copied-flash { animation: flashGreen .6s forwards; }
@keyframes flashGreen {
  0%   { background: #d1fae5; border-color: #059669; }
  100% { background: ''; border-color: ''; }
}

/* Alert flash bar */
.alert.m-0.rounded-0 { border-left: none; border-right: none; border-radius: 0 !important; }

/* Footer */
footer { font-size: .88rem; }

/* ── Admin — Widget icon-picker grid ────────────────────────── */
.icon-card {
  border: 2px solid #dee2e6 !important;
  transition: border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
}
.icon-card:hover {
  border-color: var(--brand) !important;
  background: var(--brand-light);
}
.icon-card-selected {
  border-color: var(--brand) !important;
  background: var(--brand-light) !important;
  box-shadow: 0 0 0 .15rem rgba(79,70,229,.25);
}
.icon-card-selected .icon-card-icon,
.icon-card-selected small {
  color: var(--brand) !important;
}

/* ── Floating Support Widget ─────────────────────────────────── */
.floating-widget {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.floating-widget-phone {
  pointer-events: auto;
  background: var(--brand, #4f46e5);
  color: #fff;
  padding: 12px 22px;
  border-radius: 50px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  box-shadow: 0 6px 20px rgba(79,70,229,.4);
  min-width: 190px;
  max-width: 260px;
  animation: widgetSlideIn .4s ease both;
}

.floating-widget-label {
  font-size: .68rem;
  opacity: .82;
  text-transform: uppercase;
  letter-spacing: .1em;
  white-space: nowrap;
  font-weight: 600;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.floating-widget-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: .02em;
  line-height: 1.15;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  text-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.floating-widget-number:hover { color: #fff; text-decoration: underline; }

.floating-widget-btn {
  pointer-events: auto;
  width: 68px;
  height: 68px;
  background: var(--brand, #4f46e5);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(79,70,229,.5);
  cursor: pointer;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: widgetSlideIn .4s ease .1s both;
  flex-shrink: 0;
}
.floating-widget-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(79,70,229,.6);
}
.floating-widget-btn:active { transform: scale(.95); }

.floating-widget-icon {
  font-size: 1.75rem;
  color: #fff;
  pointer-events: none;
}

.floating-widget-logo {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  pointer-events: none;
}

@keyframes widgetSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Tablet */
@media (max-width: 992px) {
  .floating-widget-number { font-size: 1.2rem; }
  .floating-widget-phone  { min-width: 170px; padding: 11px 18px; }
}

/* Mobile */
@media (max-width: 576px) {
  .floating-widget        { right: 10px; gap: 8px; }
  .floating-widget-btn    { width: 54px; height: 54px; }
  .floating-widget-icon   { font-size: 1.45rem; }
  .floating-widget-phone  { padding: 9px 15px; min-width: 150px; max-width: 200px; }
  .floating-widget-number { font-size: 1.05rem; }
  .floating-widget-label  { font-size: .6rem; }
  .floating-widget-logo   { width: 24px; height: 24px; top: -5px; right: -5px; }
}

/* ── Site Popup ──────────────────────────────────────────────────── */
.site-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: popupFadeIn .3s ease both;
}

.site-popup-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  position: relative;
  text-align: center;
  animation: popupSlideUp .35s ease both;
}

.site-popup-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  border: 3px solid #f0f0f0;
}

.site-popup-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: #1a1a2e;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.site-popup-text {
  color: #555;
  font-size: .97rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.site-popup-cta {
  display: inline-block;
  background: var(--brand, #4f46e5);
  color: #fff;
  padding: .8rem 2.25rem;
  border-radius: 50px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.site-popup-cta:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, .45);
}

.site-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 4px 8px;
  transition: color .15s;
}
.site-popup-close:hover { color: #333; }

@keyframes popupFadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes popupSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(.95) }
  to   { opacity: 1; transform: none }
}

@media (max-width: 480px) {
  .site-popup-card    { padding: 1.5rem; border-radius: .875rem; }
  .site-popup-heading { font-size: 1.25rem; }
  .site-popup-cta     { padding: .65rem 1.5rem; font-size: .9rem; }
}

/* ── Floating Login Widget ───────────────────────────────────────── */
.slw-wrap {
  position: fixed;
  z-index: 9998;
  width: 270px;
  animation: slwSlideIn .4s ease both;
}
@keyframes slwSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* Desktop positions */
.slw-wrap[data-pos="top-left"]      { top: 20px;    left: 20px; }
.slw-wrap[data-pos="top-center"]    { top: 20px;    left: 50%; transform: translateX(-50%); }
.slw-wrap[data-pos="top-right"]     { top: 20px;    right: 20px; }
.slw-wrap[data-pos="center-left"]   { top: 50%;     left: 20px; transform: translateY(-50%); }
.slw-wrap[data-pos="center"]        { top: 50%;     left: 50%;  transform: translate(-50%, -50%); }
.slw-wrap[data-pos="center-right"]  { top: 50%;     right: 20px; transform: translateY(-50%); }
.slw-wrap[data-pos="bottom-left"]   { bottom: 20px; left: 20px; }
.slw-wrap[data-pos="bottom-center"] { bottom: 20px; left: 50%; transform: translateX(-50%); }
.slw-wrap[data-pos="bottom-right"]  { bottom: 20px; right: 20px; }

.slw-card {
  border-radius: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.slw-heading {
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: .85rem;
  color: #333;
}
.slw-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6c757d;
  margin-bottom: .25rem;
}
.slw-input {
  width: 100%;
  padding: .5rem .7rem;
  border: 1.5px solid #dee2e6;
  border-radius: .5rem;
  font-size: .88rem;
  font-family: inherit;
  margin-bottom: .65rem;
  background: #f8f9fa;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.slw-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 .18rem rgba(79, 70, 229, .2);
  background: #fff;
}
.slw-btn {
  width: 100%;
  padding: .55rem 1rem;
  border: none;
  border-radius: .5rem;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.slw-btn:hover  { opacity: .88; transform: translateY(-1px); }
.slw-btn:active { transform: scale(.97); }
.slw-msg {
  display: none;
  margin-top: .6rem;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.45;
  padding: .4rem .6rem;
  border-radius: .4rem;
  background: rgba(0,0,0,.04);
}

/* Mobile position overrides — applied via data-mob attribute at ≤576 px */
@media (max-width: 576px) {
  .slw-wrap { width: 240px; }
  .slw-wrap[data-mob="top-left"]      { top: 12px !important;    right: auto !important; bottom: auto !important; left: 12px !important;  transform: none !important; }
  .slw-wrap[data-mob="top-center"]    { top: 12px !important;    right: auto !important; bottom: auto !important; left: 50% !important;   transform: translateX(-50%) !important; }
  .slw-wrap[data-mob="top-right"]     { top: 12px !important;    left:  auto !important; bottom: auto !important; right: 12px !important;  transform: none !important; }
  .slw-wrap[data-mob="center-left"]   { top: 50% !important;     right: auto !important; bottom: auto !important; left: 12px !important;   transform: translateY(-50%) !important; }
  .slw-wrap[data-mob="center"]        { top: 50% !important;     right: auto !important; bottom: auto !important; left: 50% !important;    transform: translate(-50%,-50%) !important; }
  .slw-wrap[data-mob="center-right"]  { top: 50% !important;     left:  auto !important; bottom: auto !important; right: 12px !important;  transform: translateY(-50%) !important; }
  .slw-wrap[data-mob="bottom-left"]   { bottom: 12px !important; right: auto !important; top: auto !important;   left: 12px !important;   transform: none !important; }
  .slw-wrap[data-mob="bottom-center"] { bottom: 12px !important; right: auto !important; top: auto !important;   left: 50% !important;    transform: translateX(-50%) !important; }
  .slw-wrap[data-mob="bottom-right"]  { bottom: 12px !important; left:  auto !important; top: auto !important;   right: 12px !important;  transform: none !important; }
}
