/* ==========================================
   ANIMATIONS & EFFECTS
   ========================================== */

/* Keyframes */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 0, 0, 0.5); }
    50% { box-shadow: 0 0 40px rgba(139, 0, 0, 0.9); }
}

@keyframes glowPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
        filter: brightness(1);
    }
    50% { 
        box-shadow: 0 0 60px rgba(255, 215, 0, 1), 0 0 100px rgba(255, 215, 0, 0.5);
        filter: brightness(1.3);
    }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-8px, 8px); }
    20%, 40%, 60%, 80% { transform: translate(8px, -8px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.9; }
}

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

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

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

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes particleFall {
    0% { 
        transform: translateY(-100vh) rotate(0deg); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(100vh) rotate(360deg); 
        opacity: 0; 
    }
}

@keyframes confetti {
    0% { 
        transform: translateY(-100vh) rotate(0deg) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(100vh) rotate(720deg) scale(0.5); 
        opacity: 0; 
    }
}

/* Animation Classes */
.flame {
    animation: flicker 1s infinite;
}

.glow {
    animation: glow 2s infinite;
}

.glow-pulse {
    animation: glowPulse 2s infinite;
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

.pulse {
    animation: pulse 2s infinite;
}

.slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

.slide-down {
    animation: slideDown 0.8s ease-out forwards;
}

.zoom-in {
    animation: zoomIn 0.6s ease-out forwards;
}

.zoom-out {
    animation: zoomOut 0.6s ease-out forwards;
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Particle System */
.particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: particleFall 3s linear forwards;
}

.confetti-piece {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: confetti 4s linear forwards;
}

/* Notification System */
.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 1.5rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease-out;
    max-width: 90%;
    text-align: center;
}

.notification-success {
    background: rgba(0, 200, 0, 0.95);
    border: 2px solid #00ff00;
    color: #fff;
}

.notification-error {
    background: rgba(200, 0, 0, 0.95);
    border: 2px solid #ff0000;
    color: #fff;
}

.notification-info {
    background: rgba(100, 100, 100, 0.95);
    border: 2px solid #666;
    color: #fff;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: rgba(10, 0, 0, 0.95);
    border: 4px solid rgba(139, 0, 0, 0.8);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(139, 0, 0, 0.5);
    animation: zoomIn 0.4s ease-out;
}

/* Button Styles */
.btn {
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
}

.btn-primary {
    background: linear-gradient(135deg, #8b0000, #5a0000);
    border: 2px solid #8b0000;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a00000, #700000);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 0, 0, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: 2px solid #ffd700;
    color: #000;
}

.btn-success:hover {
    background: linear-gradient(135deg, #ffed4e, #ffa500);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
}

.btn-large {
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

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

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    filter: brightness(1.2);
}

/* Text Effects */
.text-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
