/* ============================================
   CUSTOM ANIMATIONS
============================================= */

/* Core Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(244, 63, 94, 0.3),
                    0 0 40px rgba(244, 63, 94, 0.2),
                    0 0 60px rgba(244, 63, 94, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(244, 63, 94, 0.5),
                    0 0 60px rgba(244, 63, 94, 0.3),
                    0 0 90px rgba(244, 63, 94, 0.2);
    }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    0%, 100% { border-color: transparent; }
    50% { border-color: #f43f5e; }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

@keyframes particleExplode {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--tx) * 1.5), calc(var(--ty) * 1.5)) scale(0);
    }
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow:
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 15px #fff,
            0 0 20px #f43f5e,
            0 0 35px #f43f5e,
            0 0 40px #f43f5e,
            0 0 50px #f43f5e,
            0 0 75px #f43f5e;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100px) skewX(-15deg);
        opacity: 0;
    }
    to {
        transform: translateX(0) skewX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px) skewX(15deg);
        opacity: 0;
    }
    to {
        transform: translateX(0) skewX(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation Utility Classes */
.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-glitch {
    animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

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

.animate-gradient {
    background: linear-gradient(-45deg, #f43f5e, #ec4899, #8b5cf6, #3b82f6);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.animate-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid;
    animation:
        typewriter 3.5s steps(40, end),
        blinkCursor 0.75s step-end infinite;
}

.animate-heart-beat {
    animation: heartBeat 1.2s ease-in-out;
}

.animate-slide-left {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-right {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Delay Utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* ============================================
   DARK MODE STYLES
============================================= */

:root[data-theme="dark"],
.dark {
    --tw-bg-opacity: 1;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: rgb(229 231 235 / var(--tw-text-opacity));
    background-attachment: fixed;
}

:root[data-theme="dark"] .bg-white,
.dark .bg-white {
    background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .text-gray-600,
.dark .text-gray-600 {
    color: rgb(156 163 175 / var(--tw-text-opacity));
}

:root[data-theme="dark"] .text-gray-800,
.dark .text-gray-800 {
    color: rgb(209 213 219 / var(--tw-text-opacity));
}

:root[data-theme="dark"] .text-gray-900,
.dark .text-gray-900 {
    color: rgb(243 244 246 / var(--tw-text-opacity));
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .bg-gray-50,
.dark .bg-gray-50 {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

:root[data-theme="dark"] .bg-rose-50,
.dark .bg-rose-50 {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.1) 0%, rgba(190, 18, 60, 0.2) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* ============================================
   THEME & TRANSITIONS
============================================= */

html {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(244, 63, 94, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.theme-toggle:active::before {
    width: 300px;
    height: 300px;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 10px 25px rgba(244, 63, 94, 0.3);
}

.epic-transition {
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   VISUAL EFFECTS
============================================= */

/* Neon Effects */
.neon-text {
    color: #fff;
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 15px #fff,
        0 0 20px #f43f5e,
        0 0 35px #f43f5e,
        0 0 40px #f43f5e,
        0 0 50px #f43f5e,
        0 0 75px #f43f5e;
    animation: neonFlicker 1.5s infinite;
}

.neon-border {
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.neon-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #f43f5e, #ec4899, #8b5cf6, #3b82f6);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.neon-border:hover::before {
    opacity: 1;
    animation: pulse-glow 2s infinite;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(45deg, #f43f5e, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
}

/* Glass Morphism */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-dark {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Particle Effects */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #f43f5e, #ec4899);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

/* ============================================
   HOVER & INTERACTION EFFECTS
============================================= */

.rise-effect {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rise-effect::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.7s ease;
}

.rise-effect:hover::before {
    left: 100%;
}

.rise-effect:hover {
    transform: translateY(-10px) scale(1.02) rotateX(5deg);
    box-shadow:
        0 20px 40px rgba(244, 63, 94, 0.3),
        0 0 60px rgba(244, 63, 94, 0.2),
        0 0 100px rgba(244, 63, 94, 0.1);
}

/* Like Button */
.like-btn-epic {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.like-btn-epic::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.like-btn-epic.liked::after {
    width: 300px;
    height: 300px;
}

.like-btn-epic:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 10px 20px rgba(244, 63, 94, 0.3),
        0 0 30px rgba(244, 63, 94, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Badge Cards */
.badge-card {
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.badge-card:hover {
    transform: translateY(-15px) rotateX(10deg) rotateY(5deg);
    box-shadow:
        0 25px 50px rgba(244, 63, 94, 0.4),
        0 0 80px rgba(244, 63, 94, 0.3),
        0 0 120px rgba(244, 63, 94, 0.2);
}

.badge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f43f5e, #ec4899, #8b5cf6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.badge-card:hover::before {
    transform: scaleX(1);
}

/* Section Reveal */
.section-reveal {
    opacity: 0;
    transform: translateY(100px) scale(0.9);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-reveal.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Cursor Effects */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid #f43f5e;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.2s ease;
}

.cursor-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #f43f5e;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s ease;
}

/* ============================================
   UTILITY CLASSES
============================================= */

/* Scroll Effects */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #f43f5e, #ec4899, #8b5cf6);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Loading Spinner */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(244, 63, 94, 0.3);
    border-top: 3px solid #f43f5e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Text Stroke */
.text-stroke {
    color: transparent;
    -webkit-text-stroke: 1px #f43f5e;
    text-stroke: 1px #f43f5e;
}

.text-stroke:hover {
    color: #f43f5e;
    -webkit-text-stroke: 1px transparent;
    text-stroke: 1px transparent;
    transition: color 0.3s ease;
}

/* 3D Transforms */
.transform-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.rotate-3d {
    transform: rotateX(10deg) rotateY(-10deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.rotate-3d:hover {
    transform: rotateX(0deg) rotateY(0deg);
}

/* Grid Pattern */
.grid-pattern {
    background-image:
        linear-gradient(rgba(244, 63, 94, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 63, 94, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: -1px -1px;
}

/* Pulsing Border */
.pulse-border {
    position: relative;
    border: 2px solid transparent;
}

.pulse-border::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #f43f5e;
    border-radius: inherit;
    animation: pulse-glow 2s infinite;
    z-index: -1;
}

/* Responsive Text */
.responsive-text {
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    line-height: 1.2;
}

/* Focus Effects */
.focus-glow:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(244, 63, 94, 0.1),
        0 0 0 6px rgba(244, 63, 94, 0.05),
        0 0 20px rgba(244, 63, 94, 0.2);
}

/* Image Filters */
.image-glow {
    filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.3));
    transition: filter 0.3s ease;
}

.image-glow:hover {
    filter: drop-shadow(0 0 20px rgba(244, 63, 94, 0.5));
}

/* Highlight Effect */
.highlight {
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(90deg, rgba(244, 63, 94, 0.2), rgba(236, 72, 153, 0.2));
    z-index: -1;
    transform: skewX(-15deg);
    transition: height 0.3s ease;
}

.highlight:hover::after {
    height: 100%;
}

/* ============================================
   SCROLL & LAYOUT
============================================= */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f43f5e 0%, #ec4899 100%);
    border-radius: 10px;
    border: 2px solid #1e293b;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ec4899 0%, #f43f5e 100%);
    transform: scale(1.1);
}

/* Scroll Snap */
.snap-container {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Gradient Mask */
.gradient-mask {
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* Background Noise */
.noise-bg {
    position: relative;
}

.noise-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   RESPONSIVE DESIGN
============================================= */

@media (max-width: 640px) {
    .badge-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .neon-text {
        text-shadow:
            0 0 3px #fff,
            0 0 6px #fff,
            0 0 9px #f43f5e,
            0 0 12px #f43f5e;
    }
}
