/* WinPromoSuite Public Styles */

/* ── Reset ── */
.ps-widget, .ps-widget * { box-sizing: border-box; margin: 0; padding: 0; }
.ps-widget { font-family: var(--ps-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif); color: var(--ps-fg, #1e1e2e); line-height: 1.5; }

/* ── Overlay ── */
.ps-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 999998; opacity: 0; transition: opacity .3s ease;
}
.ps-widget.ps-visible .ps-overlay { opacity: 1; }

/* ── Panel ── */
.ps-panel {
    position: relative; background: var(--ps-bg, #fff);
    border-radius: 16px; max-width: 520px; width: 92vw;
    box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden;
    transform: scale(.9); opacity: 0;
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s cubic-bezier(.4,0,.2,1);
}
.ps-widget.ps-visible .ps-panel { transform: scale(1); opacity: 1; }

/* ── Close ── */
.ps-close {
    position: absolute; top: 12px; right: 12px; z-index: 10;
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: rgba(0,0,0,.1); color: var(--ps-fg, #333);
    font-size: 20px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: background .2s, transform .2s;
    line-height: 1; backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.ps-close:hover { background: rgba(0,0,0,.2); transform: rotate(90deg); }

/* ── Button ── */
.ps-btn {
    display: inline-block; padding: 10px 24px;
    background: var(--ps-btn, #6366f1); color: #fff !important;
    border: none; border-radius: var(--ps-radius, 6px);
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none !important; text-align: center;
    transition: opacity .2s, transform .15s, box-shadow .2s;
}
.ps-btn:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.3); }

/* Button sizes */
.ps-btn--sm { padding: 6px 14px; font-size: 12px; }
.ps-btn--lg { padding: 14px 32px; font-size: 16px; }

/* Button outline variant */
.ps-btn--outline {
    background: transparent; color: var(--ps-btn, #6366f1) !important;
    border: 2px solid var(--ps-btn, #6366f1);
}
.ps-btn--outline:hover { background: var(--ps-btn, #6366f1); color: #fff !important; }

/* ══════════════════════════════════════
   POPUP
   ══════════════════════════════════════ */
.ps-popup {
    position: fixed; inset: 0; z-index: 999999;
    display: none; align-items: center; justify-content: center;
}
.ps-popup.ps-visible { display: flex; }
.ps-popup.ps-pos-top { align-items: flex-start; padding-top: 5vh; }
.ps-popup.ps-pos-bottom { align-items: flex-end; padding-bottom: 5vh; }
.ps-popup.ps-pos-bl { align-items: flex-end; justify-content: flex-start; padding: 5vh; }
.ps-popup.ps-pos-br { align-items: flex-end; justify-content: flex-end; padding: 5vh; }
.ps-popup.ps-pos-bl .ps-panel,
.ps-popup.ps-pos-br .ps-panel { max-width: 380px; }

.ps-popup__image img { display: block; width: 100%; height: auto; }
.ps-popup__body { padding: 24px; }
.ps-popup__title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.ps-popup__content { font-size: 15px; margin-bottom: 16px; }
.ps-popup__content p { margin-bottom: 8px; }
.ps-popup__cta { text-align: center; }

/* Popup badge (e.g. "LIMITED TIME") */
.ps-popup__badge {
    display: inline-block; padding: 4px 14px;
    font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
    background: var(--ps-btn, #6366f1); color: #fff;
    border-radius: 0 0 8px 8px; position: absolute; top: 0; left: 50%;
    transform: translateX(-50%); z-index: 11;
}

/* Popup animations */
.ps-popup.ps-anim-fade .ps-panel { transform: none; }
.ps-popup.ps-anim-slide .ps-panel { transform: translateY(40px); }
.ps-popup.ps-visible.ps-anim-slide .ps-panel { transform: translateY(0); }

/* Popup open/close transitions (smoother cubic-bezier) */
.ps-popup .ps-panel {
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s cubic-bezier(.4,0,.2,1);
}
.ps-popup .ps-overlay {
    transition: opacity .3s cubic-bezier(.4,0,.2,1);
}

/* Glass-morphism option */
.ps-popup.ps-glass .ps-panel {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(255,255,255,.3);
}
.ps-popup.ps-glass .ps-overlay {
    background: rgba(0,0,0,.35);
}

/* ══════════════════════════════════════
   SLIDER
   ══════════════════════════════════════ */
.ps-slider { position: relative; overflow: hidden; width: 100%; background: var(--ps-bg, #000); }
.ps-slider__track { display: flex; transition: transform .4s ease; width: 100%; }
.ps-slider__slide {
    flex: 0 0 100%; position: relative; min-height: 200px;
    display: none;
}
.ps-slider__slide.ps-active { display: block; }
.ps-slider__img { display: block; width: 100%; height: auto; object-fit: cover; }

/* Constrained slider: explicit height with object-fit cover */
.ps-slider__video { position: relative; padding-bottom: 56.25%; height: 0; }
.ps-slider__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ps-slider__caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 32px 24px; background: linear-gradient(transparent, rgba(0,0,0,.7));
    color: #fff;
}
.ps-slider__caption-title {
    font-size: 24px; font-weight: 700; margin-bottom: 8px;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.ps-slider__caption-desc {
    font-size: 15px; margin-bottom: 12px; opacity: .9;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* Nav buttons (improved) */
.ps-slider__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: rgba(255,255,255,.9); color: #333; font-size: 18px;
    cursor: pointer; z-index: 2; display: flex; align-items: center;
    justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: background .2s, transform .2s, box-shadow .2s;
}
.ps-slider__nav:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.ps-slider__prev { left: 12px; }
.ps-slider__prev:hover { transform: translateY(-50%) translateX(-2px); }
.ps-slider__next { right: 12px; }
.ps-slider__next:hover { transform: translateY(-50%) translateX(2px); }

/* Dots (improved with pill shape for active) */
.ps-slider__dots {
    display: flex; justify-content: center; gap: 6px; padding: 12px 0;
    position: absolute; bottom: 8px; left: 0; right: 0; z-index: 2;
}
.ps-slider__dot {
    width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8);
    background: transparent; cursor: pointer; padding: 0;
    transition: background .3s, width .3s, border-radius .3s;
}
.ps-slider__dot.ps-active {
    background: #fff; width: 24px; border-radius: 5px;
}

/* Ken Burns effect */
.ps-slider.ps-kenburns .ps-slider__slide.ps-active .ps-slider__img {
    animation: ps-kenburns 12s ease-in-out alternate infinite;
}

/* ══════════════════════════════════════
   NOTIFICATION BAR
   ══════════════════════════════════════ */
.ps-notifbar {
    position: fixed; left: 0; right: 0; z-index: 999990;
    display: none; background: var(--ps-bg, #ef4444);
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.ps-notifbar.ps-visible { display: block; }
.ps-notifbar--top { top: 0; }
.ps-notifbar--bottom { bottom: 0; }

/* Animation */
.ps-notifbar.ps-anim-slide { transform: translateY(-100%); transition: transform .3s ease; }
.ps-notifbar--bottom.ps-anim-slide { transform: translateY(100%); }
.ps-notifbar.ps-visible.ps-anim-slide { transform: translateY(0); }
.ps-notifbar.ps-anim-fade { opacity: 0; transition: opacity .3s ease; }
.ps-notifbar.ps-visible.ps-anim-fade { opacity: 1; }

/* Pulse animation for urgency */
.ps-notifbar.ps-pulse { animation: ps-bar-pulse 2s ease-in-out infinite; }

.ps-notifbar__inner {
    max-width: 1200px; margin: 0 auto; padding: 12px 20px;
    display: flex; align-items: center; gap: 16px;
}
.ps-notifbar__logo img { height: 32px; width: auto; display: block; }
.ps-notifbar__content { flex: 1; font-size: 14px; font-weight: 500; }
.ps-notifbar__content strong { font-weight: 700; }
.ps-notifbar__cta { flex-shrink: 0; padding: 6px 16px; font-size: 13px; }
.ps-notifbar__close {
    position: static; width: 28px; height: 28px; flex-shrink: 0;
    background: rgba(255,255,255,.2); font-size: 16px;
}

/* ══════════════════════════════════════
   WHEEL MODAL
   ══════════════════════════════════════ */
.ps-wheel-modal { position: fixed; inset: 0; z-index: 999999; display: none; align-items: center; justify-content: center; }
.ps-wheel-modal.ps-visible { display: flex; }
.ps-wheel-panel { max-width: 480px; text-align: center; padding: 32px; }

.ps-wheel__step { display: none; }
.ps-wheel__step.ps-active { display: block; }
.ps-wheel__title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.ps-wheel__subtitle { font-size: 14px; color: var(--ps-fg); opacity: .7; margin-bottom: 20px; }
.ps-wheel__email-form { margin-bottom: 16px; }
.ps-wheel__email-input {
    width: 100%; padding: 10px 14px; border: 2px solid var(--ps-btn, #6366f1);
    border-radius: 8px; font-size: 15px; text-align: center; outline: none;
}
.ps-wheel__email-input:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.ps-wheel__spin-btn {
    width: 100%; padding: 14px; font-size: 16px;
    animation: ps-glow 2s ease-in-out infinite;
}

.ps-wheel__canvas-wrap { position: relative; margin: 0 auto; width: 320px; height: 320px; }
.ps-wheel__canvas { width: 100%; height: 100%; }

/* Center dot / hub */
.ps-wheel__hub {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--ps-btn, #6366f1); border: 4px solid #fff;
    box-shadow: 0 0 8px rgba(0,0,0,.3); z-index: 3;
}

.ps-wheel__pointer {
    position: absolute; top: 50%; right: -8px; transform: translateY(-50%);
    width: 0; height: 0; border-top: 14px solid transparent;
    border-bottom: 14px solid transparent; border-right: 20px solid var(--ps-btn, #6366f1);
    z-index: 2; filter: drop-shadow(-2px 0 4px rgba(0,0,0,.3));
}

.ps-wheel__result-icon { font-size: 48px; margin-bottom: 12px; }
.ps-wheel__result-message { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.ps-wheel__result-code { margin-top: 12px; }
.ps-wheel__code-value {
    display: inline-block; font-size: 24px; font-weight: 700; letter-spacing: 2px;
    padding: 8px 20px; background: rgba(99,102,241,.1); border-radius: 8px;
    margin-bottom: 12px; color: var(--ps-btn, #6366f1);
}
.ps-wheel__copy-btn { display: block; margin: 8px auto 0; }

/* ══════════════════════════════════════
   SCRATCH CARD MODAL
   ══════════════════════════════════════ */
.ps-scratch-modal { position: fixed; inset: 0; z-index: 999999; display: none; align-items: center; justify-content: center; }
.ps-scratch-modal.ps-visible { display: flex; }
.ps-scratch-panel {
    max-width: 440px; text-align: center; padding: 32px;
    border-radius: 20px;
}

.ps-scratch__step { display: none; }
.ps-scratch__step.ps-active { display: block; }
.ps-scratch__title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.ps-scratch__subtitle { font-size: 14px; opacity: .7; margin-bottom: 16px; }
.ps-scratch__email-form { margin-bottom: 16px; }
.ps-scratch__email-input {
    width: 100%; padding: 10px 14px; border: 2px solid var(--ps-btn, #6366f1);
    border-radius: 8px; font-size: 15px; text-align: center; outline: none;
}
.ps-scratch__start-btn { width: 100%; padding: 12px; }

.ps-scratch__canvas-wrap {
    max-width: 100%;
    position: relative; margin: 0 auto; border-radius: 16px;
    overflow: hidden; cursor: crosshair; touch-action: none;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    border: 2px solid rgba(0,0,0,.06);
}
.ps-scratch__reveal {
    position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; padding: 16px; background: var(--ps-bg, #fff);
    font-size: 15px;
}
.ps-scratch__canvas { position: relative; z-index: 1; display: block; }

.ps-scratch__result-message { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.ps-scratch__result-code { margin-top: 8px; }
.ps-scratch__code-value {
    display: inline-block; font-size: 22px; font-weight: 700; letter-spacing: 2px;
    padding: 8px 20px; background: rgba(99,102,241,.1); border-radius: 8px;
    margin-bottom: 12px; color: var(--ps-btn, #6366f1);
}
.ps-scratch__copy-btn { display: block; margin: 8px auto 0; }

/* ── Confetti (improved with variety) ── */
.ps-confetti {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999999; overflow: hidden;
}
.ps-confetti__piece {
    position: absolute; width: 10px; height: 10px; opacity: 1;
    animation: ps-confetti-fall 2.5s ease-out forwards;
}
/* Circle confetti */
.ps-confetti__piece--circle {
    border-radius: 50%;
}
/* Square confetti (default) */
.ps-confetti__piece--square {
    border-radius: 2px;
}
/* Strip / rectangle confetti */
.ps-confetti__piece--strip {
    width: 4px; height: 14px; border-radius: 2px;
}
@keyframes ps-confetti-fall {
    0% { transform: translateY(-20px) rotate(0deg) scale(1); opacity: 1; }
    50% { opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(.6); opacity: 0; }
}

/* ══════════════════════════════════════
   KEYFRAME ANIMATIONS
   ══════════════════════════════════════ */

/* Ken Burns — subtle zoom + pan */
@keyframes ps-kenburns {
    0%   { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.08) translate(-1.5%, -1%); }
}

/* Notification bar pulse — subtle background brightness shift */
@keyframes ps-bar-pulse {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.15); }
}

/* Button glow pulse */
@keyframes ps-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(99,102,241,.3); }
    50%      { box-shadow: 0 0 20px rgba(99,102,241,.6), 0 0 40px rgba(99,102,241,.2); }
}

/* Attention shake for CTA */
@keyframes ps-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ══════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════ */

/* Text alignment */
.ps-text-center { text-align: center; }
.ps-text-left   { text-align: left; }
.ps-text-right  { text-align: right; }

/* Floating badge */
.ps-badge {
    display: inline-block; padding: 3px 10px;
    font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
    background: var(--ps-btn, #6366f1); color: #fff;
    border-radius: 20px; line-height: 1.4;
    box-shadow: 0 2px 8px rgba(99,102,241,.25);
}

/* Shake utility — add to any element for attention */
.ps-animate-shake { animation: ps-shake .6s ease-in-out; }

/* Glow utility — add to buttons for pulsing glow */
.ps-animate-glow { animation: ps-glow 2s ease-in-out infinite; }

/* ── Responsive ── */

/* ── Tablet (768px) ── */
@media (max-width: 768px) {
    .ps-popup__title { font-size: 20px; }
    .ps-popup__body { padding: 20px; }
    .ps-wheel__canvas-wrap { width: 300px; height: 300px; }
    .ps-slider__caption { padding: 24px 20px; }
    .ps-slider__caption-title { font-size: 20px; }
}

@media (max-width: 600px) {
    .ps-panel { max-width: 95vw; border-radius: 12px; }
    .ps-popup__title { font-size: 18px; }
    .ps-popup__body { padding: 16px; }
    .ps-wheel-panel, .ps-scratch-panel { padding: 20px; }
    .ps-wheel__canvas-wrap { width: 260px; height: 260px; }
    .ps-slider__caption-title { font-size: 18px; }
    .ps-slider__nav { width: 32px; height: 32px; font-size: 14px; }

    /* Notification bar: stack vertically on mobile */
    .ps-notifbar__inner {
        flex-wrap: wrap; justify-content: center; text-align: center;
        gap: 8px; padding: 10px 16px;
    }
    .ps-notifbar__logo { order: 1; width: 100%; text-align: center; }
    .ps-notifbar__logo img { margin: 0 auto; }
    .ps-notifbar__content { order: 2; width: 100%; }
    .ps-notifbar__cta { order: 3; width: 100%; }
    .ps-notifbar__close { order: 4; position: absolute; top: 6px; right: 6px; }
}

/* ── Inline form (for newsletter templates) ── */
.ps-inline-form {
    display: flex; gap: 8px; margin-top: 12px;
}
.ps-inline-form input[type="email"] {
    flex: 1; padding: 10px 14px; border: 2px solid var(--ps-btn, #6366f1);
    border-radius: var(--ps-radius, 6px); font-size: 14px; outline: none;
}
.ps-inline-form button {
    padding: 10px 20px; background: var(--ps-btn, #6366f1); color: #fff;
    border: none; border-radius: var(--ps-radius, 6px); font-weight: 600;
    cursor: pointer;
}

/* ── Inline form mobile stack ── */
@media (max-width: 600px) {
    .ps-inline-form { flex-direction: column; }
    .ps-inline-form button { width: 100%; }
    .ps-popup.ps-pos-bl,
    .ps-popup.ps-pos-br { padding: 2vh 2vw; }
}

/* ── v3.3: Popup Layouts ── */
.ps-popup--layout-image-left .ps-panel{display:flex;flex-direction:row;align-items:stretch}
.ps-popup--layout-image-left .ps-popup__image{flex:0 0 40%;max-width:40%}
.ps-popup--layout-image-left .ps-popup__image img{width:100%;height:100%;object-fit:cover;border-radius:var(--ps-radius) 0 0 var(--ps-radius)}
.ps-popup--layout-image-left .ps-popup__body{flex:1;padding:2rem}
.ps-popup--layout-image-right .ps-panel{display:flex;flex-direction:row-reverse;align-items:stretch}
.ps-popup--layout-image-right .ps-popup__image{flex:0 0 40%;max-width:40%}
.ps-popup--layout-image-right .ps-popup__image img{width:100%;height:100%;object-fit:cover;border-radius:0 var(--ps-radius) var(--ps-radius) 0}
.ps-popup--layout-image-right .ps-popup__body{flex:1;padding:2rem}
.ps-popup--layout-full-image .ps-panel{padding:0;overflow:hidden}
.ps-popup--layout-full-image .ps-popup__image img{width:100%;display:block}
.ps-popup--layout-full-image .ps-popup__body{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(transparent,rgba(0,0,0,.7));color:#fff;padding:2rem}
.ps-popup--layout-text-only .ps-popup__image{display:none}
/* v3.3: Popup Sizes */
.ps-popup--size-small .ps-panel{max-width:360px}
.ps-popup--size-medium .ps-panel{max-width:520px}
.ps-popup--size-large .ps-panel{max-width:720px}
.ps-popup--size-fullscreen .ps-panel{max-width:100%;width:100%;height:100%;border-radius:0;margin:0}
.ps-popup--size-fullscreen .ps-overlay{display:none}
@media(max-width:768px){
    .ps-popup--layout-image-left .ps-panel,.ps-popup--layout-image-right .ps-panel{flex-direction:column}
    .ps-popup--layout-image-left .ps-popup__image,.ps-popup--layout-image-right .ps-popup__image{flex:none;max-width:100%}
    .ps-popup--layout-image-left .ps-popup__image img,.ps-popup--layout-image-right .ps-popup__image img{border-radius:var(--ps-radius) var(--ps-radius) 0 0}
}

/* ── v3.3: Notifbar Gradient ── */
.ps-notifbar--gradient{background:var(--ps-gradient,var(--ps-bg))}

/* ── v3.3: Notifbar Icon ── */
.ps-notifbar__icon{font-size:1.3em;margin-right:.5rem;flex-shrink:0}

/* ── v3.3: Notifbar Countdown ── */
.ps-notifbar__countdown{display:inline-flex;align-items:center;gap:.4rem;margin-left:1rem;font-weight:700;white-space:nowrap}
.ps-notifbar__countdown-label{opacity:.85;font-weight:400}
.ps-notifbar__countdown-timer{font-variant-numeric:tabular-nums;letter-spacing:.04em}

/* ── v3.3: Notifbar Progress Bar ── */
.ps-notifbar__progress{width:100%;height:6px;background:rgba(255,255,255,.2);border-radius:3px;margin-top:.5rem;overflow:hidden}
.ps-notifbar__progress-bar{height:100%;border-radius:3px;transition:width .6s ease}

/* ── v3.3: Notifbar Multiline ── */
.ps-notifbar--multiline .ps-notifbar__inner{flex-wrap:wrap}

/* ── v3.3: Scratch Size Presets ── */
.ps-scratch--size-small .ps-scratch__canvas-wrap{width:240px!important;height:150px!important}
.ps-scratch--size-medium .ps-scratch__canvas-wrap{width:320px!important;height:200px!important}
.ps-scratch--size-large .ps-scratch__canvas-wrap{width:480px!important;height:300px!important}

/* ── v3.3: Scratch Reveal Animations ── */
@keyframes ps-scratch-slide-up{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}
.ps-scratch--reveal-slide-up .ps-scratch__step--result.ps-active{animation:ps-scratch-slide-up .5s ease-out}
