/* ============================================
   CertAuto - Animations Stylesheet
   ============================================ */

@keyframes blob1-animation {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes blob2-animation {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-30px, 40px) scale(0.9);
    }
    66% {
        transform: translate(20px, -30px) scale(1.1);
    }
}

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

@keyframes pulse-border {
    0%, 100% {
        stroke-width: 2;
        opacity: 1;
    }
    50% {
        stroke-width: 3;
        opacity: 0.6;
    }
}

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

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

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

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

@keyframes slideInRight {
    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.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.8);
    }
}

/* Intersection Observer Animations */
.fade-in {
    animation: fadeIn 0.6s ease-in-out forwards;
    opacity: 0;
}

.slide-up {
    animation: slideInUp 0.6s ease-in-out forwards;
    opacity: 0;
}

.slide-down {
    animation: slideInDown 0.6s ease-in-out forwards;
    opacity: 0;
}

.slide-left {
    animation: slideInLeft 0.6s ease-in-out forwards;
    opacity: 0;
}

.slide-right {
    animation: slideInRight 0.6s ease-in-out forwards;
    opacity: 0;
}

.scale-in {
    animation: scaleIn 0.6s ease-in-out forwards;
    opacity: 0;
}

/* Staggered animations */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

.stagger-6 {
    animation-delay: 0.6s;
}

/* Hover effects */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce:hover {
    animation: bounce 0.6s ease-in-out;
}

/* Loading animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Text animations */
@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
        color: #6366f1;
    }
    50% {
        text-shadow: 0 0 20px rgba(168, 85, 247, 0.7);
        color: #a855f7;
    }
}

.text-glow {
    animation: textGlow 3s ease-in-out infinite;
}

/* Smooth scroll behavior - already handled by html { scroll-behavior: smooth; } */

/* Page load animations */
body {
    animation: fadeIn 0.5s ease-in-out;
}

/* Navbar link active state animation */
@keyframes underline {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Card hover animations */
.feature-card,
.doc-card,
.contributor-card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Button animations */
.btn {
    position: relative;
    overflow: hidden;
}

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

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

/* Gradient animation for text */
@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-text,
.gradient-text-alt {
    animation: None; /* Static for now, can be enabled */
}

/* Subtle animations for lists */
@keyframes listItem {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.component-list li,
.workflow-list li,
.link-list li {
    animation: listItem 0.3s ease-out forwards;
}

.component-list li:nth-child(1),
.workflow-list li:nth-child(1),
.link-list li:nth-child(1) {
    animation-delay: 0.05s;
}

.component-list li:nth-child(2),
.workflow-list li:nth-child(2),
.link-list li:nth-child(2) {
    animation-delay: 0.1s;
}

.component-list li:nth-child(3),
.workflow-list li:nth-child(3),
.link-list li:nth-child(3) {
    animation-delay: 0.15s;
}

.component-list li:nth-child(4),
.workflow-list li:nth-child(4),
.link-list li:nth-child(4) {
    animation-delay: 0.2s;
}

.component-list li:nth-child(5),
.workflow-list li:nth-child(5),
.link-list li:nth-child(5) {
    animation-delay: 0.25s;
}

.component-list li:nth-child(6),
.workflow-list li:nth-child(6),
.link-list li:nth-child(6) {
    animation-delay: 0.3s;
}

/* Grid animations */
.features-grid .feature-card,
.docs-grid .doc-card,
.tech-grid .tech-item {
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
}

.features-grid .feature-card:nth-child(1) {
    animation-delay: 0.05s;
}

.features-grid .feature-card:nth-child(2) {
    animation-delay: 0.1s;
}

.features-grid .feature-card:nth-child(3) {
    animation-delay: 0.15s;
}

.features-grid .feature-card:nth-child(4) {
    animation-delay: 0.2s;
}

.features-grid .feature-card:nth-child(5) {
    animation-delay: 0.25s;
}

.features-grid .feature-card:nth-child(6) {
    animation-delay: 0.3s;
}

/* Smooth transitions for interactive elements */
input, button, select, textarea {
    transition: all 0.3s ease;
}

/* Focus animations */
button:focus,
a:focus,
input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Mobile menu animation */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.nav-menu.active {
    animation: slideInFromLeft 0.3s ease-out;
}

/* Smooth loading state */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Reduce motion for accessibility */
@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;
    }
}
