/* ===== POMODORO ANIMATIONS =====
   All animations and transitions
   =============================== */

/* ===== KEYFRAMES ===== */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

@keyframes glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px var(--mode-glow));
    }

    50% {
        filter: drop-shadow(0 0 16px var(--mode-glow));
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===== ANIMATION CLASSES ===== */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fadeOut {
    animation: fadeOut 0.3s ease-out forwards;
}

.animate-slideUp {
    animation: slideUp 0.4s ease-out forwards;
}

.animate-slideDown {
    animation: slideDown 0.4s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-bounce {
    animation: bounce 0.5s ease-in-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===== TIMER ANIMATIONS ===== */
.timer-container.running .timer-progress {
    animation: glow 2s ease-in-out infinite;
}

.timer-container.completed {
    animation: pulse 0.5s ease-in-out 3;
}

/* ===== BUTTON RIPPLE ===== */
.control-btn,
.mode-btn,
.icon-btn {
    position: relative;
    overflow: hidden;
}

.control-btn::after,
.mode-btn::after,
.icon-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.control-btn:active::after,
.mode-btn:active::after,
.icon-btn:active::after {
    width: 200px;
    height: 200px;
}

/* ===== MODAL ANIMATIONS ===== */
.modal.active .modal-content {
    animation: scaleIn 0.25s ease-out forwards;
}

/* ===== SESSION DOT ===== */
.session-dot.just-completed {
    animation: pulse 0.5s ease-in-out 2;
}

/* ===== HOVER EFFECTS ===== */
.hover-lift:hover {
    transform: translateY(-3px);
}

.hover-scale:hover {
    transform: scale(1.03);
}

.hover-glow:hover {
    box-shadow: 0 0 16px var(--mode-glow);
}

/* ===== FOCUS STATES ===== */
:focus-visible {
    outline: 2px solid var(--mode-primary);
    outline-offset: 2px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}