/**
 * Thimze Smart Coupons — Frontend CSS
 * Premium WooCommerce coupon UI components
 */

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
    --tsc-primary:        #1ac4f3;
    --tsc-primary-light:  #8b68ff;
    --tsc-primary-dark:   #4f2ee8;
    --tsc-success:        #16c784;
    --tsc-warning:        #f7931a;
    --tsc-danger:         #ff4d4f;
    --tsc-bg:             #ffffff;
    --tsc-bg-2:           #f8f7ff;
    --tsc-border:         #e8e3ff;
    --tsc-text:           #1a1523;
    --tsc-text-muted:     #7a7089;
    --tsc-radius:         12px;
    --tsc-radius-lg:      18px;
    --tsc-shadow:         0 4px 24px rgba(26, 196, 243, 0.12);
    --tsc-shadow-lg:      0 12px 48px rgba(26, 196, 243, 0.2);
    --tsc-transition:     0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --tsc-font:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --tsc-bg:         #13111a;
        --tsc-bg-2:       #1c1829;
        --tsc-border:     #2d2744;
        --tsc-text:       #f0eeff;
        --tsc-text-muted: #9086b0;
    }
}

/* ============================================================
   Progress Bar
   ============================================================ */
.tsc-progress-wrap {
    margin: 0 0 24px;
    padding: 16px 20px;
    background: var(--tsc-bg-2);
    border: 1px solid var(--tsc-border);
    border-radius: var(--tsc-radius-lg);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--tsc-transition), transform var(--tsc-transition);
    font-family: var(--tsc-font);
}

.tsc-progress-wrap.tsc-progress--visible {
    opacity: 1;
    transform: translateY(0);
}

.tsc-progress-track {
    height: 8px;
    background: var(--tsc-border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tsc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tsc-primary), var(--tsc-primary-light));
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tsc-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: white;
    border: 3px solid var(--tsc-primary);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(26, 196, 243, 0.4);
}

.tsc-progress--reached .tsc-progress-fill {
    background: linear-gradient(90deg, var(--tsc-success), #4ade80);
}

.tsc-progress--reached .tsc-progress-fill::after {
    border-color: var(--tsc-success);
}

.tsc-progress-label {
    margin: 0;
    font-size: 13px;
    color: var(--tsc-text-muted);
    font-family: var(--tsc-font);
}

.tsc-progress-label strong {
    color: var(--tsc-text);
    font-weight: 600;
}

/* ============================================================
   Floating Offer
   ============================================================ */
.tsc-floating-offer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 300px;
    background: var(--tsc-bg);
    border: 1px solid var(--tsc-border);
    border-radius: var(--tsc-radius-lg);
    box-shadow: var(--tsc-shadow-lg);
    padding: 20px;
    font-family: var(--tsc-font);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity var(--tsc-transition), transform var(--tsc-transition);
    pointer-events: none;
}

.tsc-floating-offer.tsc-floating-offer--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.tsc-floating-offer__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tsc-text-muted);
    font-size: 16px;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: background var(--tsc-transition), color var(--tsc-transition);
}

.tsc-floating-offer__close:hover {
    background: var(--tsc-bg-2);
    color: var(--tsc-text);
}

.tsc-floating-offer__body h4 {
    margin: 8px 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--tsc-text);
}

.tsc-floating-offer__body p {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--tsc-text-muted);
}

/* ============================================================
   Badges
   ============================================================ */
.tsc-badge {
    display: inline-block;
    padding: 3px 8px;
    background: linear-gradient(135deg, var(--tsc-warning), #ffd54f);
    color: #7a4a00;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 99px;
    font-family: var(--tsc-font);
    text-transform: uppercase;
}

/* ============================================================
   Buttons
   ============================================================ */
.tsc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--tsc-radius);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tsc-font);
    cursor: pointer;
    border: none;
    transition: all var(--tsc-transition);
    text-decoration: none;
    white-space: nowrap;
}

.tsc-btn--primary {
    background: linear-gradient(135deg, var(--tsc-primary), var(--tsc-primary-light));
    color: white;
    box-shadow: 0 2px 12px rgba(26, 196, 243, 0.35);
}

