/**
 * Animations CSS - CRM AI Agent Benchmarking Project
 * This file contains all animation styles for the demo page and website.
 */

/* Base Animations */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeLeft {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeRight {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeScale {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes floatAnimation {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes check {
    0% {
        height: 0;
        width: 0;
        opacity: 0;
    }

    30% {
        height: 0.3rem;
        width: 0;
        opacity: 1;
    }

    100% {
        height: 0.3rem;
        width: 0.75rem;
        opacity: 1;
    }
}

/* Floating particles animation */
@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-20px) translateX(10px);
    }

    100% {
        transform: translateY(0) translateX(0);
    }
}

/* Animation Classes */
.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.fadeIn {
    animation-name: fadeIn;
}

.fadeUp {
    animation-name: fadeUp;
}

.fadeDown {
    animation-name: fadeDown;
}

.fadeLeft {
    animation-name: fadeLeft;
}

.fadeRight {
    animation-name: fadeRight;
}

.fadeScale {
    animation-name: fadeScale;
}

.shake {
    animation-name: shake;
    animation-duration: 0.5s;
}

.pulse {
    animation-name: pulse;
    animation-duration: 1s;
    animation-iteration-count: infinite;
}

.bounce {
    animation-name: bounce;
    animation-duration: 1s;
}

.rotate {
    animation-name: rotate;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

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

/* Hover Animation Classes */
.hover-pulse:hover {
    animation: pulse 1s infinite;
}

.hover-bounce:hover {
    animation: bounce 1s;
}

.hover-shake:hover {
    animation: shake 0.5s;
}

.hover-rotate:hover {
    animation: rotate 1s linear;
}

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

/* Typing Animation */
.typing-animation {
    border-right: 0.1em solid;
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.05em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: #333
    }
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #4facfe, #00f2fe);
    border-radius: 5px;
    transition: width 1.5s ease;
}

/* Button styles with ripple effect */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    outline: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
    width: 100px;
    height: 100px;
    transform-origin: center;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    position: relative;
}

.modal.show .modal-content {
    transform: scale(1);
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* Success animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    position: relative;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4CAF50;
}

.success-checkmark .check-icon::before {
    top: 43px;
    left: 19px;
    transform: rotate(45deg);
    position: absolute;
    content: '';
    width: 12px;
    height: 4px;
    background-color: #4CAF50;
}

.success-checkmark .check-icon::after {
    top: 38px;
    left: 26px;
    transform: rotate(135deg);
    position: absolute;
    content: '';
    width: 25px;
    height: 4px;
    background-color: #4CAF50;
}

.animated-check .check-icon::before,
.animated-check .check-icon::after {
    animation: check 0.8s cubic-bezier(0.895, 0.030, 0.685, 0.220) forwards;
}

.animated-check .check-icon::before {
    opacity: 0;
    animation-delay: 0.4s;
}

.animated-check .check-icon::after {
    opacity: 0;
    animation-delay: 0.6s;
}

/* Particles background */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    background-color: rgba(0, 123, 255, 0.2);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

/* Enhanced UI Elements */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Page Animation Classes */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

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

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Animation delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Demo section styles */
.demo-section {
    margin: 4rem 0;
    padding: 2rem;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.demo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.demo-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .demo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .demo-item {
        height: 100px;
    }

    .modal-content {
        width: 95%;
    }
}

/* Enhancement for Index Page */
.tab-button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.business-tab {
    background-color: #1a73e8;
    color: white;
    box-shadow: 0 4px 6px rgba(26, 115, 232, 0.2);
}

.business-tab:hover {
    background-color: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(26, 115, 232, 0.3);
}

.developer-tab {
    background-color: #202124;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.developer-tab:hover {
    background-color: #303134;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.stat-counter {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-counter:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.count-up {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a73e8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Global page animations */
.animate-page {
    animation: fadeUp 0.5s ease-out forwards;
}

.animate-header {
    animation: fadeDown 0.5s ease-out forwards;
}

.animate-footer {
    animation: fadeUp 0.5s ease-out forwards;
}

.animate-list>* {
    opacity: 0;
    animation: fadeUp 0.5s ease-out forwards;
}

.animate-list>*:nth-child(1) {
    animation-delay: 0.1s;
}

.animate-list>*:nth-child(2) {
    animation-delay: 0.2s;
}

.animate-list>*:nth-child(3) {
    animation-delay: 0.3s;
}

.animate-list>*:nth-child(4) {
    animation-delay: 0.4s;
}

.animate-list>*:nth-child(5) {
    animation-delay: 0.5s;
}

.animate-list>*:nth-child(6) {
    animation-delay: 0.6s;
}

.animate-list>*:nth-child(7) {
    animation-delay: 0.7s;
}

.animate-list>*:nth-child(8) {
    animation-delay: 0.8s;
}

.animate-list>*:nth-child(9) {
    animation-delay: 0.9s;
}

.animate-list>*:nth-child(10) {
    animation-delay: 1.0s;
}