/* =============================================================
   Steampunk Popup — Frontend Styles
   ============================================================= */

/* Overlay — z-index must exceed OptinMonster (9999999) and other popup plugins */
#sp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: sp-overlay-in 0.4s ease forwards;
}

@keyframes sp-overlay-in {
    from { background: rgba(0,0,0,0); }
    to   { background: rgba(0,0,0,0.65); }
}

/* Popup box */
#sp-popup-box {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 480px;
    width: 100%;
    padding: 40px 36px 32px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    text-align: center;
    font-family: inherit;
    animation: sp-box-enter 0.45s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    /* sp-box-pulse animation added via inline style based on flash setting */
}

/* Entry: slide up + fade */
@keyframes sp-box-enter {
    from { transform: translateY(32px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* sp-box-pulse keyframe and animation-duration are output dynamically via inline style */

/* Close button */
#sp-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0;
    transition: color 0.2s;
}
#sp-popup-close:hover,
#sp-popup-close:focus {
    color: #222;
    outline: none;
}

/* Title */
#sp-popup-title {
    margin: 0 0 14px;
    font-weight: 700;
    line-height: 1.3;
    /* color, font-size, font-family set via inline style from settings */
}

/* Message */
#sp-popup-message {
    line-height: 1.6;
    margin-bottom: 24px;
    /* color, font-size, font-family set via inline style from settings */
}
#sp-popup-message a {
    color: #0073aa;
}

/* CTA button */
#sp-popup-btn {
    display: inline-block;
    background: #c0392b;
    color: #fff !important;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background 0.2s, transform 0.15s;
}
#sp-popup-btn:hover,
#sp-popup-btn:focus {
    background: #a93226;
    transform: translateY(-1px);
    outline: none;
}

/* Mobile */
@media (max-width: 480px) {
    #sp-popup-box {
        padding: 32px 20px 24px;
    }
}

/* =============================================================
   Sticky Ticker Bar
   ============================================================= */

#sp-ticker-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999998; /* just below popup overlay */
    display: flex;
    align-items: center;
    height: 40px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    animation: sp-ticker-flash 4s ease-in-out infinite;
    /* background set via inline style */
}

/* Default keyframe — overridden by inline style per speed setting */
@keyframes sp-ticker-flash {
    0%,  100% { filter: brightness(0.88); opacity: 0.88; box-shadow: 0 2px 8px  rgba(0,0,0,0.25); }
    50%        { filter: brightness(1.15); opacity: 1;    box-shadow: 0 2px 28px rgba(0,0,0,0.45); }
}

.sp-ticker-sep {
    display: inline-block;
    padding: 0 14px;   /* even gap either side of ★ regardless of font */
}

#sp-ticker-bar.sp-ticker-hidden {
    display: none;
}

/* Push page content below the fixed ticker bar so it doesn't overlap the header */
body.sp-ticker-visible {
    padding-top: 40px !important;
}
/* When WP admin bar is also present, stack below it */
.admin-bar body.sp-ticker-visible,
body.admin-bar.sp-ticker-visible {
    padding-top: 72px !important; /* 32px admin bar + 40px ticker */
}

#sp-ticker-track {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

#sp-ticker-text {
    /* legacy selector */
    display: inline-block;
    padding-left: 100%;
    white-space: nowrap;
    animation: sp-ticker-scroll 20s linear infinite;
    font-weight: 500;
}

/* Individual message spans — hidden by JS once seamless inner is built */
.sp-ticker-msg {
    display: inline-block;
    padding-left: 100%;
    white-space: nowrap;
    animation: sp-ticker-scroll 20s linear infinite;
    font-weight: 500;
}

/* Seamless continuous ticker built by JS: all messages doubled, loops on -50% */
.sp-ticker-inner {
    display: inline-block;
    white-space: nowrap;
    animation: sp-ticker-loop 20s linear infinite;
    font-weight: 500;
}

@keyframes sp-ticker-loop {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes sp-ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Pause on hover so users can read */
#sp-ticker-bar:hover .sp-ticker-msg,
#sp-ticker-bar:hover .sp-ticker-inner,
#sp-ticker-bar:hover #sp-ticker-text {
    animation-play-state: paused;
}

/* Close button */
#sp-ticker-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 14px;
    height: 100%;
    opacity: 0.7;
    transition: opacity 0.2s;
    /* color set via inline style to match text color */
}
#sp-ticker-close:hover,
#sp-ticker-close:focus {
    opacity: 1;
    outline: none;
}
