/* Frontend styles for Spinning Wheel */
:root { --sw-primary: #0d6efd; --sw-bg: #f8f9fa; --sw-text: #212529; }
body.sw-fullscreen-page { 
  background: radial-gradient(1200px 400px at 50% -100px, rgba(13,110,253,.12), rgba(13,110,253,0) 60%), linear-gradient(180deg, #ffffff, #ffffff);
  font-family: 'YekanBakh', sans-serif !important; 
  min-height: 100vh;
}
body.page-id-195 main#wp--skip-link--target {
    margin: 0 !important;
}
body.page-id-195 .wp-block-group.alignfull.has-global-padding.is-layout-constrained.wp-block-group-is-layout-constrained {
    padding: 0 !important;
}
body.page-id-195 .has-global-padding > .alignfull {
    margin: 0 !important;
    justify-items: center !important;
    padding: 0 !important;
}

body.page-id-195 .wp-block-group.alignfull.is-layout-flow.wp-block-group-is-layout-flow {
  display: none !important;
}

body.page-id-195 footer.wp-block-template-part {
  display: none !important;
}

.sw-container { min-height: 100vh; align-items: center; justify-content: center; padding: 0 !important; }
.sw-container, .sw-container * { font-family: 'YekanBakh', sans-serif !important; }
.sw-container .row { --bs-gutter-x: 0; --bs-gutter-y: 0; margin: 0; width: 100%; }
.sw-container .row > * { padding: 0 !important; }
.sw-card { border-radius: 16px; background: transparent !important; box-shadow: none !important; border: 0 !important; margin-bottom: 20px !important; }
.sw-card .card-body { padding: 0 !important; background: transparent !important; }

/* Decorative dots layer (behind content) */
.sw-decor-layer { 
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; 
  /* tiny neat dotted pattern, subtle */
  background-image: 
    radial-gradient(circle, rgba(13,110,253,0.10) 1px, transparent 1.6px),
    radial-gradient(circle, rgba(13,110,253,0.06) 1px, transparent 1.6px);
  background-size: 26px 26px, 26px 26px;
  background-position: 0 0, 13px 13px; /* create a neat diagonal dot grid */
}
/* legacy icon rules no longer used */
.sw-decor-icon, .sw-decor-icon.small { display: none !important; }


/* Hero section (full-width) */
.sw-hero-full { width: 100%; background: transparent; padding: 24px 0; position: relative; z-index: 1; }
.sw-hero { direction: rtl; text-align: right; }
.sw-hero-title, .sw-hero-subtitle { font-weight: 600; font-size: 20px; color: #0d6efd; }
.sw-hero-text ul { list-style: none; margin: 0; padding: 0; }
.sw-hero-text li { position: relative; padding-right: 1.4rem; margin-bottom: .35rem; line-height: 1.9; }
.sw-hero-text li::before { content: '•'; position: absolute; right: 0; top: 0; color: #0d6efd; font-weight: 900; }
.sw-hero-img { max-height: 350px; width: auto; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(13,110,253,.15)); }
.sw-hero-svg svg { max-width: 100%; height: auto; display: block; }
.sw-hero-placeholder { width: 100%; height: auto; display: block; }
.sw-hero .muted { color: #6c757d; }


.sw-wheel-wrapper { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.sw-pointer { position: relative; margin-bottom: 20px; transform: rotate(180deg); /* reverse direction */ }
.sw-pointer svg { display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.1)); }
.sw-pointer-img { display: block; max-height: 36px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.1)); }

.sw-wheel { position: relative; width: min(92vw, 520px); height: auto; }
.sw-wheel-svg { width: 100%; height: auto; display: block; padding: 3px; }
.sw-seg-label { font-size: 14px; font-weight: 600; }
.sw-wheel-rotor { transition: transform 6s cubic-bezier(0.22, 0.61, 0.36, 1); transform-origin: 50% 50%; transform-box: fill-box; will-change: transform; }

