/**
 * Prize Wheel Winner Animation Styles
 * Professional modal overlay and animation styles
 */

/* Modal Overlay */
.wheel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Modal Content Container */
.wheel-modal-content {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    border-radius: 24px;
    padding: 2rem;
    max-width: 1200px;
    width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s backwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5) translateY(100px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Header Section */
.wheel-modal-header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.wheel-modal-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.wheel-modal-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Canvas Container */
.wheel-canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
    position: relative;
    flex-shrink: 0;
}

#wheelCanvas {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.3));
    animation: wheelAppear 0.8s ease-out 0.5s backwards;
}

@keyframes wheelAppear {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Confetti Canvas */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

/* Winner Announcement Card */
.winner-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    max-width: 90vw;
    width: 500px;
    opacity: 0;
}

.winner-card.show {
    animation: winnerPopup 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes winnerPopup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    }
    60% {
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

.winner-card h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #0d9488;
    margin-bottom: 0.5rem;
}

.winner-customer-id {
    font-size: 2.5rem;
    font-weight: 900;
    color: #0f766e;
    margin: 1rem 0;
    letter-spacing: 0.05em;
}

.winner-details {
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0.75rem 0;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.share-btn-facebook {
    background: #1877f2;
    color: white;
}

.share-btn-twitter {
    background: #1da1f2;
    color: white;
}

.share-btn-whatsapp {
    background: #25d366;
    color: white;
}

.share-btn-copy {
    background: #6b7280;
    color: white;
}

.share-btn-download {
    background: #8b5cf6;
    color: white;
}

/* Close Button */
.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Loading Spinner */
.wheel-loading {
    text-align: center;
    color: white;
    padding: 2rem;
}

.wheel-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Countdown Timer */
.countdown-timer {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.countdown-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.countdown-display {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-value {
    font-size: 2rem;
    font-weight: 800;
}

.countdown-text {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
}

/* Progress Bar */
.countdown-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.countdown-progress-bar {
    height: 100%;
    background: white;
    transition: width 1s linear;
    border-radius: 2px;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wheel-modal-content {
        padding: 1rem;
        border-radius: 16px;
        width: 98vw;
        max-height: 98vh;
    }
    
    .wheel-modal-header {
        margin-bottom: 1rem;
    }
    
    .wheel-modal-title {
        font-size: 1.5rem;
    }
    
    .wheel-modal-subtitle {
        font-size: 0.9rem;
    }
    
    .wheel-canvas-container {
        margin: 0.5rem auto;
    }
    
    #wheelCanvas {
        max-width: 95vw !important;
        max-height: 50vh !important;
        width: auto !important;
        height: auto !important;
    }
    
    .winner-card {
        width: 90vw;
        padding: 1.5rem;
    }
    
    .winner-customer-id {
        font-size: 1.75rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .countdown-display {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .wheel-modal-content {
        padding: 0.75rem;
        max-width: 98vw;
        border-radius: 12px;
    }
    
    .wheel-modal-header {
        margin-bottom: 0.75rem;
    }
    
    .wheel-modal-title {
        font-size: 1.25rem;
    }
    
    .wheel-modal-subtitle {
        font-size: 0.85rem;
    }
    
    #wheelCanvas {
        max-width: 92vw !important;
        max-height: 45vh !important;
    }
    
    .winner-card {
        width: 95vw;
        padding: 1.25rem;
    }
    
    .winner-card h2 {
        font-size: 1.35rem;
    }
    
    .winner-customer-id {
        font-size: 1.5rem;
    }
    
    .winner-details {
        font-size: 0.95rem;
    }
}

/* Print Styles */
@media print {
    .wheel-modal-overlay {
        position: relative;
        background: white;
    }
    
    .modal-close-btn,
    .share-buttons {
        display: none;
    }
}

