/* Animations */

/* Tab switching animations - removed to prevent layout shift */
/* Sections now just appear without animation to keep tabs stable */

@keyframes fadeSlideIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Tab button transitions */
.tabs .tab {
    transition: all 0.2s ease;
    position: relative;
}

.tabs .tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.tabs .tab.active::after {
    width: 80%;
}

.tabs .tab:hover:not(.active):not([disabled]) {
    transform: translateY(-2px);
    background: var(--hover);
}

/* Loading bar animation */
.loading-bar-progress {
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Button hover animations */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Input focus animations */
input:focus,
textarea:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(96, 165, 250, 0);
    }
}

/* Card hover animations */
.stat-card,
.team-card,
.assignment-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover,
.team-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Table row animations */
#hour-table tbody tr,
#team-table tbody tr {
    animation: fadeSlideIn 0.2s ease-out;
    opacity: 1;
}

#hour-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
#hour-table tbody tr:nth-child(2) { animation-delay: 0.04s; }
#hour-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
#hour-table tbody tr:nth-child(4) { animation-delay: 0.08s; }
#hour-table tbody tr:nth-child(5) { animation-delay: 0.10s; }
#hour-table tbody tr:nth-child(6) { animation-delay: 0.12s; }
#hour-table tbody tr:nth-child(7) { animation-delay: 0.14s; }
#hour-table tbody tr:nth-child(8) { animation-delay: 0.16s; }
#hour-table tbody tr:nth-child(9) { animation-delay: 0.18s; }
#hour-table tbody tr:nth-child(10) { animation-delay: 0.20s; }

/* Save status pulse */
.status {
    transition: all 0.3s ease;
}

.status:not(:empty) {
    animation: statusPulse 0.5s ease;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Chart animation */
#progress-chart {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Theme toggle animation */
.theme-icon {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#theme-button:hover .theme-icon {
    transform: rotate(20deg) scale(1.1);
}

#theme-button:active .theme-icon {
    transform: rotate(0deg) scale(0.95);
}

/* Empty state animations */
.empty-state {
    animation: fadeSlideIn 0.4s ease-out;
}

.empty-state-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Dropdown menu animations */
.dropdown-menu {
    animation: dropdownSlide 0.2s ease-out;
    transform-origin: top;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stat value count-up effect */
.stat-value {
    transition: all 0.3s ease;
}

/* Smooth number transitions */
input[type="number"] {
    transition: all 0.15s ease;
}

/* Responsibility card shuffle animation */
.assignment-card {
    animation: cardShuffle 0.4s ease-out;
    opacity: 1;
}

.assignment-card:nth-child(1) { animation-delay: 0.05s; }
.assignment-card:nth-child(2) { animation-delay: 0.10s; }
.assignment-card:nth-child(3) { animation-delay: 0.15s; }
.assignment-card:nth-child(4) { animation-delay: 0.20s; }
.assignment-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes cardShuffle {
    from {
        opacity: 0;
        transform: translateX(-20px) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
