/* ===== Custom Animations & Effects ===== */

/* Fade in from bottom on scroll */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Glassmorphism card */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #a855f7, #6366f1, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulsing glow on CTA */
.cta-glow {
    position: relative;
    overflow: hidden;
}

.cta-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #a855f7, #6366f1, #3b82f6, #a855f7);
    background-size: 300% 300%;
    border-radius: inherit;
    z-index: -1;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { background-position: 0% 50%; opacity: 0.7; }
    50% { background-position: 100% 50%; opacity: 1; }
}

/* Floating animation */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Shine effect on badges */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: rotate(30deg);
    animation: shine 4s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

/* Gradient border */
.gradient-border {
    position: relative;
    border-radius: 1rem;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, #a855f7, #6366f1, #3b82f6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Countdown timer styling */
.countdown-box {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Video player container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 0.75rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0.75rem;
}

/* Progress bar */
.progress-fill {
    transition: width 0.5s ease-out;
    background: linear-gradient(90deg, #a855f7, #6366f1, #3b82f6);
}

/* Smooth scrollbar for dark theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f0f1a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a855f7, #6366f1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #c084fc, #818cf8);
}

/* Flash messages */
.flash-message {
    animation: slideDown 0.4s ease-out, fadeOut 0.4s ease-in 4s forwards;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; pointer-events: none; }
}

/* Chapter card hover */
.chapter-card {
    transition: all 0.3s ease;
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.15);
}

/* Active chapter indicator */
.chapter-active {
    border-left: 3px solid #a855f7;
    background: rgba(168, 85, 247, 0.08);
}
