/* ===========================
   Visitor Coupon Bubble v1.1
   All colors via CSS variables
   =========================== */

#vcb-wrapper {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 99999;
    font-family: inherit;
    direction: rtl;
}

/* ── Main Bubble ── */
#vcb-bubble {
    background: var(--vcb-bubble-bg, #fff);
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10);
    width: 300px;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
#vcb-bubble.vcb-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Header ── */
#vcb-header {
    background: linear-gradient(135deg, var(--vcb-header-from, #e63946), var(--vcb-header-to, #c1121f));
    padding: 16px 18px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
#vcb-header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}
#vcb-icon {
    font-size: 26px;
    animation: vcb-wiggle 2.5s ease-in-out infinite;
}
#vcb-title {
    margin: 0;
    color: var(--vcb-header-text, #fff);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.3px;
}

/* ── Close ── */
#vcb-close {
    position: absolute;
    top: 10px; left: 12px;
    background: rgba(255,255,255,.22);
    border: none;
    color: var(--vcb-header-text, #fff);
    font-size: 18px; line-height: 1;
    width: 26px; height: 26px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s; z-index: 2;
}
#vcb-close:hover { background: rgba(255,255,255,.38); }

/* ── Body ── */
#vcb-body {
    padding: 16px 18px 18px;
    background: var(--vcb-bubble-bg, #fff);
}
#vcb-main-text {
    margin: 0 0 4px;
    font-size: 14px; font-weight: 600;
    color: var(--vcb-body-text, #1a1a2e);
    line-height: 1.4;
}
#vcb-sub-text {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--vcb-sub-text, #888);
}

/* ── Loading ── */
#vcb-loading {
    display: flex; align-items: center; gap: 10px;
    color: var(--vcb-sub-text, #888);
    font-size: 13px; padding: 6px 0;
}
.vcb-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(0,0,0,.08);
    border-top-color: var(--vcb-btn-from, #e63946);
    border-radius: 50%;
    animation: vcb-spin .7s linear infinite;
    flex-shrink: 0;
}

/* ── Coupon Box ── */
#vcb-coupon-box {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--vcb-coupon-bg, #fff8f8);
    border: 2px dashed var(--vcb-coupon-border, #e63946);
    border-radius: 12px;
    padding: 10px 14px; margin-bottom: 10px;
    cursor: pointer; transition: all .2s;
}
#vcb-coupon-box:hover { filter: brightness(.97); transform: scale(1.01); }
#vcb-coupon-code {
    font-family: 'Courier New', monospace;
    font-size: 17px; font-weight: 800; letter-spacing: 2px;
    color: var(--vcb-coupon-code-color, #1a1a2e);
    user-select: all;
}
#vcb-copy-btn {
    background: linear-gradient(135deg, var(--vcb-btn-from, #e63946), var(--vcb-btn-to, #c1121f));
    color: var(--vcb-btn-text, #fff);
    border: none; border-radius: 8px;
    padding: 6px 12px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all .2s;
    font-family: inherit; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
#vcb-copy-btn:hover { filter: brightness(1.1); transform: scale(1.04); }
#vcb-copy-btn.vcb-copied {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 2px 8px rgba(46,204,113,.3);
}

/* ── Timer ── */
#vcb-timer-row { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
#vcb-timer-icon { font-size: 14px; }
#vcb-timer-text { font-size: 12px; font-weight: 700; color: var(--vcb-timer-color, #e67e22); }
#vcb-timer-text.vcb-urgent {
    color: var(--vcb-timer-urgent, #e63946);
    animation: vcb-pulse 1s ease-in-out infinite;
}

/* ── Shop Button ── */
#vcb-shop-btn {
    display: block; text-align: center;
    background: linear-gradient(135deg, var(--vcb-btn-from, #e63946), var(--vcb-btn-to, #c1121f));
    color: var(--vcb-btn-text, #fff) !important;
    text-decoration: none !important;
    border-radius: 10px; padding: 10px;
    font-size: 13px; font-weight: 700;
    transition: all .2s;
    box-shadow: 0 3px 12px rgba(0,0,0,.12);
}
#vcb-shop-btn:hover {
    filter: brightness(1.1); transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

/* ── Expired ── */
#vcb-expired p { text-align: center; color: var(--vcb-sub-text, #999); font-size: 13px; margin: 8px 0 0; }

/* ── Minimized Tab ── */
#vcb-tab {
    position: fixed; bottom: 28px; left: 28px;
    background: linear-gradient(135deg, var(--vcb-tab-from, #e63946), var(--vcb-tab-to, #c1121f));
    color: var(--vcb-btn-text, #fff);
    border-radius: 50px; padding: 10px 16px;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    font-size: 14px; font-weight: 700;
    transition: all .35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 99999; direction: rtl;
    transform: scale(0); opacity: 0;
}
#vcb-tab.vcb-tab-visible { transform: scale(1); opacity: 1; }
#vcb-tab:hover { transform: scale(1.07); }
#vcb-tab::before {
    content: '';
    position: absolute; width: 10px; height: 10px;
    background: rgba(255,255,255,.7); border-radius: 50%;
    top: -3px; right: -3px;
    animation: vcb-ping 1.5s ease-in-out infinite;
}

/* ── Animations ── */
@keyframes vcb-wiggle {
    0%,100%{ transform:rotate(0); }
    15%{ transform:rotate(-14deg); }
    30%{ transform:rotate(10deg); }
    45%{ transform:rotate(-6deg); }
    60%{ transform:rotate(3deg); }
}
@keyframes vcb-spin { to { transform:rotate(360deg); } }
@keyframes vcb-pulse { 0%,100%{ opacity:1; } 50%{ opacity:.45; } }
@keyframes vcb-ping  { 0%{ transform:scale(1); opacity:.8; } 70%{ transform:scale(2.4); opacity:0; } 100%{ opacity:0; } }

/* ── Mobile ── */
@media (max-width: 480px) {
    #vcb-wrapper, #vcb-tab { left: 12px; bottom: 16px; }
    #vcb-bubble { width: calc(100vw - 24px); max-width: 300px; }
}
