/* ============================
   COD Boost v1.2.0 — Frontend CSS
   All selectors prefixed .cod-boost-*
   z-index max: 99990 (< 99999)
   Animations driven by CSS custom properties:
     --cb-t-speed / --cb-t-scale   (timer)
     --cb-v-speed / --cb-v-scale   (visitors)
     --cb-s-speed / --cb-s-scale / --cb-s-opacity  (stock)
   ============================ */

/* ============================================================
   1. COUNTDOWN TIMER — base
   ============================================================ */
.cod-boost-timer-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #856404;
    line-height: 1.4;
    transition: background 0.4s, border-color 0.4s, color 0.4s;
}

.cod-boost-timer-icon {
    font-size: 18px;
    flex-shrink: 0;
    display: inline-block;
}

.cod-boost-timer-countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #d63031;
    font-size: 17px;
    letter-spacing: 0.5px;
    display: inline-block;
    transition: color 0.3s;
}

/* ---- Timer icon animations (continuous) ---- */
.cod-boost-timer-icon.cod-boost-anim-pulse {
    animation: codBoostPulse var(--cb-t-speed, 1.5s) ease-in-out infinite;
}
.cod-boost-timer-icon.cod-boost-anim-shake {
    animation: codBoostShake var(--cb-t-speed, 1.5s) ease-in-out infinite;
}
.cod-boost-timer-icon.cod-boost-anim-bounce {
    animation: codBoostIconBounce var(--cb-t-speed, 1.5s) ease-in-out infinite;
}
.cod-boost-timer-icon.cod-boost-anim-flip {
    animation: codBoostFlip var(--cb-t-speed, 1.5s) ease-in-out infinite;
}

/* ---- Timer countdown tick animations (triggered via JS) ---- */
.cod-boost-timer-countdown.cod-boost-tick-bounce {
    animation: codBoostTickBounce 0.35s ease-out;
}
.cod-boost-timer-countdown.cod-boost-tick-flip {
    animation: codBoostTickFlip 0.5s ease-out;
}
.cod-boost-timer-countdown.cod-boost-tick-fade {
    animation: codBoostTickFade 0.5s ease-out;
}

/* ---- Timer urgency states ---- */
.cod-boost-timer-warn {
    border-color: #e74c3c;
}
.cod-boost-timer-warn .cod-boost-timer-countdown {
    color: #e74c3c;
    animation: codBoostFlash 1s ease-in-out infinite !important;
}

.cod-boost-timer-critical {
    background: #e74c3c;
    border-color: #c0392b;
    color: #ffffff;
}
.cod-boost-timer-critical .cod-boost-timer-before {
    color: #ffffff;
}
.cod-boost-timer-critical .cod-boost-timer-countdown {
    color: #ffffff;
    animation: codBoostFlash 0.7s ease-in-out infinite !important;
}
.cod-boost-timer-critical .cod-boost-timer-icon {
    animation: codBoostShake 0.5s ease-in-out infinite !important;
}

.cod-boost-timer-expired {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
.cod-boost-timer-expired .cod-boost-timer-icon,
.cod-boost-timer-expired .cod-boost-timer-countdown {
    animation: none !important;
    color: #721c24;
}

/* ============================================================
   2. VISITORS COUNTER — base
   ============================================================ */
.cod-boost-visitors-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 10px 0;
    background: #fff0f0;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #c0392b;
    line-height: 1.4;
}

/* Live green dot */
.cod-boost-visitors-live-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: #00b894;
    border-radius: 50%;
    animation: codBoostLiveDot 2s ease-in-out infinite;
    flex-shrink: 0;
}

.cod-boost-visitors-icon {
    font-size: 18px;
    flex-shrink: 0;
    display: inline-block;
    transform-origin: bottom center;
}

.cod-boost-visitors-count {
    font-weight: 700;
    display: inline-block;
}

/* ---- Visitors icon animations (continuous) ---- */
.cod-boost-visitors-icon.cod-boost-anim-flicker {
    animation: codBoostFlicker var(--cb-v-speed, 1.2s) ease-in-out infinite;
}
.cod-boost-visitors-icon.cod-boost-anim-pulse {
    animation: codBoostPulse var(--cb-v-speed, 1.2s) ease-in-out infinite;
}
.cod-boost-visitors-icon.cod-boost-anim-bounce {
    animation: codBoostIconBounce var(--cb-v-speed, 1.2s) ease-in-out infinite;
}

/* ---- Visitors count change animations (triggered via JS) ---- */
.cod-boost-visitors-count.cod-boost-count-pop {
    animation: codBoostPop 0.4s ease-out;
}
.cod-boost-visitors-count.cod-boost-count-fade {
    animation: codBoostCountFade 0.5s ease-out;
}

/* ============================================================
   3. STOCK PROGRESS BAR — base
   ============================================================ */
.cod-boost-stock-wrap {
    margin: 12px 0;
}

.cod-boost-stock-bar {
    width: 100%;
    height: 14px;
    background: #e9ecef;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
}

.cod-boost-stock-fill {
    height: 100%;
    border-radius: 7px;
    position: relative;
    overflow: hidden;
}

.cod-boost-stock-text {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    line-height: 1.4;
}

/* ---- Stock bar animations (continuous) ---- */