.tsc-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 196, 243, 0.45);
    color: white;
}

.tsc-btn--primary:active {
    transform: translateY(0);
}

/* ============================================================
   Coupon Widget (Checkout)
   ============================================================ */
.tsc-coupon-widget {
    background: var(--tsc-bg-2);
    border: 1px solid var(--tsc-border);
    border-radius: var(--tsc-radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    font-family: var(--tsc-font);
}

.tsc-coupon-widget__header {
    font-size: 14px;
    font-weight: 600;
    color: var(--tsc-text);
    margin-bottom: 14px;
}

.tsc-coupon-input-wrap {
    display: flex;
    gap: 8px;
}

.tsc-coupon-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--tsc-border);
    border-radius: var(--tsc-radius);
    font-size: 14px;
    font-family: var(--tsc-font);
    background: var(--tsc-bg);
    color: var(--tsc-text);
    transition: border-color var(--tsc-transition);
    outline: none;
}

.tsc-coupon-input:focus {
    border-color: var(--tsc-primary);
    box-shadow: 0 0 0 3px rgba(26, 196, 243, 0.1);
}

.tsc-coupon-feedback {
    margin-top: 8px;
    font-size: 13px;
}

.tsc-success { color: var(--tsc-success); font-weight: 600; }
.tsc-loading { color: var(--tsc-text-muted); }

/* ============================================================
   Savings Banner
   ============================================================ */
.tsc-savings-banner {
    background: linear-gradient(135deg, rgba(22, 199, 132, 0.08), rgba(22, 199, 132, 0.03));
    border: 1px solid rgba(22, 199, 132, 0.3);
    border-radius: var(--tsc-radius);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--tsc-text);
    margin-bottom: 16px;
    font-family: var(--tsc-font);
    animation: tsc-slide-in 0.3s ease;
}

.tsc-savings-banner strong {
    color: var(--tsc-success);
    font-weight: 700;
}

/* ============================================================
   Scratch Card
   ============================================================ */
.tsc-scratch-card {
    position: relative;
    display: inline-block;
    border-radius: var(--tsc-radius);
    overflow: hidden;
    cursor: crosshair;
    box-shadow: var(--tsc-shadow);
}

.tsc-scratch-card canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    touch-action: none;
}

.tsc-scratch-card__prize {
    padding: 24px;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 2px dashed var(--tsc-warning);
    border-radius: var(--tsc-radius);
    text-align: center;
    font-family: var(--tsc-font);
}

.tsc-scratch-result {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tsc-text);
    text-align: center;
    display: none;
}

/* ============================================================
   Spin Wheel Modal
   ============================================================ */
#tsc-spin-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--tsc-transition);
}

#tsc-spin-modal.tsc-modal--open {
    opacity: 1;
    pointer-events: all;
}

.tsc-wheel-wrap {
    background: var(--tsc-bg);
    border-radius: var(--tsc-radius-lg);
    padding: 32px;
    text-align: center;
    max-width: 420px;
    width: 90vw;
    box-shadow: var(--tsc-shadow-lg);
    font-family: var(--tsc-font);
}

.tsc-wheel-canvas {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(26, 196, 243, 0.25);
    margin: 0 auto 24px;
    display: block;
    transform-origin: center;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes tsc-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes tsc-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.02); }
}

.tsc-pulse {
    animation: tsc-pulse 2s ease-in-out infinite;
}

/* ============================================================
   Countdown Timer
   ============================================================ */
.tsc-countdown {
    display: inline-flex;
    gap: 8px;
    font-family: var(--tsc-font);
}

.tsc-countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--tsc-bg-2);
    border: 1px solid var(--tsc-border);
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 48px;
}

.tsc-countdown__num {
    font-size: 22px;
    font-weight: 800;
    color: var(--tsc-primary);
    line-height: 1;
}

.tsc-countdown__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tsc-text-muted);
    margin-top: 2px;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 600px) {
    .tsc-floating-offer {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: var(--tsc-radius-lg) var(--tsc-radius-lg) 0 0;
    }
    .tsc-coupon-input-wrap {
        flex-direction: column;
    }
}
