/* ========================================
   EFFECTS CSS - Animazioni
   ======================================== */

/* ANIMAZIONI GLOBALI */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* PULSE ANIMATION (slot attivi) */
@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    }
    50% { 
        box-shadow: 0 0 30px rgba(0, 212, 255, 1);
    }
}

/* GLOW ANIMATION (deck attivi) */
@keyframes glowDeck {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(255, 204, 0, 0.8);
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 204, 0, 1);
    }
}

/* SHUFFLE ANIMATION */
@keyframes shuffle {
    0%, 100% { 
        transform: rotate(0deg);
    }
    25% { 
        transform: rotate(-5deg) translateX(-10px);
    }
    50% { 
        transform: rotate(5deg) translateX(10px);
    }
    75% { 
        transform: rotate(-3deg) translateX(-5px);
    }
}

/* PHASE OVERLAY ANIMATION */
#phase-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-overlay);
    animation: fadeIn 0.3s ease;
}

#phase-overlay.show {
    display: flex;
}

.phase-title {
    font-size: 80px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 5px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: phaseAppear 1s ease;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

@keyframes phaseAppear {
    0% { 
        transform: scale(0.5);
        opacity: 0;
    }
    50% { 
        transform: scale(1.1);
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* CARD DRAW ANIMATION */
.card-draw-animation {
    animation: cardDraw 0.5s ease;
}

@keyframes cardDraw {
    0% {
        transform: translateY(-50px) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* CARD PLACE ANIMATION */
.card-place-animation {
    animation: cardPlace 0.3s ease;
}

@keyframes cardPlace {
    0% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* HOVER GLOW EFFECT */
.glow {
    position: relative;
}

.glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--color-primary), 
        var(--color-secondary), 
        var(--color-accent)
    );
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow:hover::before {
    opacity: 1;
}

/* SHAKE ANIMATION (errore) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.3s ease;
}

/* BOUNCE ANIMATION */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 1s ease;
}

/* ROTATE ANIMATION */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate {
    animation: rotate 2s linear infinite;
}

/* VICTORY OVERLAY */
#victory-overlay {
    animation: fadeIn 0.5s ease;
}

/* SHIMMER EFFECT */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* FLIP CARD ANIMATION */
.card-flip {
    animation: flip 0.6s ease;
}

@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

/* SCALE IN */
.scale-in {
    animation: scaleIn 0.3s ease;
}

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

/* TRANSITIONS GLOBALI */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.6s ease;
}

/* HOVER EFFECTS UTILITIES */
.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}
