/*
 * wagering-calculator.css
 * SPINLYTICS — Bonus Snapshot Widget
 * Caricato async dopo style.css
 *
 * Struttura:
 * 1. Trigger button (dentro la partner-card)
 * 2. Drawer inline (espande dentro la card)
 * 3. Slider personalizzato
 * 4. Output numeri calcolati
 * 5. Share bar
 * 6. Animazioni e reduced-motion
 */

/* ══ 1. TRIGGER ═════════════════════════════════════════════════════ */
.wager-calc-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  font-size: 12px;
  font-weight: 700;
  color: #667eea;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}
.wager-calc-trigger:hover {
  border-color: #667eea;
  background: #f0f4ff;
}
.wager-calc-trigger:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}
.wager-calc-trigger .calc-icon {
  font-size: 15px;
  flex-shrink: 0;
}
.wager-calc-trigger.open {
  border-color: #667eea;
  background: #f0f4ff;
  color: #4338ca;
}
/* Nasconde il trigger desktop quando sidebar è presente */
@media (min-width: 900px) {
  .wager-calc-trigger {
    width: auto;
    font-size: 11px;
    height: 32px;
    padding: 0 10px;
  }
}

/* ══ 2. DRAWER (espande sotto la card) ══════════════════════════════ */
.wager-calc-drawer {
  grid-column: 1 / -1; /* occupa tutta la larghezza della grid della card */
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .35s cubic-bezier(.4,0,.2,1),
              opacity .25s ease,
              padding .3s;
  padding: 0 0;
}
.wager-calc-drawer.open {
  max-height: 520px;
  opacity: 1;
  padding: 14px 0 4px;
}
.wager-calc-inner {
  background: linear-gradient(135deg, #f8faff, #f0f4ff);
  border: 1.5px solid #e0e7ff;
  border-radius: 12px;
  padding: 16px;
}

/* ══ 3. HEADER DRAWER ═══════════════════════════════════════════════ */
.calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.calc-header-title {
  font-size: 13px;
  font-weight: 800;
  color: #1a1f36;
  display: flex;
  align-items: center;
  gap: 6px;
}
.calc-header-title .calc-casino-name {
  color: #667eea;
}
.calc-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #5e6c84;
  flex-shrink: 0;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.calc-close-btn:hover { background: rgba(0,0,0,.12); }
.calc-close-btn:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* ══ 4. SLIDER ══════════════════════════════════════════════════════ */
.calc-slider-row {
  margin-bottom: 16px;
}
.calc-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.calc-slider-label span {
  font-size: 12px;
  font-weight: 600;
  color: #5e6c84;
}
.calc-deposit-display {
  font-size: 22px;
  font-weight: 800;
  color: #1a1f36;
  min-width: 80px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color .15s;
}
.calc-deposit-display.highlight { color: #667eea; }

/* Slider custom */
.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #667eea var(--pct,30%), #e2e8f0 var(--pct,30%));
  outline: none;
  cursor: pointer;
  transition: background .1s;
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #667eea;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(102,126,234,.4);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(102,126,234,.55);
}
.calc-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #667eea;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(102,126,234,.4);
  cursor: pointer;
}
.calc-slider:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 4px;
  border-radius: 4px;
}
.calc-slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}
.calc-slider-ticks span {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
}

/* ══ 5. RISULTATI ═══════════════════════════════════════════════════ */
.calc-results {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.calc-result-item {
  background: #fff;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid #e8edf8;
  transition: border-color .2s, transform .15s;
}
.calc-result-item.primary {
  border-color: #c7d2fe;
  background: linear-gradient(135deg, #f5f3ff, #eff6ff);
}
.calc-result-icon { font-size: 16px; margin-bottom: 3px; }
.calc-result-value {
  font-size: 16px;
  font-weight: 800;
  color: #1a1f36;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}
.calc-result-item.primary .calc-result-value { color: #4338ca; }
.calc-result-label {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 3px;
  line-height: 1.2;
}

/* ══ 6. DISCLAIMER ══════════════════════════════════════════════════ */
.calc-disclaimer {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,.7);
  border-radius: 6px;
  border-left: 3px solid #c7d2fe;
}
.calc-disclaimer strong { color: #5e6c84; }

/* ══ 7. SHARE BAR ═══════════════════════════════════════════════════ */
.calc-share-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}
.calc-share-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  flex-shrink: 0;
}
.calc-share-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s, transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.calc-share-btn:hover  { opacity: .88; transform: scale(1.08); }
.calc-share-btn:active { transform: scale(.94); }
.calc-share-btn:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 3px;
}
.calc-share-btn.whatsapp {
  background: #25D366;
  box-shadow: 0 2px 8px rgba(37,211,102,.35);
}
.calc-share-btn.telegram {
  background: #0088cc;
  box-shadow: 0 2px 8px rgba(0,136,204,.35);
}
.calc-share-btn.copy {
  background: #f0f2f8;
  color: #667eea;
}
.calc-share-btn.copy.copied {
  background: #dcfce7;
  color: #16a34a;
}
.calc-share-btn svg { display: block; }

/* ══ 8. CTA diretta dal calcolatore ════════════════════════════════ */
.calc-cta-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8edf8;
}
.calc-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(34,197,94,.35);
  transition: box-shadow .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.calc-cta-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: rgba(255,255,255,.2);
  transform: skewX(-20deg);
  animation: calcShimmer 3s ease-in-out infinite;
}
@keyframes calcShimmer {
  0%,70%,100% { left: -60%; opacity: 0; }
  30%          { left: 120%; opacity: 1; }
}
.calc-cta-btn:hover {
  box-shadow: 0 5px 20px rgba(34,197,94,.5);
  transform: translateY(-1px);
}
.calc-cta-btn:active {
  transform: scale(.98);
  box-shadow: none;
}
.calc-cta-btn:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 3px;
}
.calc-cta-sublabel {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  margin-top: 5px;
}
.calc-cta-sublabel a {
  color: #667eea;
  text-decoration: underline;
}

/* ══ 9. BREAKPOINTS ═════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .calc-results { grid-template-columns: 1fr 1fr; }
  .calc-results .calc-result-item:last-child { grid-column: 1 / -1; }
}
@media (min-width: 640px) {
  .calc-result-value { font-size: 18px; }
}

/* ══ 10. REDUCED MOTION ═════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .wager-calc-drawer {
    transition: max-height .1s, opacity .1s, padding .1s;
  }
  .calc-cta-btn::after { display: none; }
  .calc-slider::-webkit-slider-thumb { transition: none; }
  .calc-deposit-display { transition: none; }
}
