/* =====================================================
   ANIMATIONS.CSS
   Micro-interactions & UI Motion System
===================================================== */

/* ================= FADE IN ================= */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= SLIDE UP ================= */
.slide-up {
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ================= SLIDE LEFT ================= */
.slide-left {
    animation: slideLeft 0.5s ease forwards;
}

@keyframes slideLeft {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ================= SCALE IN ================= */
.scale-in {
    animation: scaleIn 0.4s ease forwards;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ================= BUTTON CLICK ================= */
button:active {
    transform: scale(0.95);
}

/* ================= CARD HOVER ================= */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* ================= IMAGE HOVER ================= */
.image-container img {
    transition: transform 0.3s ease;
}

.image-container img:hover {
    transform: scale(1.03);
}

/* ================= PROGRESS ANIMATION ================= */
.progress-bar {
    animation: progressLoad 1s ease;
}

@keyframes progressLoad {
    from { width: 0; }
}

/* ================= SPINNER ================= */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* ================= PULSE (AI ACTIVE) ================= */
.pulse {
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* ================= GLOW EFFECT ================= */
.glow {
    box-shadow: 0 0 10px #3b82f6, 0 0 20px #3b82f6;
}

/* ================= HEATMAP BLINK ================= */
.heatmap {
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%,100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ================= LOADING SKELETON ================= */
.skeleton {
    background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ================= TOAST ANIMATION ================= */
.toast {
    animation: toastIn 0.5s ease;
}

@keyframes toastIn {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ================= MODAL ================= */
.modal {
    transition: all 0.3s ease;
}

.modal.active {
    animation: modalPop 0.3s ease forwards;
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ================= SIDEBAR COLLAPSE ================= */
.sidebar {
    transition: width 0.3s ease;
}

/* ================= NAV ITEM HOVER ================= */
.nav-item {
    transition: all 0.3s ease;
}

.nav-item:hover {
    transform: translateX(5px);
}

/* ================= INPUT FOCUS ================= */
input:focus {
    outline: none;
    box-shadow: 0 0 5px #3b82f6;
}

/* ================= BUTTON GLOW ================= */
.btn-primary:hover {
    box-shadow: 0 0 10px #3b82f6;
}

/* ================= PAGE TRANSITION ================= */
.page-enter {
    animation: pageEnter 0.6s ease;
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= FLOATING EFFECT ================= */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* ================= WARNING SHAKE ================= */
.shake {
    animation: shake 0.4s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* ================= SUCCESS POP ================= */
.success-pop {
    animation: successPop 0.4s ease;
}

@keyframes successPop {
    0% { transform: scale(0.8); }
    100% { transform: scale(1); }
}

/* ================= HOVER UNDERLINE ================= */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 2px;
    width: 0;
    background: #3b82f6;
    transition: 0.3s;
}

.hover-underline:hover::after {
    width: 100%;
}