/**
 * Advanced Lootbox Animations CSS
 * CS:GO-style slider animations en effects
 */

/* Slider Container */
.alb-slider-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(to bottom, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
    margin: 30px 0;
}

.alb-slider-track {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 200px;
    will-change: transform;
}

/* Individual Slider Items */
.alb-slider-item {
    flex-shrink: 0;
    width: 150px;
    height: 200px;
    margin-right: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.alb-slider-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.alb-slider-item:hover::before {
    left: 100%;
}

.alb-slider-item img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.alb-item-placeholder {
    font-size: 60px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.alb-item-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
    max-width: 100%;
}

/* Center Indicator */
.alb-slider-indicator {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, 
        transparent 0%,
        #FFD700 20%,
        #FFD700 80%,
        transparent 100%);
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 0 20px #FFD700;
    animation: pulse-indicator 2s ease-in-out infinite;
}

.alb-slider-indicator::before,
.alb-slider-indicator::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
}

.alb-slider-indicator::before {
    top: -10px;
    border-bottom: 15px solid #FFD700;
}

.alb-slider-indicator::after {
    bottom: -10px;
    border-top: 15px solid #FFD700;
}

@keyframes pulse-indicator {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Item Highlight tijdens animatie */
.alb-item-highlight {
    transform: scale(1.05);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Winning Item */
.alb-item-won {
    transform: scale(1.1);
    border: 3px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: won-pulse 1s ease-in-out infinite;
}

@keyframes won-pulse {
    0%, 100% { 
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 0 0 40px rgba(255, 215, 0, 1);
    }
}

.alb-item-glow {
    box-shadow: 0 0 50px rgba(255, 215, 0, 1);
}

/* Rarity Colors */
.alb-slider-item[data-rarity="common"] {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    border-color: rgba(149, 165, 166, 0.3);
}

.alb-slider-item[data-rarity="uncommon"] {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border-color: rgba(39, 174, 96, 0.3);
}

.alb-slider-item[data-rarity="rare"] {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-color: rgba(52, 152, 219, 0.3);
}

.alb-slider-item[data-rarity="epic"] {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    border-color: rgba(155, 89, 182, 0.3);
}

.alb-slider-item[data-rarity="legendary"] {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    border-color: rgba(243, 156, 18, 0.5);
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.4);
}

/* Confetti */
.alb-confetti {
    position: absolute;
    pointer-events: none;
    animation: confetti-fall 2s ease-out forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Simple Box Animation (fallback) */
.alb-simple-box {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.alb-simple-box.opening {
    animation: shake 0.5s ease-in-out infinite;
}

.alb-simple-box.opened {
    animation: pop 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg) scale(1.05); }
    75% { transform: rotate(10deg) scale(1.05); }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Loading overlay */
.alb-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 15px;
}

.alb-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Glow effects voor verschillende rarities */
.alb-slider-item[data-rarity="legendary"].alb-item-won {
    animation: legendary-glow 1s ease-in-out infinite;
}

@keyframes legendary-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(243, 156, 18, 0.8),
                    0 0 50px rgba(231, 76, 60, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(243, 156, 18, 1),
                    0 0 70px rgba(231, 76, 60, 0.7),
                    inset 0 0 20px rgba(255, 255, 255, 0.3);
    }
}

.alb-slider-item[data-rarity="epic"].alb-item-won {
    animation: epic-glow 1s ease-in-out infinite;
}

@keyframes epic-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(155, 89, 182, 0.8);
    }
    50% {
        box-shadow: 0 0 40px rgba(155, 89, 182, 1),
                    0 0 60px rgba(155, 89, 182, 0.6);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .alb-slider-container {
        height: 200px;
    }
    
    .alb-slider-track {
        height: 160px;
    }
    
    .alb-slider-item {
        width: 120px;
        height: 160px;
        padding: 10px;
    }
    
    .alb-slider-item img {
        max-width: 60px;
        max-height: 60px;
    }
    
    .alb-item-placeholder {
        font-size: 40px;
    }
    
    .alb-item-name {
        font-size: 11px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .alb-slider-track,
    .alb-slider-item,
    .alb-simple-box,
    .alb-confetti {
        animation: none !important;
        transition: none !important;
    }
    
    .alb-slider-indicator {
        animation: none;
        opacity: 0.7;
    }
}
