/* 
   SIKAP - Premium Motion Design Library
   Focus: Smoothness, Premium Feel, Performance
   Author: Antigravity Agent
*/

/* 1. KEYFRAMES DEFINITIONS */

/* Smooth Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Smooth Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Sidebar Slide In (Staggered items) */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translate3d(-20px, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Pop In (for Cards/Badges) */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale3d(0.8, 0.8, 0.8);
    }

    50% {
        transform: scale3d(1.05, 1.05, 1.05);
    }

    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

/* Pulse Glow (for Actions) */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(44, 83, 100, 0.2);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(44, 83, 100, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(44, 83, 100, 0);
    }
}

/* Bell Shake */
@keyframes bellShake {
    0% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(5deg);
    }

    30% {
        transform: rotate(-5deg);
    }

    45% {
        transform: rotate(3deg);
    }

    60% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(2deg);
    }

    85% {
        transform: rotate(-2deg);
    }

    100% {
        transform: rotate(0);
    }
}

/* --- SUPERIOR MOTION PACK --- */

/* 1. Background Panning (Subtle animated gradient) */
@keyframes bgPan {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.animate-bg-pan {
    background: linear-gradient(-45deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-size: 400% 400%;
    animation: bgPan 15s ease infinite;
}

/* 2. Text Reveal (Tracking In) */
@keyframes trackingIn {
    0% {
        letter-spacing: -0.5em;
        opacity: 0;
    }

    40% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.text-reveal {
    animation: trackingIn 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
}

/* 3. Jelly / Bounce (Playful) */
@keyframes jello {
    0% {
        transform: scale3d(1, 1, 1);
    }

    30% {
        transform: scale3d(1.25, 0.75, 1);
    }

    40% {
        transform: scale3d(0.75, 1.25, 1);
    }

    50% {
        transform: scale3d(1.15, 0.85, 1);
    }

    65% {
        transform: scale3d(0.95, 1.05, 1);
    }

    75% {
        transform: scale3d(1.05, 0.95, 1);
    }

    100% {
        transform: scale3d(1, 1, 1);
    }
}

.hover-jelly:hover {
    animation: jello 0.9s both;
}

/* 4. Glint / Shine Effect (Premium Card Hover) */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: 0.5s;
    pointer-events: none;
}

.shine-effect:hover::after {
    left: 150%;
    transition: 1s ease-in-out;
}

/* 5. Ripple Effect (CSS var handled by JS) */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
    background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 6. 3D Float Hover */
.hover-3d {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

.hover-3d:hover {
    transform: translateY(-5px) rotateX(5deg) rotateY(5deg);
    box-shadow: -5px 10px 20px rgba(0, 0, 0, 0.15);
}

/* 7. Blur In (Soft Entrance) */
@keyframes blurIn {
    0% {
        opacity: 0;
        filter: blur(20px);
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

.blur-in {
    animation: blurIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* Gentle Float */
@keyframes floatY {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Rotate */
@keyframes rotateSoft {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Shimmer/Gradient Flow */
@keyframes shimmerFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Input Focus Expand */
@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(44, 83, 100, 0.2);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(44, 83, 100, 0.1);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(44, 83, 100, 0);
    }
}

/* 2. BASE UTILITY CLASSES */

:root {
    --motion-duration: 0.6s;
    --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    /* Premium ease-out */
}

.animate {
    animation-duration: var(--motion-duration);
    animation-fill-mode: both;
    animation-timing-function: var(--motion-ease);
}

/* Animation Types */
.fade-up {
    animation-name: fadeInUp;
}

.fade-down {
    animation-name: fadeInDown;
}

.slide-left {
    animation-name: slideInLeft;
}

.pop-in {
    animation-name: popIn;
}

.pulse-on-hover:hover {
    animation: pulseGlow 1.5s infinite;
}

.shake-on-hover:hover i,
.shake-parent-on-hover:hover .shake-target {
    animation: bellShake 0.8s ease;
}

.rotate-on-hover:hover i,
.rotate-on-hover:hover svg {
    animation: rotateSoft 1s ease-in-out;
}

.float-y {
    animation: floatY 6s ease-in-out infinite;
}

.shimmer-text {
    background: linear-gradient(-45deg, #2C5364, #203A43, #F2994A, #2C5364);
    background-size: 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerFlow 5s ease infinite;
}

[data-theme="dark"] .shimmer-text {
    background: linear-gradient(-45deg, #e2e8f0, #a0aec0, #F2C94C, #e2e8f0);
    background-size: 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Stagger Delays (up to 10 items) */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

.delay-900 {
    animation-delay: 900ms;
}

.delay-1000 {
    animation-delay: 1000ms;
}

/* 3. INTERACTIVE HOVER EFFECTS */

/* Card Lift */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
    z-index: 2;
}

/* Scale Up */
.hover-scale {
    transition: transform 0.2s ease !important;
}

.hover-scale:hover {
    transform: scale(1.05) !important;
}

/* Glass Shine Effect on Buttons */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.5s;
}

.btn-shine:hover::after {
    left: 100%;
}

/* Table Row Focus */
.table-premium tbody tr {
    transition: all 0.2s ease;
}

.table-premium tbody tr:hover {
    transform: scale(1.01);
    background: rgba(44, 83, 100, 0.04) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    z-index: 1;
    position: relative;
    border-radius: 8px;
}

/* Sidebar Item Slide (Mobile Friendly) */
.nav-item {
    transition: transform 0.2s ease, background 0.2s;
}

.nav-item:active {
    transform: scale(0.95);
}

/* Bouncing Button Click */
.btn:active,
.action-btn:active {
    transform: scale(0.92) !important;
    transition: transform 0.1s;
}

/* Input Enhancements */
.form-input.animate-focus:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    /* Soft shadow lift */
    border-color: var(--primary);
    transition: all 0.3s ease;
}

/* Smooth Icon Transition */
i,
svg {
    transition: transform 0.3s ease, color 0.3s ease;
}

/* --- ERROR SHAKE ANIMATION --- */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

.shake-error {
    animation: shake 0.5s;
    border-color: var(--danger) !important;
}

/* --- CHECKBOX ANIMATION --- */
input[type="checkbox"] {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"]:checked {
    animation: popIn 0.3s ease;
}

/* --- PROGRESS BAR ANIMATION --- */
@keyframes progressGrow {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

.progress-bar {
    animation: progressGrow 1s ease-out;
}

/* --- SCROLL REVEAL (will be triggered by JS) --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- DATA FADE TRANSITION --- */
.data-fade-out {
    animation: fadeOut 0.3s ease;
}

.data-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}