/* Lucky Box Modal - Premium Design */

/* Modal Overlay */
#wmmb-lucky-box-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Container */
.wmmb-lucky-modal {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    border-radius: 24px;
    padding: 0;
    max-width: 420px;
    width: 90%;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Decorative Elements */
.wmmb-lucky-modal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 215, 0, 0.03) 60deg,
        transparent 120deg,
        rgba(255, 107, 107, 0.03) 180deg,
        transparent 240deg,
        rgba(78, 205, 196, 0.03) 300deg,
        transparent 360deg
    );
    animation: rotateBg 20s linear infinite;
    pointer-events: none;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Close Button */
.wmmb-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wmmb-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

/* Header */
.wmmb-lucky-header {
    text-align: center;
    padding: 32px 24px 16px;
    position: relative;
    z-index: 1;
}

.wmmb-lucky-header h2 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px 0;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.wmmb-lucky-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    margin: 0;
}

/* Wheel Container */
.wmmb-wheel-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 16px auto 24px;
}

/* Outer Ring */
.wmmb-wheel-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff6b6b, #4ecdc4, #a855f7, #ffd700);
    padding: 6px;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.3),
        0 0 60px rgba(255, 107, 107, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), 0 0 60px rgba(255, 107, 107, 0.2); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.5), 0 0 80px rgba(255, 107, 107, 0.3); }
}

/* Wheel */
.wmmb-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Wheel Segments */
.wmmb-wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    left: 50%;
    top: 0;
    transform-origin: 0% 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wmmb-wheel-segment:nth-child(1) { 
    transform: rotate(0deg) skewY(30deg); 
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}
.wmmb-wheel-segment:nth-child(2) { 
    transform: rotate(60deg) skewY(30deg); 
    background: linear-gradient(135deg, #ffd700 0%, #f0c800 100%);
}
.wmmb-wheel-segment:nth-child(3) { 
    transform: rotate(120deg) skewY(30deg); 
    background: linear-gradient(135deg, #4ecdc4 0%, #44b8b0 100%);
}
.wmmb-wheel-segment:nth-child(4) { 
    transform: rotate(180deg) skewY(30deg); 
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}
.wmmb-wheel-segment:nth-child(5) { 
    transform: rotate(240deg) skewY(30deg); 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
.wmmb-wheel-segment:nth-child(6) { 
    transform: rotate(300deg) skewY(30deg); 
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.wmmb-wheel-segment span {
    position: absolute;
    left: -35px;
    top: 50%;
    transform: skewY(-30deg) rotate(30deg);
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* Center Circle */
.wmmb-wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #1a1a2e, #0f0f23);
    border-radius: 50%;
    border: 4px solid #ffd700;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.wmmb-wheel-center span {
    font-size: 24px;
}

/* Pointer */
.wmmb-wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.wmmb-wheel-pointer svg {
    width: 40px;
    height: 50px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Prize Display */
.wmmb-prize-list {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.wmmb-prize-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Prize Legend */
.wmmb-prize-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0 20px 20px;
}

.wmmb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wmmb-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 5px currentColor;
}

.wmmb-legend-item span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
}

/* Spin Button */
.wmmb-spin-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 24px 24px;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 50%, #ffd700 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.wmmb-spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
}

.wmmb-spin-btn:disabled {
    background: #4a4a5e;
    color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Result Screen */
.wmmb-result,
.wmmb-no-chances {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a1a2e, #0f0f23);
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    border-radius: 24px; /* Ensure it matches parent border radius */
}

.wmmb-result.show,
.wmmb-no-chances.show {
    display: flex !important; /* Force display flex to override inline styles */
    position: relative;
    height: auto;
    animation: fadeIn 0.4s ease;
}

.wmmb-result-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.wmmb-result h3 {
    font-size: 32px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 16px 0;
}

.wmmb-result-points {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.wmmb-result-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    margin: 8px 0 24px;
}

.wmmb-result-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.wmmb-result-buttons button {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.wmmb-spin-again-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #1a1a2e;
}

.wmmb-result-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.wmmb-result-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wmmb-remaining-chances {
    color: rgba(255, 215, 0, 0.8);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Custom Confirm Dialog */
#wmmb-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    z-index: 1000000; /* Higher than main modal */
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.wmmb-confirm-box {
    background: #1a1a2e;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 24px;
    width: 300px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    transform: scale(0.9);
    animation: confirmPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes confirmPop {
    to { transform: scale(1); }
}

.wmmb-confirm-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.wmmb-confirm-message {
    color: #fff;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.wmmb-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.wmmb-confirm-buttons button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wmmb-confirm-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.wmmb-confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wmmb-confirm-yes {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #1a1a2e;
}

.wmmb-confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* Shortcode Styles */
.wmmb-lottery-shortcode {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin: 10px 0;
}

.wmmb-lottery-shortcode:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.15);
}

.wmmb-lottery-shortcode.has-chances {
    border-color: rgba(255, 215, 0, 0.8);
    animation: wmmb-glow 2s ease-in-out infinite;
}

.wmmb-lottery-icon {
    font-size: 24px;
    line-height: 1;
}

.wmmb-lottery-text {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

.wmmb-lottery-text strong {
    color: #ffd700;
    font-weight: 700;
}

.wmmb-lottery-text a {
    color: #ffd700;
    text-decoration: underline;
}

.wmmb-lottery-trigger-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #1a1a2e;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wmmb-lottery-trigger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

@keyframes wmmb-glow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
        border-color: rgba(255, 215, 0, 0.4);
    }
    50% { 
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
        border-color: rgba(255, 215, 0, 1);
    }
}
