/* Raffle Plugin Frontend Styles */

/* Countdown and Flash Overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 120px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    z-index: 9999;
}

.countdown-overlay.white-flash {
    background-color: white;
    transition: background-color 0.5s ease-in;
}

/* Main Container */
.raffle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    z-index: 1000;
}

/* Floating Contestants */
.floating-contestants {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.contestant-name {
    position: absolute;
    font-size: 20px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-out;
    z-index: 1;
}

.contestant-name:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2;
}

/* Winner Display */
.winner-grid {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    grid-template-columns: repeat(auto-fit, minmax(calc(100% / 5), 1fr)); /* Ensures max 5 columns */
    gap: 15px;
    padding: 20px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    place-items: center;
    overflow-y: auto;
}

.winner-block {
    position: relative;
    width: 100%;
    min-height: 100px;
    height: auto;
    max-width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
    animation: glowPulse 2s infinite;
}

.winner-block .prize {
    font-size: 20px;
    font-weight: bold;
    color: #d700ff;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
}

.winner-block .name {
    font-size: 16px;
    color: #ffffff;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
}

.winner-block.center-reveal {
    position: fixed;
    top: 50%;
    left: 50%;
    max-width: 300px;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background-color: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 50px rgba(215, 0, 255, 0.3);
    height: 120px;
}

.winner-block.highlight {
    animation: highlightBlock 1s ease-out;
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 4px 15px rgba(215, 0, 255, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(215, 0, 255, 0.4);
    }
    100% {
        box-shadow: 0 4px 15px rgba(215, 0, 255, 0.2);
    }
}

@keyframes highlightBlock {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
        box-shadow: 0 0 0 rgba(215, 0, 255, 0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
        box-shadow: 0 0 100px rgba(215, 0, 255, 0.8);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 50px rgba(215, 0, 255, 0.3);
    }
}

@keyframes moveToGrid {
    to {
        transform: translate(0, 0);
        position: relative;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
}

/* Signup Form */
.raffle-signup-form {
    margin: 20px 0;
}

.raffle-signup-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.raffle-signup-button:hover {
    background-color: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.raffle-message {
    padding: 12px 20px;
    border-radius: 4px;
    background-color: #f0f0f1;
    border-left: 4px solid #72aee6;
    margin: 20px 0;
}

.raffle-message.success {
    background-color: #f0f6e6;
    border-left-color: #00a32a;
}

.raffle-message.error {
    background-color: rgba(220, 50, 50, 0.9);
}

/* Loading State */
.raffle-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border-radius: 10px;
    color: white;
    font-size: 18px;
    z-index: 1000;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}
