/* ============================================================
   ✨ CareerBlazor — Modern Animations
   ============================================================ */

/* === Page Transitions === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === Page Content Animation === */
.page-enter {
    animation: fadeInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.page-enter-delay-1 { animation-delay: 0.05s; }
.page-enter-delay-2 { animation-delay: 0.1s; }
.page-enter-delay-3 { animation-delay: 0.15s; }
.page-enter-delay-4 { animation-delay: 0.2s; }
.page-enter-delay-5 { animation-delay: 0.25s; }

/* === Card Stagger Animation === */
.card-stagger > * {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.card-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.card-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.card-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.card-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.card-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.card-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.card-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.card-stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* === Count Up Animation === */
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-up {
    animation: countUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* === Pulse / Glow === */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.5); }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* === Shimmer Loading === */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg,
        var(--modern-surface-muted) 25%,
        var(--modern-surface-hover) 50%,
        var(--modern-surface-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* === Slide Down (for notifications) === */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.slide-down {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* === Rotate (for loading spinners) === */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* === Bounce (for attention) === */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-4px); }
    75% { transform: translateY(2px); }
}

.bounce {
    animation: bounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Ripple Effect === */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    top: 50%;
    left: 50%;
    transform: scale(0);
    opacity: 1;
    animation: ripple 0.6s ease-out;
}

/* === Skeleton Screen === */
.skeleton-line {
    height: 12px;
    border-radius: var(--modern-radius-sm);
    margin-bottom: 8px;
    background: linear-gradient(90deg,
        var(--modern-surface-muted) 25%,
        var(--modern-surface-hover) 50%,
        var(--modern-surface-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line:last-child {
    width: 60%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--modern-radius-lg);
    background: linear-gradient(90deg,
        var(--modern-surface-muted) 25%,
        var(--modern-surface-hover) 50%,
        var(--modern-surface-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(90deg,
        var(--modern-surface-muted) 25%,
        var(--modern-surface-hover) 50%,
        var(--modern-surface-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* === Hover Lift Effect === */
.hover-lift {
    transition: transform var(--modern-transition-normal),
                box-shadow var(--modern-transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--modern-shadow-lg);
}

/* === Hover Scale Effect === */
.hover-scale {
    transition: transform var(--modern-transition-fast);
}

.hover-scale:hover {
    transform: scale(1.03);
}

/* === Border Glow on Focus === */
.focus-glow:focus {
    outline: none;
    border-color: var(--modern-primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* === Progress Bar Animation === */
@keyframes progressFill {
    from { width: 0; }
}

.progress-animate .modern-progress-fill {
    animation: progressFill 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* === Notification Badge Pulse === */
@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

/* === Floating Animation (for decorative elements) === */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* === Gradient Shift Animation === */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-shift {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

/* === Typing Indicator === */
@keyframes typing {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--modern-text-muted);
    animation: typing 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}