/* ============================================================
   GestAI Motion System
   Shared keyframes + entrance choreography. Everything here is
   decorative — prefers-reduced-motion (base.css) disables it all.
   ============================================================ */

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

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

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

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

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

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

@keyframes ring {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(-12deg); }
    20%, 40% { transform: rotate(12deg); }
    50%      { transform: rotate(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80%      { transform: translateX(5px); }
}

@keyframes progressFill {
    from { width: 0; }
}

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0);  opacity: 0.5; }
    40%           { transform: scale(1);  opacity: 1; }
}

/* Expanding halo for live/incoming-call elements */
@keyframes halo {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 35%, transparent); }
    100% { box-shadow: 0 0 0 24px transparent; }
}

/* ---------- Utility classes ---------- */
.ringing { animation: ring 1s var(--ease-swift) infinite; }
.bounce  { animation: bounce 1s var(--ease-swift); }
.shake   { animation: shake 0.5s var(--ease-swift); }

.connecting-dots {
    display: inline-flex;
    gap: 5px;
}

.connecting-dots span {
    width: 9px;
    height: 9px;
    background: var(--brand);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.connecting-dots span:nth-child(1) { animation-delay: 0s; }
.connecting-dots span:nth-child(2) { animation-delay: 0.2s; }
.connecting-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ---------- Skeleton loading ---------- */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-sunken) 25%,
        var(--border) 50%,
        var(--surface-sunken) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--space-2);
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--space-3);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 72px;
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
}

/* ---------- Hover affordances ---------- */
.card-hover {
    transition: transform var(--dur-base) var(--ease-spring),
                box-shadow var(--dur-base) var(--ease-swift);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ---------- Entrance choreography ---------- */
.content-body > * {
    animation: fadeInUp var(--dur-slow) var(--ease-out) backwards;
}

.content-body > *:nth-child(1) { animation-delay: 0ms; }
.content-body > *:nth-child(2) { animation-delay: 50ms; }
.content-body > *:nth-child(3) { animation-delay: 100ms; }
.content-body > *:nth-child(4) { animation-delay: 150ms; }
.content-body > *:nth-child(5) { animation-delay: 200ms; }

.stats-grid .stat-card {
    animation: scaleIn var(--dur-slow) var(--ease-spring) backwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0ms; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 60ms; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 120ms; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 180ms; }

.table tbody tr {
    animation: fadeIn var(--dur-base) var(--ease-swift) backwards;
}

.table tbody tr:nth-child(1) { animation-delay: 0ms; }
.table tbody tr:nth-child(2) { animation-delay: 30ms; }
.table tbody tr:nth-child(3) { animation-delay: 60ms; }
.table tbody tr:nth-child(4) { animation-delay: 90ms; }
.table tbody tr:nth-child(5) { animation-delay: 120ms; }

.progress-bar { animation: progressFill 1s var(--ease-out); }

.dropdown-menu { transform-origin: top right; }