/* Decorative bulbs ring */
.sw-bulbs { position: absolute; inset: 0; pointer-events: none; }
.sw-bulb { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #ffd166; box-shadow: 0 0 8px rgba(255, 209, 102, .9), 0 0 16px rgba(255, 209, 102, .6); transition: opacity .25s ease, filter .25s ease; }
/* Alternation controlled by JS by toggling .phase-a / .phase-b on .sw-bulbs */
.sw-bulbs.phase-a .sw-bulb.even { opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 209, 102, .9)); }
.sw-bulbs.phase-a .sw-bulb.odd  { opacity: .25; filter: none; }
.sw-bulbs.phase-b .sw-bulb.even { opacity: .25; filter: none; }
.sw-bulbs.phase-b .sw-bulb.odd  { opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 209, 102, .9)); }

/* Enhanced spinning animation (SVG only to keep bulbs fixed) */
.sw-wheel-svg.spinning {
  animation: wheelGlow 6s ease-in-out;
  filter: drop-shadow(0 0 20px rgba(13, 110, 253, 0.3));
}

@keyframes wheelGlow {
  0% { 
    filter: drop-shadow(0 0 5px rgba(13, 110, 253, 0.2));
    transform: scale(1);
  }
  25% { 
    filter: drop-shadow(0 0 25px rgba(13, 110, 253, 0.5));
    transform: scale(1.02);
  }
  50% { 
    filter: drop-shadow(0 0 30px rgba(13, 110, 253, 0.6));
    transform: scale(1.03);
  }
  75% { 
    filter: drop-shadow(0 0 25px rgba(13, 110, 253, 0.5));
    transform: scale(1.02);
  }
  100% { 
    filter: drop-shadow(0 0 5px rgba(13, 110, 253, 0.2));
    transform: scale(1);
  }
}

/* Center logo overlay inside wheel */
.sw-center-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 40px 5px #818181a8; }
.sw-center-logo svg, .sw-center-logo img { max-width: 64px; max-height: 64px; width: auto; height: auto; display: block; padding: 7px; }

.sw-form .sw-spin-btn { 
  padding: 12px 24px; 
  font-weight: 700; 
  border-radius: 12px; 
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  height: 48px !important;
  white-space: nowrap; /* keep one line to avoid height change during typing */
}
.px-3 { padding: 0 !important;}
form.sw-form.mt-4 { max-width: 300px; min-width: 300px; margin: auto; min-height: 114px; }
.row.g-2.align-items-center.justify-content-center { min-height: 114px; }

/* Ensure input sits above button, stack on mobile nicely */
.sw-form .form-control { height: 48px; border-radius: 12px; direction: rtl; text-align: right; border: var(--bs-border-width) solid var(--bs-border-color) !important; }
.sw-form .form-control::placeholder { text-align: right; }

.sw-form .sw-spin-btn:not(:disabled):hover { box-shadow: 0 8px 25px rgba(13, 110, 253, 0.3); }

/* removed global fixed width/height for form; handled in mobile breakpoint */

.sw-form .sw-spin-btn:not(:disabled):active { box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4); }

.sw-form .sw-spin-btn:disabled { 
  opacity: .6; 
  cursor: not-allowed; 
  transform: none;
  box-shadow: none;
}

/* While typing, keep full opacity and freeze transitions for stability */
.sw-form .sw-spin-btn.typing,
.sw-form .sw-spin-btn.typing:disabled {
  opacity: 1 !important;
  transition: none !important;
}

/* Ensure NO movement or scaling on click/hover */
.sw-form .sw-spin-btn, 
.sw-form .sw-spin-btn:active, 
.sw-form .sw-spin-btn.clicked { 
  transform: none !important; 
  animation: none !important; 
}
.sw-fade-in { animation: swFadeIn .25s ease forwards; }
.sw-fade-out { animation: swFadeOut .25s ease forwards; }
@keyframes swFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes swFadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-6px); } }
.sw-result { font-weight: 600; }

