/* AI Agents Course - Animations CSS */
/* Smooth Transitions and Engaging Visual Effects */

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(220, 38, 38, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
    }
}

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

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

@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }
    51%,
    100% {
        opacity: 0;
    }
}

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

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 300px;
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        max-height: 300px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out;
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.4s ease-out;
}

.animate-slideInUp {
    animation: slideInUp 0.5s ease-out;
}

.animate-bounceIn {
    animation: bounceIn 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-glow {
    animation: glow 2s infinite;
}

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

.animate-rotate {
    animation: rotate 2s linear infinite;
}

/* Delayed Animations */
.animate-delay-1 {
    animation-delay: 0.1s;
}
.animate-delay-2 {
    animation-delay: 0.2s;
}
.animate-delay-3 {
    animation-delay: 0.3s;
}
.animate-delay-4 {
    animation-delay: 0.4s;
}
.animate-delay-5 {
    animation-delay: 0.5s;
}

/* Intersection Observer Animation Setup */
.observe-animation {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.6s ease-out,
        transform 0.6s ease-out;
}

.observe-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Effects */
.hover-lift {
    transition:
        transform var(--transition-normal),
        box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.hover-scale {
    transition: transform var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-brightness {
    transition: filter var(--transition-normal);
}

.hover-brightness:hover {
    filter: brightness(1.1);
}

/* 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;
}

/* Loading Shimmer Effect */
.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation:
        typewriter 3s steps(40, end),
        blink 0.75s step-end infinite;
}

/* Stagger Animation for Lists */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

.stagger-animation > *:nth-child(1) {
    animation-delay: 0.1s;
}
.stagger-animation > *:nth-child(2) {
    animation-delay: 0.2s;
}
.stagger-animation > *:nth-child(3) {
    animation-delay: 0.3s;
}
.stagger-animation > *:nth-child(4) {
    animation-delay: 0.4s;
}
.stagger-animation > *:nth-child(5) {
    animation-delay: 0.5s;
}
.stagger-animation > *:nth-child(6) {
    animation-delay: 0.6s;
}
.stagger-animation > *:nth-child(7) {
    animation-delay: 0.7s;
}
.stagger-animation > *:nth-child(8) {
    animation-delay: 0.8s;
}
.stagger-animation > *:nth-child(9) {
    animation-delay: 0.9s;
}
.stagger-animation > *:nth-child(10) {
    animation-delay: 1s;
}

/* Page Transitions */
.page-enter {
    opacity: 0;
    transform: translateX(100px);
}

.page-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition:
        opacity 0.3s,
        transform 0.3s;
}

.page-exit {
    opacity: 1;
    transform: translateX(0);
}

.page-exit-active {
    opacity: 0;
    transform: translateX(-100px);
    transition:
        opacity 0.3s,
        transform 0.3s;
}

/* Parallax Effect */
.parallax {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        var(--primary-color),
        var(--accent-color)
    );
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        var(--primary-hover),
        var(--primary-color)
    );
}

/* Progress Indicator */
.progress-indicator {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-indicator::after {
    content: "";
    display: block;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--primary-color),
        var(--accent-color)
    );
    border-radius: 2px;
    transform: translateX(-100%);
    animation: progressBar 0.5s ease-out forwards;
}

/* Focus Animations */
.focus-animation {
    position: relative;
    transition: all var(--transition-normal);
}

.focus-animation:focus {
    outline: none;
    transform: scale(1.02);
}

.focus-animation:focus::after {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--primary-color);
    border-radius: inherit;
    opacity: 0;
    animation: fadeIn 0.2s ease-out forwards;
}

/* Loading Waves */
.loading-waves {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-waves div {
    position: absolute;
    border: 4px solid var(--primary-color);
    opacity: 1;
    border-radius: 50%;
    animation: loading-waves 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.loading-waves div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes loading-waves {
    0% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        top: 0px;
        left: 0px;
        width: 72px;
        height: 72px;
        opacity: 0;
    }
}

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    animation: textReveal 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes textReveal {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}

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

    .parallax {
        transform: none !important;
    }

    .animate-float,
    .animate-pulse,
    .animate-glow {
        animation: none !important;
    }

    /* Force visibility for all critical content */
    .hero-section,
    .hero-content,
    .hero-title,
    .hero-description,
    .hero-stats,
    .hero-actions,
    .stat-card,
    .career-section,
    .portfolio-section,
    .modules-section {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
}

/* Force all content to remain visible regardless of animations */
.hero-section *,
.modules-section *,
.career-section *,
.portfolio-section * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Intersection Observer Trigger */
.fade-in-on-scroll {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition:
        opacity 0.6s ease-out,
        transform 0.6s ease-out;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Ensure all hero and critical content stays visible */
.hero-section,
.hero-content,
.hero-title,
.hero-description,
.hero-stats,
.hero-actions,
.stat-card,
.career-section,
.portfolio-section,
.modules-section {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.hero-stats {
    display: grid !important;
}

.hero-actions {
    display: flex !important;
}

/* Override any animation that might hide content */
.observe-animation {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition:
        opacity 0.6s ease-out,
        transform 0.6s ease-out;
}

.observe-animation.animate {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Card Flip Animation */
.card-flip {
    background: transparent;
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* Breathing Animation */
.breathing {
    animation: breathing 3s ease-in-out infinite;
}

@keyframes breathing {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}
