/* ============================================
   PlayMinder — Custom Styles & Animations
   ============================================ */

/* ---- Base ---- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: #7C3AED;
    color: white;
}

/* ---- Navbar ---- */
#navbar {
    background: transparent;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

#navbar.scrolled {
    background: rgba(30, 27, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

#navbar.scrolled #logo-text {
    color: white;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #7C3AED, #EC4899);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ---- Sparkle Decorations ---- */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: sparkle 3s infinite;
}

.sparkle::before,
.sparkle::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.sparkle::before {
    width: 2px;
    height: 8px;
    top: -2px;
    left: 1px;
}

.sparkle::after {
    width: 8px;
    height: 2px;
    top: 1px;
    left: -2px;
}

.sparkle-1 { top: 10%; left: 5%; animation-delay: 0s; animation-duration: 2.5s; }
.sparkle-2 { top: 20%; right: 10%; animation-delay: 0.5s; animation-duration: 3s; }
.sparkle-3 { top: 40%; left: 15%; animation-delay: 1s; animation-duration: 2.8s; }
.sparkle-4 { top: 60%; right: 20%; animation-delay: 1.5s; animation-duration: 3.2s; }
.sparkle-5 { top: 15%; right: 30%; animation-delay: 0.3s; animation-duration: 2.6s; }
.sparkle-6 { top: 70%; left: 25%; animation-delay: 2s; animation-duration: 3.5s; }
.sparkle-7 { top: 30%; left: 40%; animation-delay: 0.8s; animation-duration: 2.4s; }
.sparkle-8 { top: 80%; right: 15%; animation-delay: 1.2s; animation-duration: 3.1s; }

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1) rotate(180deg);
    }
}

/* ---- Floating Shapes ---- */
.floating-shape {
    position: absolute;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    opacity: 0.08;
}

.shape-1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #7C3AED, #EC4899);
    top: 10%;
    right: 5%;
    animation: morph 8s ease-in-out infinite, float 6s ease-in-out infinite;
}

.shape-2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #14B8A6, #FBBF24);
    bottom: 20%;
    left: 5%;
    animation: morph 10s ease-in-out infinite, float 7s ease-in-out infinite reverse;
    animation-delay: 2s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #FBBF24, #F97316);
    top: 50%;
    left: 30%;
    animation: morph 12s ease-in-out infinite, float 8s ease-in-out infinite;
    animation-delay: 4s;
}

@keyframes morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-20px) translateX(10px);
    }
    50% {
        transform: translateY(-10px) translateX(-5px);
    }
    75% {
        transform: translateY(-25px) translateX(15px);
    }
}

/* ---- Pulse Slow Animation ---- */
.animate-pulse-slow {
    animation: pulse-slow 6s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* ---- Animation Delays ---- */
.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* ---- Float Animation (for decorative elements) ---- */
.animate-float {
    animation: float-gentle 4s ease-in-out infinite;
}

@keyframes float-gentle {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* ---- Bounce Gentle (for badges) ---- */
.animate-bounce-gentle {
    animation: bounce-gentle 2s ease-in-out infinite;
}

@keyframes bounce-gentle {
    0%, 100% {
        transform: translateY(0px) rotate(6deg);
    }
    50% {
        transform: translateY(-8px) rotate(6deg);
    }
}

/* ---- CTA Button Glow ---- */
.cta-btn-primary {
    position: relative;
}

.cta-btn-primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #7C3AED, #EC4899, #FBBF24, #7C3AED);
    background-size: 300% 300%;
    border-radius: 9999px;
    z-index: -1;
    opacity: 0;
    animation: glow-rotate 3s linear infinite;
    transition: opacity 0.3s ease;
}

.cta-btn-primary:hover::before {
    opacity: 0.6;
}

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

/* ---- Checkmark Animation ---- */
.checkmark-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: checkmark-draw 0.6s ease-out 0.3s forwards;
}

@keyframes checkmark-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* ---- Infographic Bars ---- */
.infographic-bar {
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Mobile Menu Animation ---- */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}

/* ---- Counter Animation Number ---- */
#stat-counter {
    font-variant-numeric: tabular-nums;
}

/* ---- Smooth Scroll Indicator ---- */
@keyframes scroll-indicator {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.5;
    }
}

/* ---- Focus Styles for Accessibility ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #7C3AED;
    outline-offset: 2px;
}

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

    html {
        scroll-behavior: auto;
    }

    .sparkle,
    .floating-shape {
        display: none;
    }

    .infographic-bar {
        transition: none;
    }
}

/* ---- Responsive Adjustments ---- */
@media (max-width: 768px) {
    .floating-shape {
        display: none;
    }

    .sparkle {
        transform: scale(0.7);
    }
}

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

::-webkit-scrollbar-track {
    background: #1E1B2E;
}

::-webkit-scrollbar-thumb {
    background: #7C3AED;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6D28D9;
}
