/* ============================================================================
   K-12Buddy Vibrant UI Enhancements
   Modern, energetic, gamified design system
   ============================================================================ */

/* === COLOR SYSTEM === */
:root {
    /* Primary - Vibrant Purple-Blue Gradient */
    --primary-purple: #8B5CF6;
    --primary-blue: #3B82F6;
    --primary-pink: #EC4899;

    /* Success & Gamification */
    --success-green: #10B981;
    --warning-amber: #F59E0B;
    --info-cyan: #06B6D4;
    --danger-red: #EF4444;

    /* Gamification Colors */
    --gold: #FBBF24;
    --silver: #D1D5DB;
    --bronze: #F97316;

    /* Subject Colors */
    --math-purple: #8B5CF6;
    --science-green: #10B981;
    --english-amber: #F59E0B;
    --history-red: #EF4444;
    --coding-blue: #3B82F6;
}

/* === ANIMATED GRADIENT BACKGROUNDS === */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-animated-gradient {
    background: linear-gradient(
        -45deg,
        #8B5CF6,   /* Purple */
        #3B82F6,   /* Blue */
        #EC4899,   /* Pink */
        #10B981    /* Green */
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    position: relative;
}

.hero-animated-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.1) 0%,
        rgba(59, 130, 246, 0.1) 100%
    );
    pointer-events: none;
}

/* === FLOATING DECORATIVE ELEMENTS === */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

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

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

.float-slow {
    animation: float-slow 4s ease-in-out infinite;
}

/* === GRADIENT TEXT === */
.gradient-text {
    background: linear-gradient(
        90deg,
        #FFFFFF 0%,
        #FEF08A 25%,
        #FFFFFF 50%,
        #FEF08A 75%,
        #FFFFFF 100%
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s linear infinite;
}

.gradient-text-purple-pink {
    background: linear-gradient(
        90deg,
        #FBCFE8 0%,
        #FFFFFF 50%,
        #BFDBFE 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === GLOW EFFECTS === */
.glow-button {
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
    transition: all 0.3s ease;
}

.glow-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(236, 72, 153, 0.4),
        rgba(139, 92, 246, 0.4)
    );
    border-radius: inherit;
    opacity: 0;
    blur: 20px;
    transition: opacity 0.3s ease;
}

.glow-button:hover::before {
    opacity: 1;
}

.glow-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(236, 72, 153, 0.6);
}

/* === ANIMATED BADGES === */
@keyframes pulse-slow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.badge-animated {
    animation: pulse-slow 2s ease-in-out infinite;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* === TRUST INDICATORS WITH BACKDROP === */
.trust-indicator {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.trust-indicator:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* === SCROLL INDICATOR === */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.scroll-indicator {
    animation: bounce 2s infinite;
}

/* === FEATURE CARDS WITH TILT === */
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 60px rgba(139, 92, 246, 0.2);
}

.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.05) 0%,
        rgba(59, 130, 246, 0.05) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    pointer-events: none;
}

.feature-card:hover::after {
    opacity: 1;
}

/* === PRICING CARDS === */
.pricing-card {
    position: relative;
    transition: all 0.3s ease;
    transform-origin: center;
}

.pricing-card:hover {
    transform: translateY(-10px) scale(1.03);
}

.pricing-card-popular {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 30px 60px rgba(139, 92, 246, 0.3);
}

.pricing-card-popular::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        135deg,
        #8B5CF6,
        #3B82F6,
        #EC4899
    );
    border-radius: inherit;
    z-index: -1;
    animation: gradient-shift 3s ease infinite;
    background-size: 200% 200%;
}

/* === PROGRESS BARS === */
.progress-bar-animated {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        #8B5CF6,
        #EC4899
    );
    background-size: 200% 100%;
    animation: gradient-shift 2s linear infinite;
}

.progress-bar-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* === GAMIFICATION ELEMENTS === */
.streak-counter {
    background: linear-gradient(135deg, #F97316 0%, #EF4444 100%);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.4);
}

.xp-bar-container {
    background: linear-gradient(to right, #EDE9FE, #DBEAFE);
}

.xp-bar-fill {
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
    position: relative;
    overflow: hidden;
}

.xp-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

/* === ACHIEVEMENT POPUP === */
@keyframes slide-in-right {
    0% {
        transform: translateX(400px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(1.2) rotate(5deg); }
}

.achievement-popup {
    animation: slide-in-right 0.5s ease-out;
}

.achievement-icon {
    animation: celebration 0.6s ease-out;
}

/* === BUTTON RIPPLE EFFECT === */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::before {
    width: 300px;
    height: 300px;
}

/* === SKELETON LOADING === */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === SUCCESS CHECKMARK === */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark-animated {
    stroke-dasharray: 100;
    animation: checkmark 0.6s ease-out forwards;
}

/* === MOBILE BOTTOM NAV === */
.mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #6B7280;
    transition: all 0.3s ease;
    padding: 8px 12px;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    color: #8B5CF6;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
    border-radius: 0 0 3px 3px;
}

.nav-item-fab {
    position: relative;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
}

.nav-item-fab:active {
    transform: translateY(-2px) scale(0.95);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

/* === SUBJECT BADGES === */
.subject-badge-math {
    background: linear-gradient(135deg, #8B5CF6, #A78BFA);
}

.subject-badge-science {
    background: linear-gradient(135deg, #10B981, #34D399);
}

.subject-badge-english {
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
}

.subject-badge-history {
    background: linear-gradient(135deg, #EF4444, #F87171);
}

.subject-badge-coding {
    background: linear-gradient(135deg, #3B82F6, #60A5FA);
}

/* === UTILITY CLASSES === */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.text-gradient-purple {
    background: linear-gradient(90deg, #8B5CF6, #3B82F6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-rainbow {
    background: linear-gradient(
        90deg,
        #8B5CF6,
        #3B82F6,
        #10B981,
        #F59E0B,
        #EF4444
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 768px) {
    .hero-animated-gradient {
        background-size: 300% 300%;
    }

    .feature-card:hover {
        transform: translateY(-4px) scale(1.01);
    }

    .pricing-card-popular {
        transform: scale(1.05);
    }
}

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

/* === DARK MODE SUPPORT (Optional) === */
@media (prefers-color-scheme: dark) {
    .glass-effect {
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .skeleton {
        background: linear-gradient(
            90deg,
            #2a2a2a 25%,
            #1a1a1a 50%,
            #2a2a2a 75%
        );
    }
}