/* Modern toast (top notification) */
.sw-toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px); z-index: 1060; background: #212529; color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transition: transform .35s ease, opacity .35s ease; direction: rtl; text-align: center; font-weight: 600; }
.sw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sw-toast.error { background: linear-gradient(135deg, #ff4d4f, #d9363e); width: max-content; }
.sw-toast.success { background: linear-gradient(135deg, #2ecc71, #20bf6b); }

/* Phone input wrapper and inline error */
.sw-input-wrap { position: relative; margin-bottom: 10px; }
.sw-input-wrap .sw-input-error, .sw-input-wrap .text-danger { 
  position: absolute;
  top: calc(100% + 1px);
  right: 14px;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  white-space: normal;
}

.sw-input-wrap .text-danger {
  margin-top: -8px !important;
  margin-right: 10px;
  top: auto;
  right: auto;
}

.form-control:focus, .form-control:focus-visible { outline: none; border: none; box-shadow: none;}

/* Phone input validation feedback (custom styles with icons) */
.sw-phone.invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
  background-image: url(../icons/error.svg);
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px 16px;
  padding-left: 36px;
}

.sw-phone.valid {
  border-color: #00B274 !important;
  box-shadow: 0 0 0 3px rgba(0, 178, 116, 0.10);
  background-image: url(../icons/success.svg);
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px 16px;
  padding-left: 36px;
}

/* OTP input group styling */
.sw-action-slot { position: relative; width: 100%; height: 48px; }
.sw-action-slot .sw-spin-btn, .sw-action-slot .sw-otp-wrap { position: absolute; inset: 0; }
.sw-otp-wrap { border: 0; padding: 0; background: transparent; width: 100%; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease; display: block; }
.sw-otp-wrap.show { opacity: 1; visibility: visible; pointer-events: auto; }
.sw-spin-btn.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
/* Match button height exactly */
.sw-otp-wrap .input-group.sw-otp-group .form-control { height: 48px; border-radius: 0px 12px 12px 0px }
.sw-otp-wrap .input-group.sw-otp-group .btn { height: 48px; display: inline-flex; align-items: center; border-radius: 12px 0 0 12px !important; }
.sw-otp-wrap .input-group.sw-otp-group .sw-otp-resend { border-radius: 12px 0 0 12px !important; border: none !important; background: #00969f; color: #fff; }
.sw-otp-wrap .sw-otp { text-align: center; letter-spacing: 2px; font-weight: 700; }
/* Countdown under the input group */
.sw-otp-inline { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 16px; margin-top: 6px; font-size: 12px; }
.sw-otp-wrap .text-danger { position: absolute; margin: 0; width: fit-content; color: #b91c1c !important; font-size: 10px; font-weight: 700; pointer-events: none; white-space: normal; right: 14px; }
.sw-otp-countdown { text-align: left; font-size: 10px; margin: 0; padding: 0; background: transparent !important; border: 0 !important; margin-right: auto; width: fit-content; position: relative; top: 1px; }

/* Loading state for button */
.sw-spin-btn.loading {
  position: relative;
  color: transparent;
}

.sw-spin-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal (win popup) */
.sw-modal { position: fixed; inset: 0; z-index: 1065; display: flex; align-items: center; justify-content: center; }
.sw-modal.d-none { display: none !important; }
.sw-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); opacity: 0; transition: opacity .25s ease; }
.sw-modal-dialog { position: relative; z-index: 1; width: min(92vw, 420px); background: #ffffff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); transform: translateY(20px) scale(.96); opacity: 0; transition: transform .25s ease, opacity .25s ease; direction: rtl; }
.sw-modal .sw-modal-body { padding: 24px; text-align: center; user-select: none !important; }
.sw-modal .sw-modal-title { font-weight: 800; font-size: 22px; margin-bottom: 8px; color: #0d6efd; }
.sw-modal .sw-modal-text { font-size: 16px; margin-bottom: 16px; color: #212529; }
.sw-modal .sw-modal-ok { border-radius: 9999px; padding: 10px 20px; font-weight: 700; }
.sw-modal.open .sw-modal-backdrop { opacity: 1; }
.sw-modal.open .sw-modal-dialog { transform: translateY(0) scale(1); opacity: 1; }
::-webkit-scrollbar {
  width: 0;
}
/* Confetti Layer */
.sw-confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1070; overflow: hidden; }
.sw-confetti { position: absolute; width: 8px; height: 14px; opacity: .9; border-radius: 2px; will-change: transform; }
@keyframes confettiFall {
  0% { transform: translateY(-20%) rotate(0deg); }
  100% { transform: translateY(120vh) rotate(540deg); }
}

/* Top H1 above hero */
.sw-top-h1 {
  background: linear-gradient(45deg, #b8daff, #2668b0);
  border-radius: 15px;
  width: fit-content;
  margin: 15px auto 0;
  padding: 10px 25px;
  font-weight: 600;
  font-size: 25px;
  text-align: center !important;
}

/* Wheel page title styling */
.sw-wheel-title {
  background: linear-gradient(45deg, #E91E63, #E91E63);
  border-radius: 150px;
  width: fit-content;
  margin: 15px auto 0;
  padding: 10px 25px;
  font-weight: 600;
  color: #fff;
  font-size: 20px;
}

/* Mobile refinements */
@media (max-width: 576px) {
  .sw-pointer { margin-bottom: 20px; }
  .sw-center-logo { width: 68px; height: 68px; }
  .sw-center-logo svg, .sw-center-logo img { max-width: 45px; max-height: 45px; }
  .sw-card .card-body { padding: 0 !important; }
  /* Font sizes on mobile */
  .sw-form .form-control, .sw-form .sw-spin-btn { font-size: 13px; }
  /* Hero mobile tweaks */
  .sw-hero-title, .sw-hero-subtitle { font-size: 17px; }
  .sw-hero-img { max-height: 200px; }
  .sw-hero-text li { font-size: 14px;}
  /* Titles mobile font sizes */
  .sw-top-h1 { font-size: 18px; padding: 10px !important; }
  .sw-wheel-title { font-size: 16px; }
}

@media (max-width: 768px) {
  .sw-hero-full { padding: 0 0 24px; }
}

/* Live Results (winners) */
.sw-live-results { 
  border-radius: 14px; 
  padding: 12px 0px; 
  position: relative; 
  z-index: 0; 
}
.sw-live-header { display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.sw-live-title { font-size: 16px; font-weight: 800; color: #0d6efd; margin: 0; text-align: center; width: 100%; }
.sw-live-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sw-live-item { 
  display: grid; 
  grid-template-columns: 1fr auto; 
  gap: 8px; 
  align-items: center; 
  background: linear-gradient(180deg, #ffffff, #fafafa); 
  border: 1px solid #eef2f7; 
  border-radius: 12px; 
  padding: 10px 12px; 
  box-shadow: 0 4px 14px rgba(0,0,0,.04);
  opacity: 0;
  transform: translateY(6px);
  animation: swLiveIn .25s ease forwards;
}
.sw-live-meta { display: flex; flex-direction: column; gap: 2px; }
/* Empty prize style */
.sw-live-prize.empty-prize { color: #ff0000; font-weight: 700; }
.sw-live-phone { font-weight: 800; color: #212529; font-size: 14px; direction: ltr; }
.sw-live-prize { font-weight: 700; color: #00a389; font-size: 13px; }
.sw-live-time { font-weight: 600; color: #6c757d; font-size: 12px; text-align: left; }

@keyframes swLiveIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
  .sw-live-item { grid-template-columns: 1fr; }
  .sw-live-time { text-align: inherit; }
}

/* Fancy Show All button */
.sw-fancy-btn-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.sw-fancy-btn-glow {
  position: absolute; inset: 0; border-radius: 14px; filter: blur(10px);
  background: linear-gradient(90deg, #6366f1, #ec4899, #f59e0b);
  opacity: .6; transition: opacity .2s ease, filter .2s ease;
}
.sw-fancy-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 18px; border-radius: 14px; text-decoration: none !important;
  background: #111827; color: #fff !important; font-weight: 800; font-size: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15); transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  flex-direction: row-reverse;
}
.sw-fancy-btn:hover { background: #1f2937; transform: translateY(-2px); box-shadow: 0 16px 35px rgba(0,0,0,.2); }
.sw-fancy-btn-wrap:hover .sw-fancy-btn-glow { opacity: 1; filter: blur(12px); }
.sw-fancy-btn-icon { stroke: #ffffff; stroke-width: 2; height: 12px; width: 12px; }
.sw-fancy-btn-icon-line { opacity: 0; transition: opacity .2s ease; }
.sw-fancy-btn-icon-arrow { transition: transform .2s ease; }
.sw-fancy-btn:hover .sw-fancy-btn-icon-line { opacity: 1; }
.sw-fancy-btn:hover .sw-fancy-btn-icon-arrow { transform: translateX(3px); }
.sw-fancy-btn:disabled, .sw-fancy-btn.disabled { opacity: .6; pointer-events: none; }