/* Shimmer: luminous sweep */
.cod-boost-stock-fill.cod-boost-anim-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: codBoostShimmer var(--cb-s-speed, 2.5s) linear infinite;
}

/* Pulse: subtle width variation */
.cod-boost-stock-fill.cod-boost-anim-pulse {
    animation: codBoostStockPulse var(--cb-s-speed, 2.5s) ease-in-out infinite;
    transform-origin: left center;
}

/* Glow: colored shadow pulse */
.cod-boost-stock-fill.cod-boost-anim-glow {
    animation: codBoostGlow var(--cb-s-speed, 2.5s) ease-in-out infinite;
}

/* ---- Stock text animation ---- */
.cod-boost-stock-text.cod-boost-anim-blink {
    animation: codBoostTextBlink var(--cb-s-speed, 2.5s) ease-in-out infinite;
}

/* ============================================================
   4. SALES POP NOTIFICATION
   ============================================================ */
.cod-boost-sales-pop {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99990;
    max-width: 320px;
    width: calc(100% - 40px);
    pointer-events: auto;
}

.cod-boost-sales-pop-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    position: relative;
    animation: codBoostSlideIn 0.4s ease-out;
}

.cod-boost-sales-pop-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}

.cod-boost-sales-pop-close:hover {
    color: #333;
}

.cod-boost-sales-pop-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.cod-boost-sales-pop-content {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.cod-boost-sales-pop-name {
    font-weight: 700;
    color: #2d3436;
}

.cod-boost-sales-pop-city {
    font-weight: 600;
    color: #0984e3;
}

.cod-boost-sales-pop-hiding {
    animation: codBoostSlideOut 0.4s ease-in forwards;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

/* --- Shared / Timer --- */
@keyframes codBoostPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(var(--cb-t-scale, 1.25)); }
}

@keyframes codBoostShake {
    0%, 100% { transform: rotate(0deg); }
    15%      { transform: rotate(12deg); }
    30%      { transform: rotate(-10deg); }
    45%      { transform: rotate(8deg); }
    60%      { transform: rotate(-6deg); }
    75%      { transform: rotate(3deg); }
}

@keyframes codBoostIconBounce {
    0%, 100% { transform: translateY(0); }
    30%      { transform: translateY(calc(-4px * var(--cb-t-scale, 1.25))); }
    60%      { transform: translateY(2px); }
}

@keyframes codBoostFlip {
    0%   { transform: perspective(200px) rotateY(0deg); }
    50%  { transform: perspective(200px) rotateY(180deg); }
    100% { transform: perspective(200px) rotateY(360deg); }
}

/* Timer countdown tick animations */
@keyframes codBoostTickBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(var(--cb-t-scale, 1.25)); }
    60%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes codBoostTickFlip {
    0%   { transform: perspective(120px) rotateX(-90deg); opacity: 0; }
    40%  { transform: perspective(120px) rotateX(10deg); opacity: 1; }
    70%  { transform: perspective(120px) rotateX(-5deg); }
    100% { transform: perspective(120px) rotateX(0deg); }
}

@keyframes codBoostTickFade {
    0%   { opacity: 0.2; }
    100% { opacity: 1; }
}

@keyframes codBoostFlash {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* --- Visitors --- */
@keyframes codBoostFlicker {
    0%   { transform: scale(1) rotate(0deg); opacity: 1; }
    20%  { transform: scale(var(--cb-v-scale, 1.2)) rotate(-3deg); opacity: 0.7; }
    40%  { transform: scale(0.95) rotate(2deg); opacity: 1; }
    60%  { transform: scale(var(--cb-v-scale, 1.2)) rotate(-2deg); opacity: 0.8; }
    80%  { transform: scale(1.05) rotate(1deg); opacity: 0.9; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes codBoostPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(var(--cb-v-scale, 1.35)); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes codBoostCountFade {
    0%   { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes codBoostLiveDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.6); }
    50%      { opacity: 0.7; box-shadow: 0 0 0 4px rgba(0, 184, 148, 0); }
}

/* --- Stock --- */
@keyframes codBoostShimmer {
    0%   { left: -100%; }
    100% { left: 100%; }
}

@keyframes codBoostStockPulse {
    0%, 100% { transform: scaleX(1); }
    50%      { transform: scaleX(var(--cb-s-scale, 1.015)); }
}

@keyframes codBoostGlow {
    0%, 100% { box-shadow: 0 0 4px 0 currentColor; }
    50%      { box-shadow: 0 0 12px 3px currentColor; }
}

@keyframes codBoostTextBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: var(--cb-s-opacity, 0.6); }
}

/* --- Sales Pop --- */
@keyframes codBoostSlideIn {
    from { opacity: 0; transform: translateX(-40px) translateY(10px); }
    to   { opacity: 1; transform: translateX(0) translateY(0); }
}

@keyframes codBoostSlideOut {
    from { opacity: 1; transform: translateX(0) translateY(0); }
    to   { opacity: 0; transform: translateX(-40px) translateY(10px); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .cod-boost-sales-pop {
        bottom: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        width: calc(100% - 20px);
    }
    .cod-boost-sales-pop-inner {
        padding: 10px 14px;
        gap: 10px;
    }
    .cod-boost-sales-pop-icon {
        font-size: 24px;
    }
    .cod-boost-sales-pop-content {
        font-size: 13px;
    }
}
