/* ==========================================
   ANIMACIONES ANDROID MATERIAL DESIGN 3
   ========================================== */

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Shared Element Transitions */
@keyframes sharedElementEnter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes sharedElementExit {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.8) translateY(-40px);
    }
}

.shared-element-enter {
    animation: sharedElementEnter 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.shared-element-exit {
    animation: sharedElementExit 0.3s cubic-bezier(0.2, 0, 0, 1);
}

/* Container Transform */
.container-transform {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.container-transform:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Fade Through */
@keyframes fadeThrough {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-through {
    animation: fadeThrough 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Elevation Animation */
.elevation-transition {
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.elevation-transition:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

/* Slide In/Out */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

.slide-in-right {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-out-left {
    animation: slideOutLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    animation: staggerFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item:nth-child(1) {
    animation-delay: 0.05s;
    transform: translateY(20px);
}

.stagger-item:nth-child(2) {
    animation-delay: 0.1s;
    transform: translateY(20px);
}

.stagger-item:nth-child(3) {
    animation-delay: 0.15s;
    transform: translateY(20px);
}

.stagger-item:nth-child(4) {
    animation-delay: 0.2s;
    transform: translateY(20px);
}

.stagger-item:nth-child(5) {
    animation-delay: 0.25s;
    transform: translateY(20px);
}

.stagger-item:nth-child(6) {
    animation-delay: 0.3s;
    transform: translateY(20px);
}

/* Bounce Effect */
@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.bounce-effect {
    animation: bounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulse Effect */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--md-sys-color-primary);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

.pulse-effect {
    animation: pulse 2s infinite;
}

/* Skeleton Loading */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--md-sys-color-surface-variant) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            var(--md-sys-color-surface-variant) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Floating Action Button Animation */
@keyframes fabEnter {
    from {
        opacity: 0;
        transform: scale(0) rotate(-45deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.fab-enter {
    animation: fabEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Transition */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-enter {
    animation: pageEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Enter/Exit */
@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes backdropEnter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-enter {
    animation: modalEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.backdrop-enter {
    animation: backdropEnter 0.3s ease;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Aplicar animaciones a elementos existentes */
.plan-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.btn-filled::before,
.btn-outlined::before,
.btn-text::before {
    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%);
    transition: width 0.6s, height 0.6s;
}

.btn-filled:active::before,
.btn-outlined:active::before,
.btn-text:active::before {
    width: 300px;
    height: 300px;
}

/* Activity Card Animations */
.activity-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-card:hover {
    transform: translateX(8px);
    box-shadow: -4px 0 0 0 var(--md-sys-color-primary),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Progress shine animation */
@keyframes shine {
    to {
        left: 100%;
    }
}

.progress-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

/* Theme Transition */
body {
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Confetti para 100% */
@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--md-sys-color-primary);
    animation: confetti-fall 3s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}

/* Gantt Chart Animations */
@keyframes ganttRowSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ganttBarFill {
    from {
        width: 0;
    }
    to {
        width: var(--bar-width, 100%);
    }
}

.gantt-row {
    animation: ganttRowSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.gantt-row:nth-child(1) {
    animation-delay: 0.05s;
}

.gantt-row:nth-child(2) {
    animation-delay: 0.1s;
}

.gantt-row:nth-child(3) {
    animation-delay: 0.15s;
}

.gantt-row:nth-child(4) {
    animation-delay: 0.2s;
}

.gantt-row:nth-child(5) {
    animation-delay: 0.25s;
}

.gantt-row:nth-child(n+6) {
    animation-delay: 0.3s;
}

.gantt-bar {
    animation: ganttBarFill 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}