/* dinglab.pl — Reusable Animations */

/* ===== Entrance Animations ===== */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes scalePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

/* ===== Quiz Feedback ===== */
@keyframes correctGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(16, 185, 129, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}

/* ===== Flashcard ===== */
@keyframes flip {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(180deg); }
}

@keyframes swipeLeft {
    to { opacity: 0; transform: translateX(-120%) rotate(-10deg); }
}

@keyframes swipeRight {
    to { opacity: 0; transform: translateX(120%) rotate(10deg); }
}

/* ===== Utility ===== */
@keyframes floatUp {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-100px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Ripple Effect ===== */
.dl-ripple {
    position: relative;
    overflow: hidden;
}
.dl-ripple::after {
    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%);
    opacity: 0;
}
.dl-ripple:active::after {
    width: 200px;
    height: 200px;
    opacity: 0;
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
}

/* ===== Skeleton Loading ===== */
.dl-skeleton {
    background: linear-gradient(90deg,
        var(--dl-bg-elevated) 25%,
        rgba(148, 163, 184, 0.1) 50%,
        var(--dl-bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--dl-radius-sm);
}
.dl-skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}
.dl-skeleton-text:last-child {
    width: 60%;
}
.dl-skeleton-circle {
    border-radius: 50%;
}
.dl-skeleton-card {
    height: 120px;
    border-radius: var(--dl-radius-md);
}

/* ===== Stagger Classes ===== */
.dl-stagger-1 { animation-delay: 0.05s; }
.dl-stagger-2 { animation-delay: 0.1s; }
.dl-stagger-3 { animation-delay: 0.15s; }
.dl-stagger-4 { animation-delay: 0.2s; }
.dl-stagger-5 { animation-delay: 0.25s; }
.dl-stagger-6 { animation-delay: 0.3s; }
.dl-stagger-7 { animation-delay: 0.35s; }
.dl-stagger-8 { animation-delay: 0.4s; }

.dl-animate-in {
    animation: slideInUp 0.4s ease both;
}

.dl-fade-in {
    animation: fadeIn 0.4s ease both;
}

.dl-scale-in {
    animation: scaleIn 0.3s ease both;
}

.dl-pop-in {
    animation: popIn 0.4s ease both;
}

.dl-slide-left {
    animation: slideInLeft 0.4s ease both;
}

.dl-slide-right {
    animation: slideInRight 0.4s ease both;
}

/* ===== Number Count-Up ===== */
.dl-count-up {
    animation: countUp 0.3s ease both;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
