/* TV4ONE Smart Popups Pro v1.0.0 */

/* ── Base Popup ─────────────────────────────────────────────────────────── */
.tv4one-popup {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tv4one-popup.active {
  opacity: 1;
  visibility: visible;
}

.tv4one-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  cursor: pointer;
}

.tv4one-popup-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.85) translateY(24px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tv4one-popup.active .tv4one-popup-content {
  transform: scale(1) translateY(0);
}

.tv4one-popup-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.tv4one-popup-close:hover { background: rgba(0, 0, 0, 0.15); color: #111; }

/* ── Popup Header ───────────────────────────────────────────────────────── */
.tv4one-popup-header {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  padding: 28px 24px 20px;
  text-align: center;
  border-radius: 16px 16px 0 0;
}

.tv4one-popup-exit-content .tv4one-popup-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.tv4one-popup-scroll-content .tv4one-popup-header {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
}

.tv4one-popup-idle-content .tv4one-popup-header {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

.tv4one-popup-header h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 20px;
  line-height: 1.3;
}

.tv4one-popup-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  margin: 0;
}

/* ── Step System ────────────────────────────────────────────────────────── */
.tv4one-popup-step {
  display: none;
}

.tv4one-popup-step.active {
  display: block;
}

/* ── Urgency Bar ────────────────────────────────────────────────────────── */
.tv4one-urgency-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #e53e3e;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  text-align: center;
  flex-wrap: wrap;
}

.tv4one-urgency-timer { white-space: nowrap; }
.tv4one-urgency-scarcity { white-space: nowrap; }

/* ── Spin Form (Exit Popup) ─────────────────────────────────────────────── */
.tv4one-spin-form {
  padding: 20px 24px 4px;
}

.tv4one-form-group {
  position: relative;
  margin-bottom: 12px;
}

.tv4one-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 6px;
}

.tv4one-form-group input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.tv4one-form-group input[type="email"]:focus { border-color: #0066cc; }

.tv4one-form-group input[type="email"].tv4one-shake {
  animation: inputShake 0.5s;
  border-color: #e53e3e;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.tv4one-email-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tv4one-email-suggestion {
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
  color: #2d3748;
  transition: background 0.15s;
}

.tv4one-email-suggestion:hover { background: #f0f7ff; color: #0066cc; }

.tv4one-popup-disclaimer {
  text-align: center;
  font-size: 12px;
  color: #a0aec0;
  padding: 8px 0 4px;
  margin: 0;
}

/* ── Prizes Preview ─────────────────────────────────────────────────────── */
.tv4one-prizes-preview {
  padding: 16px 24px 20px;
}

.tv4one-prizes-preview h3 {
  font-size: 15px;
  color: #2d3748;
  margin: 0 0 10px;
}

.tv4one-prizes-preview ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tv4one-prizes-preview li {
  font-size: 13px;
  color: #4a5568;
  background: #f7fafc;
  border-radius: 6px;
  padding: 7px 10px;
}

/* ── Wheel ──────────────────────────────────────────────────────────────── */
.tv4one-step-spinning .tv4one-popup-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.tv4one-wheel-container {
  position: relative;
  width: 300px;
  margin: 20px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv4one-wheel-pointer {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  color: #ffd700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  z-index: 2;
  line-height: 1;
}

#tv4one-wheel-canvas {
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  display: block;
  max-width: 100%;
  height: auto;
}

.tv4one-spinning-text {
  text-align: center;
  font-size: 15px;
  color: #4a5568;
  padding: 0 20px 24px;
  margin: 0;
  font-weight: 600;
}

/* ── Result Step ────────────────────────────────────────────────────────── */
.tv4one-result-content {
  padding: 20px 24px 8px;
}

.tv4one-trial-credentials {
  background: #f8f9fa;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.tv4one-credential {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.tv4one-credential:last-child { border-bottom: none; }

.tv4one-credential strong { color: #4a5568; }

.tv4one-credential span {
  font-family: monospace;
  color: #0066cc;
  font-size: 13px;
  word-break: break-all;
}

.tv4one-discount-code {
  text-align: center;
  margin-bottom: 12px;
}

.tv4one-code-box {
  display: inline-block;
  background: #f0f7ff;
  border: 2px dashed #0066cc;
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 24px;
  font-weight: 900;
  color: #0066cc;
  letter-spacing: 4px;
  font-family: monospace;
}

.tv4one-result-actions {
  padding: 0 24px 12px;
  text-align: center;
}

.tv4one-result-footer {
  text-align: center;
  font-size: 12px;
  color: #a0aec0;
  padding: 0 24px 20px;
  margin: 0;
}

/* ── Scroll Popup ───────────────────────────────────────────────────────── */
.tv4one-scroll-features {
  padding: 16px 24px 4px;
}

.tv4one-scroll-features ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tv4one-scroll-features li {
  font-size: 14px;
  color: #2d3748;
  padding: 5px 0;
}

.tv4one-scroll-form {
  padding: 14px 24px 8px;
}

.tv4one-scroll-form .tv4one-form-group { margin-bottom: 10px; }

.tv4one-scroll-social-proof {
  text-align: center;
  font-size: 13px;
  color: #e53e3e;
  padding: 4px 24px 12px;
  font-weight: 600;
}

/* ── Idle Popup ─────────────────────────────────────────────────────────── */
.tv4one-idle-features {
  padding: 16px 24px 4px;
}

.tv4one-idle-features ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tv4one-idle-features li {
  font-size: 14px;
  color: #2d3748;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.tv4one-idle-features li:last-child { border-bottom: none; }

.tv4one-idle-actions {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.tv4one-btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.4);
  transition: all 0.2s;
  box-sizing: border-box;
}

.tv4one-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 102, 204, 0.5); color: #fff; }

.tv4one-btn-spin {
  background: linear-gradient(135deg, #ffd700 0%, #f0a500 100%);
  color: #1a1a00;
  box-shadow: 0 4px 16px rgba(240, 165, 0, 0.5);
  animation: spinGlow 2s ease infinite;
}

.tv4one-btn-spin:hover { box-shadow: 0 8px 28px rgba(240, 165, 0, 0.7); color: #1a1a00; }

@keyframes spinGlow {
  0%, 100% { box-shadow: 0 4px 16px rgba(240, 165, 0, 0.5); }
  50%       { box-shadow: 0 4px 28px rgba(240, 165, 0, 0.8); }
}

.tv4one-btn-secondary {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  color: #a0aec0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

.tv4one-btn-secondary:hover { color: #4a5568; border-color: #cbd5e0; background: #f7fafc; }

/* Result CTA (green) */
#tv4one-result-cta {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(135deg, #00aa44 0%, #008833 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(0, 170, 68, 0.4);
  transition: all 0.2s;
}

#tv4one-result-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 170, 68, 0.5); color: #fff; }

/* Scroll dismiss / idle dismiss (secondary inside form area) */
.tv4one-scroll-dismiss,
.tv4one-idle-dismiss {
  margin-top: 4px;
}

/* ── Confetti ────────────────────────────────────────────────────────────── */
.tv4one-confetti-piece {
  position: fixed;
  top: -10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 10000000;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .tv4one-popup { padding: 0; align-items: flex-end; }
  .tv4one-popup-content { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 88vh; }
  .tv4one-popup-header h2 { font-size: 17px; }
  .tv4one-prizes-preview ul { grid-template-columns: 1fr; }
  .tv4one-wheel-container { width: 260px; }
  #tv4one-wheel-canvas { width: 260px; height: 260px; }
}
