/* ============================================================
   Orixon Widget v1.0 – https://orixon.org/cdn/widget-1.css
   ============================================================ */

/* ── Reset scoped ─────────────────────────────────────────── */
.oxn-widget,
.oxn-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

/* ── Card base — tema dark ────────────────────────────────── */
.oxn-widget {
  --oxn-bg:       #0e1529;
  --oxn-bg-alt:   rgba(255,255,255,0.05);
  --oxn-border:   rgba(255,255,255,0.10);
  --oxn-text:     #ffffff;
  --oxn-muted:    rgba(255,255,255,0.55);
  --oxn-accent:   #5865f2;
  --oxn-accent-h: #4752c4;
  --oxn-green:    #3ba55c;
  --oxn-font:     -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  display: inline-block;
  width: 300px;
  background: var(--oxn-bg);
  border: 1px solid var(--oxn-border);
  border-radius: 14px;
  font-family: var(--oxn-font);
  color: var(--oxn-text);
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  position: relative;
  transition: box-shadow .2s ease;
  /* NO overflow:hidden — il topic si espande liberamente */
}
.oxn-widget:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.oxn-widget[data-fullwidth] {
  width: 100%;
  display: block;
}

/* ── Tema light ───────────────────────────────────────────── */
.oxn-widget[data-theme="light"] {
  --oxn-bg:     #ffffff;
  --oxn-bg-alt: rgba(0,0,0,0.04);
  --oxn-border: rgba(0,0,0,0.10);
  --oxn-text:   #0d1117;
  --oxn-muted:  rgba(0,0,0,0.50);
  --oxn-green:  #16a34a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.oxn-widget[data-theme="light"]:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}

/* ── Tema minimal — playful ───────────────────────────────── */
.oxn-widget[data-theme="minimal"] {
  --oxn-accent:   #6366f1;
  --oxn-accent-h: #4f46e5;
  --oxn-green:    #10b981;
  background: #ffffff !important;
  border: none !important;
  border-radius: 20px !important;
  color: #1a1033 !important;
  box-shadow:
    0 0 0 3px #6366f1,
    0 12px 32px rgba(99,102,241,0.18) !important;
}
.oxn-widget[data-theme="minimal"]:hover {
  box-shadow:
    0 0 0 3px #a855f7,
    0 16px 40px rgba(168,85,247,0.25) !important;
}

/* ── Header ───────────────────────────────────────────────── */
.oxn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--oxn-border);
  background: var(--oxn-bg);
  border-radius: 14px 14px 0 0;
}
.oxn-widget[data-theme="minimal"] .oxn-header {
  border-bottom-color: #ede9fe;
  border-radius: 20px 20px 0 0;
  background: #ffffff;
}

/* Dot + nome canale */
.oxn-channel-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}
.oxn-channel-name::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--oxn-green);
  box-shadow: 0 0 0 3px rgba(59,165,92,.20);
  animation: oxn-pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes oxn-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(59,165,92,.20); }
  50%       { box-shadow: 0 0 0 5px rgba(59,165,92,.06); }
}
.oxn-widget.oxn-offline .oxn-channel-name::before {
  background: #ed4245;
  box-shadow: none;
  animation: none;
}
/* Minimal: gradient text sul nome canale */
.oxn-widget[data-theme="minimal"] .oxn-channel-name {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 16px;
  font-weight: 800;
}
.oxn-widget[data-theme="minimal"] .oxn-channel-name::before {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.20);
  -webkit-text-fill-color: unset;
}

/* Badge Orixon */
.oxn-badge-orixon {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--oxn-muted);
  text-decoration: none;
  opacity: .65;
  transition: opacity .15s;
  flex-shrink: 0;
}
.oxn-badge-orixon:hover { opacity: 1; }
.oxn-badge-orixon img { width: 14px; height: 14px; display: block; }
.oxn-widget[data-theme="minimal"] .oxn-badge-orixon {
  color: #a78bfa;
  opacity: 1;
}

/* ── Topic — nessun troncamento ───────────────────────────── */
.oxn-topic {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--oxn-muted);
  line-height: 1.55;
  border-bottom: 1px solid var(--oxn-border);
  min-height: 128px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  background: var(--oxn-bg);
}
.oxn-topic:empty { display: none; }
.oxn-widget[data-theme="minimal"] .oxn-topic {
  background: #f5f3ff;
  border-bottom-color: #ede9fe;
  color: #4b5563;
  padding: 10px 18px;
}

/* ── Stats grid ───────────────────────────────────────────── */
.oxn-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--oxn-border);
  border-bottom: 1px solid var(--oxn-border);
}
.oxn-stat {
  background: var(--oxn-bg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.oxn-stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--oxn-text);
}
.oxn-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--oxn-muted);
}
/* Minimal stats */
.oxn-widget[data-theme="minimal"] .oxn-stats {
  background: transparent;
  border-bottom-color: #ede9fe;
}
.oxn-widget[data-theme="minimal"] .oxn-stat {
  background: #ffffff;
  padding: 16px 18px;
}
.oxn-widget[data-theme="minimal"] .oxn-stat-value {
  font-size: 26px;
  font-weight: 900;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.oxn-widget[data-theme="minimal"] .oxn-stat-label { color: #9ca3af; }

/* ── CTA ──────────────────────────────────────────────────── */
.oxn-cta-wrap {
  padding: 14px 16px 16px;
  background: var(--oxn-bg);
}
.oxn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 16px;
  background: var(--oxn-accent);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .12s, box-shadow .15s;
  font-family: var(--oxn-font);
  line-height: 1;
}
.oxn-cta:hover { background: var(--oxn-accent-h); transform: translateY(-1px); }
.oxn-cta:active { transform: none; }
.oxn-cta svg { width: 15px; height: 15px; flex-shrink: 0; }
/* Minimal CTA */
.oxn-widget[data-theme="minimal"] .oxn-cta-wrap {
  background: #ffffff;
  padding: 14px 18px 18px;
}
.oxn-widget[data-theme="minimal"] .oxn-cta {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(99,102,241,.30);
}
.oxn-widget[data-theme="minimal"] .oxn-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,.40);
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

/* ── Footer ───────────────────────────────────────────────── */
.oxn-footer {
  padding: 8px 16px;
  font-size: 10px;
  color: var(--oxn-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--oxn-border);
  background: var(--oxn-bg);
  opacity: .65;
}
.oxn-widget[data-theme="minimal"] .oxn-footer {
  border-top-color: #ede9fe;
  background: #ffffff;
  color: #9ca3af;
}

/* ── Skeleton ─────────────────────────────────────────────── */
.oxn-skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06) 25%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: oxn-shimmer 1.5s infinite;
  border-radius: 4px;
  height: 1em;
}
@keyframes oxn-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Error ────────────────────────────────────────────────── */
.oxn-error {
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--oxn-muted);
  line-height: 1.55;
  background: var(--oxn-bg);
}
.oxn-error strong { color: var(--oxn-text); display: block; margin-bottom: 4px; }

/* ── Count bump ───────────────────────────────────────────── */
.oxn-count-anim {
  display: inline-block;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.oxn-count-anim.oxn-bump { transform: scale(1.25); }