/* Animations and Background Effects */

/* Floating particles background */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.4;
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Background particle effects */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
    animation: gradientShift 15s ease-in-out infinite;
    z-index: 1;
}

/* Floating elements */
.feature-card {
    animation: slideInUp 0.8s ease-out;
}

.feature-card:nth-child(1) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.3s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.5s;
}

/* Hero section animations */
.hero-title {
    animation: slideInLeft 1s ease-out;
}

.hero-subtitle {
    animation: slideInLeft 1s ease-out 0.2s both;
}

.hero-description {
    animation: slideInLeft 1s ease-out 0.4s both;
}

.hero-buttons {
    animation: slideInLeft 1s ease-out 0.6s both;
}

.hero-image {
    animation: slideInRight 1s ease-out 0.3s both;
}

/* Button hover animations */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::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: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Feature card hover effects */
.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: rotate 10s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Step number animations */
.step-number {
    animation: pulse 2s ease-in-out infinite;
}

.step:nth-child(1) .step-number {
    animation-delay: 0s;
}

.step:nth-child(2) .step-number {
    animation-delay: 0.5s;
}

.step:nth-child(3) .step-number {
    animation-delay: 1s;
}

/* Login and Register section animations */
.login-info {
    animation: slideInLeft 0.8s ease-out;
}

.login-image {
    animation: slideInRight 0.8s ease-out 0.2s both;
}

.register-image {
    animation: slideInLeft 0.8s ease-out;
}

.register-info {
    animation: slideInRight 0.8s ease-out 0.2s both;
}

/* Footer animations */
.footer-section {
    animation: fadeIn 0.8s ease-out;
}

.footer-section:nth-child(1) {
    animation-delay: 0.1s;
}

.footer-section:nth-child(2) {
    animation-delay: 0.3s;
}

.footer-section:nth-child(3) {
    animation-delay: 0.5s;
}

/* Navigation animations */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #00d4ff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

/* Logo animation */
.nav-logo img {
    transition: transform 0.3s ease;
}

.nav-logo img:hover {
    transform: scale(1.1);
}

/* Background grid animation */
.hero::before {
    animation: float 20s ease-in-out infinite;
}

/* Responsive animations */
@media (max-width: 768px) {
    .hero-title,
    .hero-subtitle,
    .hero-description,
    .hero-buttons {
        animation: slideInUp 0.8s ease-out;
    }
    
    .hero-image {
        animation: slideInUp 0.8s ease-out 0.3s both;
    }
    
    .login-content,
    .register-content {
        animation: slideInUp 0.8s ease-out;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading animations */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll-triggered animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Hover state improvements */
.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 212, 255, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Focus states for accessibility */
.btn:focus,
.nav-link:focus,
.footer-section a:focus {
    outline: 3px solid #00d4ff;
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.3s ease;
}

/* Special effects for casino theme */
.casino-glow {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.casino-glow:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
}

/* Animated background for sections */
.features,
.login-section,
.register-section,
.download-section {
    position: relative;
    overflow: hidden;
}

.features::before,
.login-section::before,
.register-section::before,
.download-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.02) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    z-index: 0;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Ensure content is above background effects */
.features > *,
.login-section > *,
.register-section > *,
.download-section > * {
    position: relative;
    z-index: 1;
}
