/**
 * Woo Spin Wheel - Frontend Styles
 *
 * @package Woo_Spin_Wheel
 */

/* Variables */
:root {
    --wsw-primary: #e94560;
    --wsw-primary-dark: #c73e54;
    --wsw-success: #00d26a;
    --wsw-dark: #1a1a2e;
    --wsw-light: #ffffff;
    --wsw-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --wsw-radius: 16px;
}

/* Popup Overlay */
.wsw-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.wsw-popup-overlay.wsw-active {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.wsw-popup-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--wsw-dark);
    border-radius: var(--wsw-radius);
    box-shadow: var(--wsw-shadow);
    animation: wsw-popup-in 0.5s ease;
}

@keyframes wsw-popup-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Close Button */
.wsw-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s, transform 0.3s;
}

.wsw-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Wheel Wrapper */
.wsw-wheel-wrapper {
    padding: 30px;
    text-align: center;
}

.wsw-wheel-wrapper.wsw-inline {
    max-width: 500px;
    margin: 0 auto;
    background: var(--wsw-dark);
    border-radius: var(--wsw-radius);
    color: #fff;
}

/* Title & Subtitle */
.wsw-wheel-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: inherit;
    line-height: 1.2;
}

.wsw-wheel-subtitle {
    margin: 0 0 25px;
    font-size: 16px;
    opacity: 0.8;
    color: inherit;
}

/* Wheel Container */
.wsw-wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto 25px;
}

/* Wheel Pointer */
.wsw-wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 35px solid var(--wsw-primary);
    z-index: 10;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.wsw-wheel-pointer::after {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--wsw-primary);
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Canvas */
.wsw-wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, 0.1),
        0 0 0 12px rgba(255, 255, 255, 0.05),
        0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s ease-out;
}

.wsw-wheel-canvas.wsw-spinning {
    transition: none;
}

/* Email Form */
.wsw-email-form {
    margin-top: 20px;
}

.wsw-email-input {
    width: 100%;
    max-width: 300px;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    text-align: center;
    margin-bottom: 15px;
    transition: border-color 0.3s, background 0.3s;
    box-sizing: border-box;
}

.wsw-email-input::placeholder {
    color: #999;
}

.wsw-email-input:focus {
    outline: none;
    border-color: var(--wsw-primary);
    background: #fff;
}

/* GDPR */
.wsw-gdpr-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    opacity: 0.8;
    cursor: pointer;
}

.wsw-gdpr-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Spin Button */
.wsw-spin-button {
    display: inline-block;
    padding: 16px 50px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: var(--wsw-primary);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.wsw-spin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.5);
    background: var(--wsw-primary-dark);
}

.wsw-spin-button:active {
    transform: translateY(0);
}

.wsw-spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wsw-spin-button.wsw-spinning {
    pointer-events: none;
}

/* Result Display */
.wsw-result {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    animation: wsw-fade-in 0.5s ease;
}

@keyframes wsw-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wsw-result-content {
    text-align: center;
}

.wsw-result-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
}

.wsw-result-message {
    margin: 0 0 15px;
    font-size: 16px;
    opacity: 0.9;
}

.wsw-result-coupon {
    display: inline-block;
    padding: 12px 25px;
    background: var(--wsw-success);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Action Buttons */
.wsw-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.wsw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wsw-btn-primary {
    background: var(--wsw-primary);
    color: #fff;
}

.wsw-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.wsw-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.wsw-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Confetti */
.wsw-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000000;
}

/* Error Message */
.wsw-error-message {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 10px;
}

/* Toast Notification */
.wsw-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    background: var(--wsw-dark);
    color: #fff;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000001;
    animation: wsw-toast-in 0.3s ease;
}

@keyframes wsw-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.wsw-toast.wsw-toast-out {
    animation: wsw-toast-out 0.3s ease forwards;
}

@keyframes wsw-toast-out {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .wsw-popup-container {
        max-width: 100%;
        border-radius: 12px;
    }

    .wsw-wheel-wrapper {
        padding: 20px;
    }

    .wsw-wheel-title {
        font-size: 22px;
    }

    .wsw-wheel-subtitle {
        font-size: 14px;
    }

    .wsw-wheel-container {
        width: 280px;
        height: 280px;
    }

    .wsw-spin-button {
        padding: 14px 40px;
        font-size: 16px;
    }

    .wsw-result-coupon {
        font-size: 20px;
        padding: 10px 20px;
    }
}

/* Hide on print */
@media print {
    .wsw-popup-overlay {
        display: none !important;
    }
}