/* Z3U5 DJ Website - Enhanced Animations & Effects CSS */

/* ============================================
   1. SCROLL-TRIGGERED ANIMATIONS
   ============================================ */

/* Base state for scroll animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for cards */
.track-card,
.blog-card,
.event-card {
    transition-delay: 0s !important;
}

/* Fade in from different directions */
.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.fade-in-up.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.fade-in-left.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.fade-in-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   2. 3D HOVER EFFECTS ON CARDS
   ============================================ */

/* Track Cards 3D Effect */
.track-card {
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.track-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 212, 255, 0) 100%);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.track-card:hover::before {
    opacity: 1;
}

.track-card:hover {
    transform: translateY(-15px) rotateX(5deg) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 212, 255, 0.15),
        0 0 0 1px rgba(0, 212, 255, 0.1);
}

/* Blog Cards 3D Effect */
.blog-card {
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 212, 255, 0) 100%);
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.blog-card:hover::before {
    opacity: 1;
}

.blog-card:hover {
    transform: translateY(-15px) rotateX(5deg) scale(1.02);
}

/* Info Cards 3D Effect */
.info-card {
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.info-card:hover {
    transform: translateY(-10px) rotateX(3deg) scale(1.02);
}

/* Floating animation for icons */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.info-icon {
    animation: float 3s ease-in-out infinite;
}

.info-card:hover .info-icon {
    animation-play-state: paused;
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   3. PARTICLE BACKGROUND & HERO ANIMATIONS
   ============================================ */

/* Hero content fade in */
.hero-content {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

.hero-content.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Hero title glow effect */
.hero-title {
    position: relative;
    text-shadow: 
        0 0 10px rgba(0, 212, 255, 0.5),
        0 0 20px rgba(0, 212, 255, 0.3),
        0 0 30px rgba(0, 212, 255, 0.2);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 
            0 0 10px rgba(0, 212, 255, 0.5),
            0 0 20px rgba(0, 212, 255, 0.3),
            0 0 30px rgba(0, 212, 255, 0.2);
    }
    to {
        text-shadow: 
            0 0 20px rgba(0, 212, 255, 0.8),
            0 0 30px rgba(0, 212, 255, 0.5),
            0 0 40px rgba(0, 212, 255, 0.3);
    }
}

/* Hero social icons animation */
.hero-social a {
    animation: fadeInUp 0.6s ease-out backwards;
}

.hero-social a:nth-child(1) { animation-delay: 0.2s; }
.hero-social a:nth-child(2) { animation-delay: 0.3s; }
.hero-social a:nth-child(3) { animation-delay: 0.4s; }
.hero-social a:nth-child(4) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   4. FORM VALIDATION ANIMATIONS
   ============================================ */

/* Input field states */
.form-group {
    position: relative;
}

input, textarea, select {
    transition: all 0.3s ease;
}

input.success,
textarea.success,
select.success {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.05) !important;
}

input.error,
textarea.error,
select.error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
    animation: shake-field 0.4s ease;
}

@keyframes shake-field {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Error message */
.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success checkmark icon for valid fields */
input.success::after,
textarea.success::after {
    content: '✓';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-weight: bold;
}

/* Form shake animation */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Success overlay animation */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-overlay.show {
    opacity: 1;
}

.success-checkmark {
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.checkmark {
    width: 100px;
    height: 100px;
    display: block;
    margin: 0 auto 20px;
}

.checkmark-circle {
    stroke: #00d4ff;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: #00d4ff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    to {
        stroke-dashoffset: 0;
    }
}

.success-checkmark p {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'Orbitron', sans-serif;
}

/* ============================================
   5. LOADING ANIMATIONS & PAGE TRANSITIONS
   ============================================ */

/* Page loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: #00d4ff;
    margin-bottom: 30px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Image loading effect */
img {
    transition: opacity 0.3s ease, filter 0.3s ease;
}

img.loading {
    opacity: 0.5;
    filter: blur(10px);
}

img.loaded {
    opacity: 1;
    filter: blur(0);
}

img.reveal {
    animation: revealImage 0.6s ease-out;
}

@keyframes revealImage {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #00d4ff;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #00bfea;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

/* Button loading state */
button.loading {
    position: relative;
    color: transparent !important;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Smooth transitions for all interactive elements */
a, button, input, textarea, select {
    transition: all 0.3s ease;
}

/* Header scroll animation */
.header {
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(10, 10, 26, 0.98);
    box-shadow: 0 2px 20px rgba(0, 212, 255, 0.1);
}

/* Section title animations */
section h2 {
    position: relative;
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    transition: width 0.6s ease;
}

section.animate-in h2::after {
    width: 100%;
}

/* Glowing effect for important elements */
.glow-on-hover {
    position: relative;
}

.glow-on-hover::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00d4ff, #00ff88, #00d4ff);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(10px);
}

.glow-on-hover:hover::before {
    opacity: 0.7;
}

/* Ripple effect on click */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .track-card:hover,
    .blog-card:hover,
    .info-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .hero-title {
        animation: none;
        text-shadow: 
            0 0 10px rgba(0, 212, 255, 0.5),
            0 0 20px rgba(0, 212, 255, 0.3);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Performance optimization */
.track-card,
.blog-card,
.info-card,
.event-card {
    will-change: transform;
}

.track-card:hover,
.blog-card:hover {
    will-change: transform, box-shadow;
}