/* ==========================================================================
   LUCKY THE WHEEL - PLUGIN STYLESHEET
   Description: Core styles for the popup, game canvas, and gift trigger animations.
   ========================================================================== */

/* =========================================
   1. POPUP WRAPPER (WHEEL BACKGROUND)
   ========================================= */
#zutalw-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* High z-index to overlay menu/header, but lower than Popup Form */
    z-index: 999990; 
    
    background: rgba(0, 0, 0, 0.85);
    
    /* Center the wheel */
    display: none; /* Hidden by default, JS will fadeIn */
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fix jQuery fadeIn breaking flex display (Important) */
#zutalw-popup-wrapper[style*="display: block"] {
    display: flex !important;
}

/* =========================================
   2. GAME AREA (CANVAS)
   ========================================= */
#area-game {
    position: relative;
    z-index: 10000; /* 1 unit higher than black background */
    
    /* Ensure responsiveness */
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   3. LOADING SCREEN
   ========================================= */
#zutalw-loading {
    z-index: 9999999 !important;
}

/* =========================================
   4. POPUP RESULT FORM (INPUT & NOTIFICATION)
   This class is appended to body by JS after spinning
   ========================================= */
.zutalw-popup-form,
.zutalw-notification-overlay {
    /* Mandatory: Full screen overlay covering everything */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Dark background to highlight form */
    
    z-index: 99999999 !important; /* HIGHEST: Overlay on top of wheel */
    
    /* Center the form */
    display: flex;
    align-items: center;
    justify-content: center;
    
    overflow-y: auto;
    animation: zutalwFadeIn 0.3s ease-out;
}

/* =========================================
   5. FORM BOX STYLE
   ========================================= */
.zutalw-popup-form .zutalw-form,
.zutalw-popup-notify .zutalw-form,
.zutalw-notification-overlay .zutalw-form {
    position: relative;
    background-color: #fff;
    width: 90%;
    max-width: 400px;
    margin: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    text-align: center;
    padding: 0;
    overflow: hidden; /* For border-radius to work with header */
}

/* Header */
.zutalw-popup-form .head-congrate,
.zutalw-notification-overlay .head-congrate {
    background: #f8f9fa;
    padding: 20px 15px;
    border-bottom: 1px solid #eee;
}

.zutalw-popup-form .head-congrate h4,
.zutalw-notification-overlay .head-congrate h4 {
    margin: 0 0 10px 0;
    color: #d32f2f; /* Red color for emphasis */
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
}

.zutalw-popup-form .head-congrate p {
    margin: 5px 0;
    color: #555;
    font-size: 16px;
}

.zutalw-popup-form .head-congrate .namegif {
    color: #2e7d32; /* Green color for gift name */
    font-weight: bold;
    font-size: 18px;
}

/* =========================================
   6. INPUT AND BUTTON STYLES
   ========================================= */
.zutalw-popup-form .form-input {
    padding: 20px;
}

.zutalw-popup-form .form-group {
    margin-bottom: 15px;
}

/* Input fields */
.zutalw-popup-form input.fullname,
.zutalw-popup-form input.phone,
.zutalw-popup-form input.email {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box; /* Ensure padding doesn't break layout */
    transition: border-color 0.3s;
}

.zutalw-popup-form input:focus {
    border-color: #007bff;
    outline: none;
}

/* Submit Button */
.zutalw-popup-form button.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.zutalw-popup-form button.btn-primary:hover {
    background-color: #0056b3;
}

/* Close Button (X) - For Forms */
.zutalw-popup-form .btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.zutalw-popup-form .btn-close:hover {
    background: #ff4d4d;
    color: #fff;
    border-color: #ff4d4d;
}

/* =========================================
   7. ANIMATION UTILS
   ========================================= */
@keyframes zutalwFadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* =========================================
   8. GIFT TRIGGER (PROFESSIONAL CARD STYLE)
   ========================================= */

/* Dark Overlay Background */
.zutalw-gift-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999980;
    background-color: rgba(0, 0, 0, 0.7); /* Darker for focus */
    backdrop-filter: blur(4px); /* Modern blur effect */
    display: flex;
    align-items: center;
    justify-content: center;
    animation: zutalwFadeIn 0.3s ease-out;
}

/* The White Card */
.zutalw-gift-card {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    padding: 0 30px 30px 30px; /* Top padding is 0 to let image float */
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    margin-top: 30px; /* Space for floating image */
}

/* Close Button (Inside Card) */
.zutalw-card-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    background: #f1f1f1;
    color: #888;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}
.zutalw-card-close:hover {
    background: #ff4d4d;
    color: #fff;
}

/* Floating Image Wrapper */
.zutalw-card-img-wrapper {
    margin-top: -60px; /* Pull image up */
    margin-bottom: 15px;
}

.zutalw-card-img {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
    animation: zutalwFloat 3s ease-in-out infinite;
}

@keyframes zutalwFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Typography */
.zutalw-card-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #FF4136; /* Red-Orange attention color */
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.zutalw-card-desc {
    font-size: 16px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 25px;
}

.zutalw-card-desc .highlight {
    display: block;
    font-size: 24px;
    font-weight: 900;
    color: #2ECC40; /* Green Success Color */
    margin-top: 5px;
}

