/**
 * WOSC global visual theme — matches Tools hub (ice gradients, depth, cards).
 * Loaded sitewide via nginx after wosc-universal.css. Pages keep their markup;
 * we harmonize typography, .top headers, .card panels, tables, inputs.
 */

:root {
  --wosc-theme-ice: #7dd3fc;
  --wosc-theme-ice2: #38bdf8;
  --wosc-theme-text: #eef5ff;
  --wosc-theme-muted: #94a8c8;
  --wosc-theme-glow: rgba(56, 189, 248, 0.14);
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Legacy calculator / guide headers (.top) */
.top {
  backdrop-filter: blur(20px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.25) !important;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
  border-bottom-color: rgba(125, 211, 252, 0.16) !important;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.top .pill:not(.cta) {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.top .pill:not(.cta):hover {
  border-color: rgba(125, 211, 252, 0.38) !important;
  background: rgba(125, 211, 252, 0.1) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.12);
}

.top .pill.cta {
  box-shadow: 0 0 28px rgba(125, 211, 252, 0.2);
}

.top .pill.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(125, 211, 252, 0.35);
}

/* Standard content cards (calculators, guides) — not tool-hub grid cards */
.card:not(.tool-card) {
  background: linear-gradient(165deg, rgba(18, 28, 48, 0.9), rgba(8, 12, 22, 0.97)) !important;
  border: 1px solid rgba(125, 211, 252, 0.14) !important;
  border-radius: 16px !important;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.card:not(.tool-card):hover {
  border-color: rgba(125, 211, 252, 0.28) !important;
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.42),
    0 0 40px var(--wosc-theme-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Tables inside tool pages */
.card:not(.tool-card) table th {
  color: var(--wosc-theme-ice);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card:not(.tool-card) table tr:hover td {
  background: rgba(56, 189, 248, 0.06);
}

/* Inputs in dark tool UIs */
.card:not(.tool-card) input,
.card:not(.tool-card) select,
.card:not(.tool-card) textarea,
.wrap input:not([type="checkbox"]):not([type="radio"]),
.wrap select,
.wrap textarea {
  border-radius: 10px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wrap input:focus-visible,
.wrap select:focus-visible,
.wrap textarea:focus-visible,
.card:not(.tool-card) input:focus-visible,
.card:not(.tool-card) select:focus-visible {
  outline: none;
  border-color: rgba(125, 211, 252, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

/* Fixed .bg layer (tools hub + many guides) */
.bg {
  background:
    radial-gradient(ellipse 100% 80% at 10% -10%, rgba(56, 189, 248, 0.24), transparent 55%),
    radial-gradient(ellipse 80% 60% at 95% 10%, rgba(125, 211, 252, 0.14), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(14, 165, 233, 0.1), transparent 45%),
    linear-gradient(180deg, #03060d, #0a1020 42%, #060b14) !important;
}

/* Chrome header (wosc-chrome pages) */
.woscTop {
  box-shadow: 0 6px 36px rgba(0, 0, 0, 0.35);
}

.woscPill:not(.woscPillCta) {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.woscPill:not(.woscPillCta):hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.35);
}

/* Footer links */
footer a {
  transition: color 0.15s ease, text-underline-offset 0.15s ease;
}

footer a:hover {
  color: var(--wosc-theme-ice) !important;
}

@media (prefers-reduced-motion: reduce) {
  .top .pill,
  .woscPill,
  .card:not(.tool-card) {
    transition: none !important;
  }
  .top .pill:hover,
  .woscPill:hover {
    transform: none !important;
  }
}

/* === Floating BrosBot / Shelty (injected by wosc-chrome.js) === */
#wosc-brosbot-widget {
  position: fixed;
  z-index: 2147482600;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
}

#wosc-brosbot-widget > * {
  pointer-events: auto;
}

#wosc-brosbot-bubble {
  max-width: 260px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(8, 12, 22, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #c5d4eb;
  font-size: 0.86rem;
  line-height: 1.45;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#wosc-brosbot-bubble.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#wosc-brosbot-bubble strong {
  color: #eef5ff;
}

#wosc-brosbot-trigger {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  transition: transform 0.2s ease;
}

#wosc-brosbot-trigger:hover {
  transform: scale(1.06);
}

#wosc-brosbot-trigger:focus-visible {
  outline: 3px solid var(--wosc-theme-ice2);
  outline-offset: 3px;
}

#wosc-brosbot-trigger img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(56, 189, 248, 0.35));
  border-radius: 50%;
}

#wosc-brosbot-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.45);
  animation: woscBrosbotPulse 2.8s ease-out infinite;
  pointer-events: none;
}

@keyframes woscBrosbotPulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #wosc-brosbot-pulse {
    animation: none;
    opacity: 0.25;
  }
}
