/* ============================================
   SPRINTSHIP - GLOBAL ANIMATIONS & MICRO-INTERACTIONS
   Beautiful, Smooth & Professional
   ============================================ */

/* ========== 1. GLOBAL ANIMATION KEYFRAMES ========== */

/* Fade In Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Slide Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rotation & Spin */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-30px);
    }
    70% {
        transform: translateY(-15px);
    }
    90% {
        transform: translateY(-4px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Loading & Progress */
@keyframes loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes progress {
    from { width: 0%; }
    to { width: 100%; }
}

/* Glow Effects */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(79, 70, 229, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(79, 70, 229, 0.5);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========== 2. UTILITY CLASSES FOR ANIMATIONS ========== */

/* Entrance Animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

.animate-scale-up {
    animation: scaleUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.animate-slide-in-up {
    animation: slideInUp 0.5s ease-out;
}

.animate-slide-in-down {
    animation: slideInDown 0.5s ease-out;
}

/* Attention Animations */
.animate-bounce {
    animation: bounce 1s ease-in-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Loading States */
.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-loading {
    animation: loading 1s linear infinite;
}

/* ========== 3. INTERACTIVE ELEMENT ANIMATIONS ========== */

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Card Hover Effects */
.job-card,
.action-card,
.stat-card,
.insight-card,
.analytics-card {
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.job-card::before,
.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.job-card:hover::before,
.action-card:hover::before {
    left: 100%;
}

.job-card:hover,
.action-card:hover,
.stat-card:hover,
.insight-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Input Focus Effects */
.form-control,
.search-input {
    transition: all var(--transition-normal);
    position: relative;
}

.form-control:focus,
.search-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
}

/* Skill Tag Animations */
.skill-tag {
    transition: all var(--transition-normal);
    cursor: pointer;
}

.skill-tag:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.skill-tag-match {
    animation: pulse 2s ease-in-out infinite;
    background: var(--success);
    color: white;
}

/* Navigation Animations */
.nav-link {
    position: relative;
    transition: all var(--transition-normal);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transform: translateX(-50%);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* ========== 4. LOADING & PROGRESS ANIMATIONS ========== */

/* Enhanced Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: loading 1s linear infinite;
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-bottom: 2px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: loading 0.8s linear infinite reverse;
}

/* Progress Bars */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== 5. MICRO-INTERACTIONS ========== */

/* Checkbox Custom Styling */
.checkbox-label {
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.checkbox-label:hover input ~ .checkmark {
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transition: all var(--transition-fast);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

/* Radio Button Custom Styling */
.radio-label {
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    user-select: none;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-mark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.radio-label:hover input ~ .radio-mark {
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.radio-label input:checked ~ .radio-mark {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.radio-mark:after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    transition: all var(--transition-fast);
}

.radio-label input:checked ~ .radio-mark:after {
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

/* ========== 6. SCROLL ANIMATIONS ========== */

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Scroll Reveal Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========== 7. HOVER STATES & TRANSITIONS ========== */

/* Image Hover Effects */
img {
    transition: transform var(--transition-normal);
}

img:hover {
    transform: scale(1.05);
}

/* Link Hover Effects */
a {
    position: relative;
    transition: color var(--transition-normal);
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-normal);
}

a:hover::after {
    width: 100%;
}

/* ========== 8. SUCCESS & ERROR STATES ========== */

/* Success Animation */
.success-animation {
    animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Error Animation */
.error-animation {
    animation: shake 0.5s ease-in-out;
}

/* ========== 9. STAGGERED ANIMATIONS ========== */

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}

.stagger-item.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Apply staggered delays */
.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }
.stagger-item:nth-child(7) { transition-delay: 0.7s; }
.stagger-item:nth-child(8) { transition-delay: 0.8s; }
.stagger-item:nth-child(9) { transition-delay: 0.9s; }
.stagger-item:nth-child(10) { transition-delay: 1.0s; }

/* ========== 10. RESPONSIVE ANIMATIONS ========== */

/* Reduce motion on user preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 11. UTILITY ANIMATION CLASSES ========== */

/* 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; }

/* Durations */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.5s; }
.duration-slow { animation-duration: 1s; }

/* Easing */
.ease-in { animation-timing-function: ease-in; }
.ease-out { animation-timing-function: ease-out; }
.ease-in-out { animation-timing-function: ease-in-out; }

/* ========== 12. PERFORMANCE OPTIMIZATIONS ========== */

/* Hardware acceleration */
.animate-gpu {
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* Reduce repaints */
.optimize-repaint {
    contain: layout style paint;
}
