/* ClioForms Animations */

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

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

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

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

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

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

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

@keyframes pulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

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

@keyframes drawCheck {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
}

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

@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-200px) rotate(720deg); opacity: 0; }
}

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

/* Page transitions */
.page-enter {
    animation: fadeInUp 300ms var(--ease) both;
}

/* Chat message animations */
.chat-msg-clio {
    animation: slideInLeft 250ms var(--ease) both;
}
.chat-msg-user {
    animation: slideInRight 250ms var(--ease) both;
}

/* Card stagger */
.card-enter {
    animation: fadeInUp 300ms var(--ease) both;
}
.card-enter:nth-child(1) { animation-delay: 0ms; }
.card-enter:nth-child(2) { animation-delay: 50ms; }
.card-enter:nth-child(3) { animation-delay: 100ms; }
.card-enter:nth-child(4) { animation-delay: 150ms; }
.card-enter:nth-child(5) { animation-delay: 200ms; }
.card-enter:nth-child(6) { animation-delay: 250ms; }

/* Quick reply button animation */
.quick-reply-enter {
    animation: popIn 300ms var(--ease) both;
}
.quick-reply-enter:nth-child(1) { animation-delay: 0ms; }
.quick-reply-enter:nth-child(2) { animation-delay: 80ms; }
.quick-reply-enter:nth-child(3) { animation-delay: 160ms; }
.quick-reply-enter:nth-child(4) { animation-delay: 240ms; }

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 14px 20px;
    background: var(--surface);
    border-radius: 18px 18px 18px 6px;
    border: none;
}
.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Toggle switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 200ms var(--ease);
}
.toggle.active { background: var(--primary); }
.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 200ms var(--ease);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.active .toggle-knob { transform: translateX(20px); }

/* Shimmer loading */
.shimmer {
    background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-btn);
}

/* Completion checkmark */
.check-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 500ms var(--ease) both;
}
.check-circle svg {
    width: 32px;
    height: 32px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: drawCheck 400ms var(--ease) 300ms forwards;
}

/* Number count-up */
.count-up {
    animation: countUp 400ms var(--ease) both;
}

/* Page load sequence */
.load-first { animation: fadeIn 200ms var(--ease) both; }
.load-second { animation: fadeInUp 300ms var(--ease) 100ms both; }
.load-third { animation: fadeInUp 300ms var(--ease) 200ms both; }
.load-fourth { animation: fadeInUp 300ms var(--ease) 300ms both; }

/* Notification slide */
.notification-enter {
    animation: toastSlide 300ms var(--ease) both;
}
.notification-exit {
    animation: fadeIn 200ms var(--ease) reverse both;
}

/* Hover lift */
.hover-lift {
    transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}
