/**
 * WooCommerce Lootbox Demo Animations
 * 
 * CSS for demo mode specific animations and effects
 * Version: 1.2.0
 */

/* Demo Button Styles */
.wc-lootbox-demo-button-wrapper {
    margin: 20px 0;
    text-align: center;
}

.wc-lootbox-demo-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wc-lootbox-demo-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.wc-lootbox-demo-button:active {
    transform: translateY(-1px);
}

.wc-lootbox-demo-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.wc-lootbox-demo-button:hover::before {
    left: 100%;
}

.demo-icon {
    font-size: 20px;
    animation: bounce 2s infinite;
}

.demo-text {
    flex: 1;
}

.demo-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Context-specific button styles */
.wc-lootbox-demo-button-product {
    width: 100%;
    margin-top: 15px;
    justify-content: center;
}

.wc-lootbox-demo-button-shop {
    margin-top: 10px;
    font-size: 14px;
    padding: 12px 20px;
}

.wc-lootbox-demo-button-my-account {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 20px rgba(240, 147, 251, 0.4);
    margin-bottom: 30px;
}

.wc-lootbox-demo-button-my-account:hover {
    box-shadow: 0 12px 30px rgba(240, 147, 251, 0.6);
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

/* Demo Spinner Styles */
.demo-spinner-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.spinner-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.tension-meter {
    max-width: 400px;
    margin: 0 auto;
}

.tension-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tension-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10ac84, #ffd700, #ff6b6b);
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: pulse-tension 1.5s infinite;
}

.tension-text {
    font-size: 14px;
    color: #b8c6db;
    font-style: italic;
}

@keyframes pulse-tension {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Demo Raffle Roller */
.demo-raffle-roller {
    width: 100%;
    margin: 30px 0;
    position: relative;
}

.demo-raffle-holder {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 15px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
    border: 3px solid #ffd700;
}

.demo-raffle-holder:before, 
.demo-raffle-holder:after {
    content: '';
    position: absolute;
    top: 0;
    width: 120px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.demo-raffle-holder:before {
    left: 0;
    background: linear-gradient(to right, rgba(44,62,80,1) 0%, rgba(44,62,80,0) 100%);
}

.demo-raffle-holder:after {
    right: 0;
    background: linear-gradient(to left, rgba(44,62,80,1) 0%, rgba(44,62,80,0) 100%);
}

.demo-raffle-container {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transition: transform 8s cubic-bezier(0.08, 0.6, 0, 1);
}

.demo-center-indicator {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 6px;
    background: linear-gradient(to bottom, #ffd700, #ff6b6b, #ffd700);
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: glow-indicator 2s infinite;
}

@keyframes glow-indicator {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
        opacity: 0.8;
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 215, 0, 1);
        opacity: 1;
    }
}

/* Demo Prize Items */
.demo-prize-item {
    width: 120px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 3px solid #ddd;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
}

.demo-prize-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.demo-prize-item img {
    max-width: 85%;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 8px;
}

.demo-prize-item .prize-name {
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
    padding: 0 8px;
    color: #333;
    font-weight: 600;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 90%;
}

.demo-prize-item .prize-value {
    font-size: 12px;
    font-weight: 700;
    color: #10ac84;
    margin-top: 5px;
}

/* Rarity-based styling */
.demo-prize-item.common {
    border-color: #95a5a6;
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
}

.demo-prize-item.rare {
    border-color: #3498db;
    background: linear-gradient(135deg, #ebf4ff, #d6eaff);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.4);
}

.demo-prize-item.epic {
    border-color: #9b59b6;
    background: linear-gradient(135deg, #f4ecff, #e8d5ff);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.5);
}

.demo-prize-item.legendary {
    border-color: #f1c40f;
    background: linear-gradient(135deg, #fff9e6, #ffeaa7);
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.6);
    animation: legendary-glow 2s infinite;
}

@keyframes legendary-glow {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(241, 196, 15, 0.6);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 35px rgba(241, 196, 15, 0.8);
        transform: scale(1.02);
    }
}

.demo-winning-item {
    transform: scale(1.15) !important;
    border-color: #FFD700 !important;
    box-shadow: 0 0 40px rgba(255,215,0,0.9) !important;
    z-index: 10;
    animation: winner-celebration 2s infinite;
}

@keyframes winner-celebration {
    0%, 100% { 
        transform: scale(1.15) rotate(0deg);
        box-shadow: 0 0 40px rgba(255,215,0,0.9);
    }
    25% { 
        transform: scale(1.18) rotate(1deg);
        box-shadow: 0 0 50px rgba(255,215,0,1);
    }
    75% { 
        transform: scale(1.18) rotate(-1deg);
        box-shadow: 0 0 50px rgba(255,215,0,1);
    }
}

/* Value Tracker */
.demo-value-tracker {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.value-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.value-label {
    color: #b8c6db;
    font-size: 16px;
}

.value-amount {
    color: #ffd700;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: value-pulse 1.5s infinite;
}

@keyframes value-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Sound Controls */
.demo-sound-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.sound-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Near Miss Styles */
.near-miss-content {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

.near-miss-title {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 30px;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.near-miss-items {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.almost-won-item {
    position: relative;
    text-align: center;
    padding: 20px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 15px;
    border: 2px solid #ff6b6b;
}

.item-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255,107,107,0.3) 0%, transparent 70%);
    border-radius: 25px;
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.almost-won-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
}

.almost-won-info {
    margin-bottom: 15px;
}

.almost-won-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 5px;
}

.almost-won-value {
    font-size: 24px;
    font-weight: 900;
    color: #ff6b6b;
}

.almost-text {
    background: #ff6b6b;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: flash 1s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.near-miss-message {
    font-size: 18px;
    color: #b8c6db;
    font-style: italic;
}

/* Prize Reveal Styles */
.prize-reveal-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.reveal-title {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: celebration-bounce 1s infinite;
}

@keyframes celebration-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.reveal-subtitle {
    font-size: 20px;
    color: #b8c6db;
}

.demo-prize-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.prize-image-container {
    position: relative;
    width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    border: 4px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    overflow: hidden;
}

.rarity-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%);
    border-radius: 30px;
    animation: prize-glow 2s infinite;
}

