/* ============================================
   TaxPro - Animations CSS
   ============================================ */

/* ===== KEYFRAME DEFINITIONS ===== */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes loading-bar {
    0% { width: 0; margin-left: 0; }
    50% { width: 80%; margin-left: 10%; }
    100% { width: 0; margin-left: 100%; }
}

@keyframes float-shape {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(10px) rotate(-3deg); }
}

@keyframes scroll-bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(8px); }
}

@keyframes radar-expand {
    0% { opacity: 0.8; transform: scale(0.5); }
    100% { opacity: 0; transform: scale(2); }
}

@keyframes carousel-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shrink {
    from { width: 100%; }
    to { width: 0; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes counter-pop {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(210,148,39,0.3); }
    50% { box-shadow: 0 0 40px rgba(210,148,39,0.6); }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce-in {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    80% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes progress-fill {
    from { width: 0; }
    to { width: var(--target-width); }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    50% { border-color: transparent; }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.4); }
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal-up, .reveal-left, .reveal-right, .reveal-fade {
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

.reveal-up { transform: translateY(40px); }
.reveal-left { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
.reveal-fade { opacity: 0; }

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed,
.reveal-fade.revealed {
    opacity: 1;
    transform: none;
}

/* Delay classes */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f2f4 25%, #e8eaed 50%, #f0f2f4 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

/* ===== GLOW EFFECTS ===== */
.glow-gold { animation: glow-pulse 3s ease-in-out infinite; }

/* ===== HOVER SHINE EFFECT ===== */
.shine-on-hover {
    position: relative;
    overflow: hidden;
}

.shine-on-hover::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 60%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255,255,255,0.15) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.shine-on-hover:hover::after { left: 150%; }

/* ===== DASHBOARD TRANSITIONS ===== */
.dashboard-panel {
    animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1);
}

.panel-enter {
    animation: fadeIn 0.3s ease;
}

/* ===== TYPING ANIMATION ===== */
.typing-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent);
    animation: typing 3s steps(30, end), blink-caret 0.75s step-end infinite;
}

/* ===== WAVE LOADER ===== */
.wave-loader {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wave-loader span {
    width: 4px;
    height: 24px;
    background: var(--accent);
    border-radius: 99px;
    animation: wave 1.2s ease-in-out infinite;
}

.wave-loader span:nth-child(2) { animation-delay: 0.2s; }
.wave-loader span:nth-child(3) { animation-delay: 0.4s; }
.wave-loader span:nth-child(4) { animation-delay: 0.6s; }
.wave-loader span:nth-child(5) { animation-delay: 0.8s; }

/* ===== RIPPLE EFFECT ===== */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect .ripple-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* ===== STATS COUNTER ANIMATION ===== */
.counter.animated {
    animation: counter-pop 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* ===== FLIP TRANSITIONS ===== */
.flip-container {
    perspective: 1200px;
}

.flip-card {
    transform-style: preserve-3d;
}

.flip-card.flipped {
    transform: rotateY(180deg);
}

/* ===== NAV TRANSITION ===== */
.navbar {
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* ===== PROGRESS BAR ANIMATION ===== */
.progress-bar {
    height: 6px;
    background: rgba(28,55,72,0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 99px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
}

/* ===== TOAST CLOSE ANIMATION ===== */
.toast.closing {
    animation: slideInRight 0.3s ease reverse;
}

/* ===== SPINNING LOADER ===== */
.spin-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin-slow 0.8s linear infinite;
}

/* ===== CHART BARS ===== */
.chart-bar {
    transition: height 1s cubic-bezier(0.4,0,0.2,1);
}

/* ===== SIDEBAR SLIDE ===== */
.sidebar-slide-enter {
    animation: slideInLeft 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ===== MODAL ANIMATIONS ===== */
.modal-overlay {
    animation: fadeIn 0.25s ease;
}

.modal {
    animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ===== NUMBER CARD FLIP ===== */
.stat-card-flip {
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.stat-card-flip:hover {
    transform: rotateX(5deg) scale(1.02);
}

/* ===== CARD HOVER LIFT ===== */
.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(28,55,72,0.15);
}

/* ===== GRADIENT TEXT ANIMATION ===== */
.gradient-text-animated {
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ===== PULSE BADGE ===== */
.pulse-badge::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: inherit;
    opacity: 0.4;
    animation: pulse 2s ease-in-out infinite;
}