/**
 * Winners Notification Styles
 * Displays recent winners with smooth animations
 */

/* Container for all winner notifications */
.winners-notifications {
    position: fixed; /* Fixed on desktop, overridden on mobile */
    bottom: 80px;
    left: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
    max-width: 380px;
}

/* Individual notification */
.winner-notification {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.95) 0%, rgba(65, 60, 105, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(147, 51, 234, 0.3);
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideInLeft 0.4s ease forwards;
    min-width: 320px;
}

.winner-notification:hover {
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(147, 51, 234, 0.5);
}

/* Content wrapper */
.winner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Item image */
.winner-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.winner-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Winner details */
.winner-details {
    flex: 1;
    color: #ffffff;
    min-width: 0;
}

/* Header with flag and username */
.winner-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.winner-flag {
    font-size: 18px;
    line-height: 1;
}

.winner-username {
    font-weight: 600;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.winner-location {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* Winner text */
.winner-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}

.winner-text strong {
    color: #10b981;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Time */
.winner-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Remove animation */
.winner-notification.removing {
    animation: slideOutRight 0.3s ease forwards;
    pointer-events: none;
}

/* Pulse effect for new notifications */
@keyframes pulse {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                    0 0 20px rgba(147, 51, 234, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                    0 0 40px rgba(147, 51, 234, 0.6);
    }
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                    0 0 20px rgba(147, 51, 234, 0.3);
    }
}

.winner-notification {
    animation: slideInLeft 0.4s ease forwards, pulse 2s ease infinite;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .winners-notifications {
        position: fixed !important; /* Fixed position on mobile */
        bottom: 10px !important; /* Fixed at bottom edge */
        left: 10px !important;
        right: 10px !important;
        z-index: 9999 !important; /* High z-index to stay on top */
        padding: 0;
        margin: 0;
        max-width: calc(100% - 20px);
        flex-direction: column-reverse; /* New notifications appear at bottom */
    }
    
    .winner-notification {
        min-width: unset;
        width: 100%;
        padding: 8px 10px;
        background: linear-gradient(135deg, rgba(147, 51, 234, 0.95) 0%, rgba(65, 60, 105, 0.95) 100%);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
    }
    
    .winner-image {
        width: 40px;
        height: 40px;
    }
    
    .winner-header {
        font-size: 14px;
    }
    
    .winner-text {
        font-size: 13px;
    }
    
    .winner-time {
        font-size: 10px;
    }
}

/* Dark theme enhancement */
@media (prefers-color-scheme: dark) {
    .winner-notification {
        background: linear-gradient(135deg, rgba(147, 51, 234, 0.98) 0%, rgba(65, 60, 105, 0.98) 100%);
    }
}

/* Success badge animation */
@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Optional: Add a "WINNER" badge */
.winner-badge {
    position: absolute;
    top: -8px;
    right: 10px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    animation: bounceIn 0.5s ease;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}