/* CTA Button */
.zutalw-card-btn {
    display: block;
    width: 100%;
    padding: 15px 0;
    background: linear-gradient(45deg, #FFDC00, #FF851B); /* Gold to Orange */
    color: #fff !important;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(255, 133, 27, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.zutalw-card-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(255, 133, 27, 0.6);
}

/* Footer Note (Click handler handled by JS usually, strictly visual here) */
.zutalw-card-note {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
    margin-bottom: 0;
    cursor: pointer;
    text-decoration: underline;
}
.zutalw-card-note:hover {
    color: #666;
}

/* =========================================
   9. LUCKY TEXT EFFECT (NEON PULSE)
   ========================================= */
.zutalw-lucky-text {
    margin-bottom: 20px;
    z-index: 999982;
    pointer-events: none;
}

.zutalw-text-title {
    font-family: sans-serif;
    font-size: 32px;
    font-weight: 900;
    margin: 0 0 10px 0;
    color: #FFD700; /* Gold */
    text-transform: uppercase;
    letter-spacing: 2px;
    
    /* Neon Glow */
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7), 0 0 20px rgba(255, 215, 0, 0.5);
    
    /* Animation */
    animation: zutalwPulseText 1.5s infinite alternate;
}

.zutalw-text-desc {
    font-family: sans-serif;
    font-size: 18px;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.zutalw-text-desc strong {
    color: #00ffea; /* Neon Cyan */
    font-size: 22px;
    font-weight: bold;
}

@keyframes zutalwPulseText {
    0% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    }
    100% {
        transform: scale(1.1);
        text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 40px #ff00de;
    }
}

/* =========================================
   10. FIREWORKS EFFECT (BACKGROUND)
   ========================================= */
.zutalw-firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    animation: zutalwFireworkExplode 1s ease-out forwards;
}

/* Keyframe for the explosion using box-shadow */
@keyframes zutalwFireworkExplode {
    0% {
        transform: scale(0.1);
        opacity: 1;
        box-shadow: 
            0 0 0 0 #ff0000, 
            0 0 0 0 #ffff00, 
            0 0 0 0 #00ff00, 
            0 0 0 0 #0000ff, 
            0 0 0 0 #ff00ff, 
            0 0 0 0 #00ffff;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
        /* Scatter particles outward */
        box-shadow: 
            -60px -60px 0 0 #ff0000, 
             60px -60px 0 0 #ffff00, 
             60px  60px 0 0 #00ff00, 
            -60px  60px 0 0 #0000ff, 
             0   -90px 0 0 #ff00ff, 
             0    90px 0 0 #00ffff,
            -90px  0   0 0 #ffffff, 
             90px  0   0 0 #ffaa00;
    }
}

/* =========================================
   11. CLICK HINT POINTER (ARROW & TEXT)
   ========================================= */
.zutalw-click-hint {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 999982;
    pointer-events: none;
    
    /* Bounce Animation */
    animation: zutalwBounceHint 1s infinite alternate ease-in-out;
}

.zutalw-arrow-up {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 15px solid #fff;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

.zutalw-hint-text {
    font-family: sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

@keyframes zutalwBounceHint {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* =========================================
   12. GIFT CLOSE BUTTON
   ========================================= */
.zutalw-gift-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 999985;
    
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    
    pointer-events: auto; 
    transition: all 0.3s ease;
}

.zutalw-gift-close:hover {
    background: #ff4d4d;
    border-color: #fff;
    transform: rotate(90deg);
}

/* =========================================
   13. RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    .zutalw-text-title {
        font-size: 24px;
    }
    .zutalw-text-desc {
        font-size: 16px;
    }
    .zutalw-gift-img {
        max-width: 120px;
    }
}

/* =========================================
   14. GAME CARD CONTAINER (CASINO STYLE)
   ========================================= */
.zutalw-game-card {
    /* Background: Royal Gradient */
    background: linear-gradient(145deg, #1a2a6c, #b21f1f, #fdbb2d); 
   
    width: 95%;
    max-width: 500px;
    padding: 40px 10px;
    border-radius: 20px;
    position: relative;
    text-align: center;
    
    /* Border and shadow */
    border: 2px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 0 30px 60px rgba(0,0,0,0.8);
    
    animation: zutalwZoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Game Title (White/Gold to pop on dark background) */
.zutalw-game-title {
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    margin: 0 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Close Game Button (Adjusted for dark background) */
.zutalw-close-game {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2); /* Semi-transparent */
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
    z-index: 10;
}
.zutalw-close-game:hover {
    background: #FF4136;
    border-color: #FF4136;
    color: #fff;
}

/* =========================================
   15. RIGHT POINTER INDICATOR (Corrected Alignment)
   ========================================= */
.zutalw-wheel-pointer {
    width: 0;
    height: 0;
    
    /* 1. Create LARGER Triangle pointing left */
    border-top: 25px solid transparent; 
    border-bottom: 25px solid transparent;
    border-right: 55px solid #FF3333; /* Use brighter red for visibility */
    border-left: 0;

    /* 2. PRECISE Positioning */
    position: absolute;
    
    /* Absolute vertical centering relative to #area-game */
    top: 54.3%;
    transform: translateY(-50%);

    /* Place near right edge. Adjust this number to push in or pull out */
    /* Since canvas has 15px margin, set right to approx 5px so tip touches the gold border */
    right: 5px; 
    
    /* 3. Ensure it stays on top */
    z-index: 11000; 
    
    /* White drop shadow to separate from dark bg and gold border */
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5)) drop-shadow(0 0 2px #fff);
}

/* =========================================
   16. WHEEL CANVAS STYLING
   ========================================= */
#area-game canvas {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 50%;
    
    background: transparent; 

    /* Thin white separator + Large gold outer border */
    border: 4px solid #fff; 
    outline: 6px solid #FFD700; 
    
    /* Deep shadows */
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.6), /* Deep black shadow */
        0 0 0 8px rgba(255, 215, 0, 0.3); /* Faint aura glow */
        
    margin: 15px; 
}

@keyframes zutalwZoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}