@keyframes prize-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

#wc-lootbox-demo-prize-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

.rarity-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
}

.demo-prize-details {
    flex: 1;
    min-width: 300px;
    color: white;
}

.demo-prize-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.demo-prize-description {
    font-size: 16px;
    color: #b8c6db;
    margin-bottom: 20px;
    line-height: 1.5;
}

.demo-prize-value,
.demo-prize-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.value-label,
.brand-label {
    font-size: 14px;
    color: #b8c6db;
    min-width: 120px;
}

.value-amount {
    font-size: 24px;
    font-weight: 900;
    color: #10ac84;
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    color: #ffd700;
}

/* Call to Action */
.demo-cta-section {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.cta-message {
    margin-bottom: 30px;
}

.cta-message h3 {
    font-size: 24px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 10px;
}

.cta-message p {
    font-size: 16px;
    color: #b8c6db;
}

.demo-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Background Particles */
.demo-particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: float-particle 6s infinite linear;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; }

@keyframes float-particle {
    0% { 
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Demo Toast Notifications */
.demo-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10ac84, #1dd1a1);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(16, 172, 132, 0.3);
    z-index: 1000000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.demo-toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-weight: 600;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .demo-prize-showcase {
        flex-direction: column;
        gap: 20px;
    }
    
    .prize-image-container {
        width: 200px;
        height: 200px;
    }
    
    .demo-prize-details {
        min-width: auto;
        text-align: center;
    }
    
    .demo-actions {
        flex-direction: column;
    }
    
    .demo-raffle-holder {
        height: 150px;
    }
    
    .demo-prize-item {
        width: 100px;
        height: 150px;
    }
    
    .wc-lootbox-demo-title {
        font-size: 28px;
    }
    
    .reveal-title {
        font-size: 32px;
    }
}