/* Animations CSS */

/* Flame Animation for Logo */
@keyframes flicker {
    0% { opacity: 1; }
    25% { opacity: 0.8; }
    50% { opacity: 0.9; }
    75% { opacity: 0.7; }
    100% { opacity: 1; }
}

.flame-icon {
    animation: flicker 1.5s infinite alternate;
}

/* Pulsing Animation for CTA Button */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(255, 69, 0, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 8px 25px rgba(255, 69, 0, 0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(255, 69, 0, 0.4); }
}

.cta-button {
    animation: pulse 2s infinite;
}

.cta-button:hover {
    animation: none;
}

/* Shake Animation for Game Cards */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(3px); }
    50% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

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

/* Floating Animation for Modal */
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.modal-icon {
    animation: float 3s ease-in-out infinite;
}

/* Glowing Border Animation */
@keyframes glow {
    0% { box-shadow: 0 0 10px rgba(255, 69, 0, 0.3); border-color: rgba(255, 69, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 69, 0, 0.7); border-color: rgba(255, 69, 0, 0.8); }
    100% { box-shadow: 0 0 10px rgba(255, 69, 0, 0.3); border-color: rgba(255, 69, 0, 0.5); }
}

.testimonial-card:hover,
.info-card:hover,
.feature:hover {
    animation: glow 2s ease-in-out infinite;
}

/* Fade-in Animation for Sections */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

section {
    animation: fadeIn 0.8s ease-out;
}

/* Fire Text Effect for Section Headers */
@keyframes fireText {
    0% { text-shadow: 0 -1px 4px #FFF, 0 -2px 10px #ff0, 0 -10px 20px #ff8000; }
    50% { text-shadow: 0 -1px 4px #FFF, 0 -2px 10px #ff0, 0 -10px 20px #ff8000, 0 -18px 40px #F00; }
    100% { text-shadow: 0 -1px 4px #FFF, 0 -2px 10px #ff0, 0 -10px 20px #ff8000; }
}

h2 {
    animation: fireText 2s infinite alternate;
}

/* Flame Border Animation */
@keyframes flameBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-card:hover,
.hot-game:hover,
.testimonial-card:hover,
.contact-form-container:hover,
.info-card:hover,
.legal-container:hover {
    border-image: linear-gradient(45deg, var(--primary-dark), var(--primary-color), var(--accent-color), var(--primary-color), var(--primary-dark)) 1;
    border-image-slice: 1;
    animation: flameBorder 3s ease infinite;
    border-width: 1px;
    border-style: solid;
}

/* Button Fire Effect */
.play-button::before,
.submit-button::before,
.modal-button::before,
.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

.play-button:hover::before,
.submit-button:hover::before,
.modal-button:hover::before,
.back-button:hover::before {
    left: 100%;
}

/* Social Icon Spin */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.social-icons a:hover i {
    animation: spin 0.5s ease-in-out;
}

/* Nav Links Hover Effect */
.nav-links a:hover {
    text-shadow: 0 0 10px var(--primary-color);
}

/* Form Input Focus Animation */
@keyframes formFocus {
    0% { box-shadow: 0 0 0 0 rgba(255, 69, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 69, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 69, 0, 0); }
}

.form-group input:focus,
.form-group textarea:focus {
    animation: formFocus 1s ease-in-out;
}

/* Stars Twinkling Animation for Ratings */
@keyframes twinkle {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.8; transform: scale(1); }
}

.rating i {
    animation: twinkle 2s infinite;
}

.rating i:nth-child(1) { animation-delay: 0.0s; }
.rating i:nth-child(2) { animation-delay: 0.3s; }
.rating i:nth-child(3) { animation-delay: 0.6s; }
.rating i:nth-child(4) { animation-delay: 0.9s; }
.rating i:nth-child(5) { animation-delay: 1.2s; }

/* Mobile Menu Toggle Animation */
@keyframes burn {
    0% { color: var(--primary-color); }
    50% { color: var(--accent-color); }
    100% { color: var(--primary-color); }
}

.mobile-menu-toggle i {
    animation: burn 2s infinite;
}

/* Carousel Card Slide Animation */
@keyframes slideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.hot-game {
    animation: slideIn 0.5s ease-out;
}

/* Logo Flame Text Effect */
@keyframes flameText {
    0% { text-shadow: 0 0 10px var(--primary-color); }
    50% { text-shadow: 0 0 20px var(--primary-light), 0 0 30px var(--accent-color); }
    100% { text-shadow: 0 0 10px var(--primary-color); }
}

.logo span {
    animation: flameText 2s infinite;
}

/* Footer Social Hover Animation */
.social-icons a:hover {
    transform: translateY(-5px) rotate(10deg);
}

/* Modal Button Shine Effect */
@keyframes shine {
    0% { background-position: -100px; }
    20% { background-position: 200px; }
    100% { background-position: 200px; }
}

.modal-button:hover {
    background-image: linear-gradient(to right, var(--primary-dark) 0%, var(--primary-color) 20%, var(--primary-color) 40%, var(--primary-light) 50%, var(--primary-color) 60%, var(--primary-color) 80%, var(--primary-dark) 100%);
    background-size: 300px;
    animation: shine 2s infinite;
    background-position: -100px;
}

/* Game Card Image Zoom Effect */
.game-image img,
.hot-game-image img {
    transition: transform 0.5s ease;
}

.game-card:hover .game-image img,
.hot-game:hover .hot-game-image img {
    transform: scale(1.1);
}

/* Back to Top Button Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.back-to-top {
    animation: bounce 2s infinite;
}

/* Page Transition Animation */
@keyframes pageTransition {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

body {
    animation: pageTransition 0.5s ease-in;
}

/* Rating Stars Color Animation */
@keyframes colorChange {
    0% { color: var(--primary-color); }
    50% { color: var(--accent-color); }
    100% { color: var(--primary-color); }
}

.testimonial-card:hover .rating i {
    animation: colorChange 2s infinite;
}

/* CTA Button Gradient Animation */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.cta-button:hover {
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color), var(--primary-light), var(--accent-color));
    background-size: 300% 300%;
    animation: gradientBG 3s ease infinite;
}

/* Loading Animation */
@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    width: 40px;
    height: 40px;
    border: 5px solid rgba(255, 69, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: rotate 1s infinite linear;
}

/* Modal Appear Animation */
@keyframes slideDown {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.modal.show .modal-content {
    animation: slideDown 0.5s ease-out;
}