/* ==========================================================================
   UI/UX ANIMATIONS & MICRO-INTERACTIONS
   ย้ายมาจาก test-animations.php
   ========================================================================== */

/* 1. Hover Lift (Card Hover / Desktop Focus) */
.anim-lift {
    /* ใช้เพียง transform และ box-shadow ซึ่งใช้ GPU Render ในการแสดงผล */
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
    .anim-lift:hover {
        /* ลอยขึ้น 5px และเพิ่มเงา — เฉพาะอุปกรณ์ที่มีเมาส์จริง */
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
    }
}

/* 2. Active Press (Native App Touch Feedback) */
.anim-press {
    /* การยุบตัวตอนถูกกด ใช้เวลาสั้นมาก (0.1s) ให้ความรู้สึกเหมือนปุ่มจริง */
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
}
.anim-press:active {
    /* ปุ่มยุบลงเล็กน้อย */
    transform: scale(0.95);
}

/* 3. Skeleton Loading (Shimmer Effect) */
.anim-skeleton {
    background: var(--color-surface-alt);
    background-image: linear-gradient(110deg, var(--color-surface-alt) 8%, var(--color-surface-card) 18%, var(--color-surface-alt) 33%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    /* ใช้ CSS Animation วิ่งจากซ้ายไปขวา */
    animation: shimmerLoad 1.5s linear infinite forwards;
}
@keyframes shimmerLoad {
    0% { background-position-x: 200%; }
    100% { background-position-x: -200%; }
}

/* 4. Fade Slide In (Scroll Reveal / Page Load) */
.anim-fade-slide {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.anim-fade-slide.show {
    opacity: 1;
    transform: translateY(0);
}

/* 5. Toast Snackbar (App-like Notification) */
.anim-toast {
    position: fixed;
    bottom: -100px; /* ซ่อนไว้ใต้จอก่อน */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--toast-notif-bg);
    color: var(--toast-notif-text);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-md);
    z-index: 9999;
    /* เด้งขึ้นมาแบบมีแรงสปริง (Bouncy) */
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.anim-toast.show {
    bottom: 30px; /* ระยะลอยจากขอบล่าง */
}
.anim-toast .app-toast-icon {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md);
    line-height: 1;
    flex-shrink: 0;
}
.anim-toast .app-toast-text {
    line-height: var(--line-height-body);
}
.anim-toast.is-success .app-toast-icon {
    color: var(--toast-notif-icon-success);
}
.anim-toast.is-error .app-toast-icon {
    color: var(--color-danger);
}

@media (max-width: 768px) {
    .anim-toast { width: 90%; justify-content: center; }
    .anim-toast.show { bottom: 80px; }
}
