/* ============================================================
   animations.css — Preloader, Particles, Transitions & Glows
   Elite 2K26 Finance Management System
   ============================================================ */

/* ── Particle Canvas ── */
#particleCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ── Preloader ── */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}
.preloader-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}
.preloader-ring {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0,245,255,0.12);
    border-top-color: var(--neon-cyan);
    border-right-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.preloader-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neon-cyan);
    letter-spacing: 5px;
    animation: pulse-text 1.4s ease-in-out infinite;
}

/* ── Keyframes ── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes neonPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0,245,255,0.3); }
    50%       { box-shadow: 0 0 25px rgba(0,245,255,0.6), 0 0 50px rgba(0,130,255,0.3); }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(0,245,255,0.15); }
    50%       { border-color: rgba(0,245,255,0.45); }
}

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

@keyframes countUp {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Page Transition ── */
.page-enter {
    animation: fadeInUp 0.6s ease both;
}

/* ── Animated stat cards appear ── */
.stat-card {
    animation: fadeInUp 0.5s ease both;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

/* ── Neon Glow Border on hover ── */
.card:hover, .stat-card:hover {
    animation: neonPulse 2s ease-in-out infinite;
}

/* ── Ripple Button ── */
.ripple-btn { overflow: hidden; }
.ripple-btn .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transform: scale(0);
    animation: rippleAnim 0.55s linear;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* ── Sidebar Animate ── */
.sidebar { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-nav a { transition: all 0.25s ease; }

/* ── Hover glow for nav icons ── */
.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon {
    filter: drop-shadow(0 0 6px var(--neon-cyan));
    transform: scale(1.15);
    transition: all 0.2s ease;
}

/* ── Table row appear ── */
tbody tr {
    animation: fadeIn 0.3s ease both;
}

/* ── Neon underline for headings ── */
.neon-underline {
    position: relative;
    display: inline-block;
}
.neon-underline::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 100%; height: 2px;
    background: var(--gradient-main);
    border-radius: 1px;
    box-shadow: 0 0 8px var(--neon-cyan);
}

/* ── Progress bar ── */
.progress-bar-wrap {
    width: 100%;
    height: 5px;
    background: rgba(0,245,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.progress-bar-fill {
    height: 100%;
    background: var(--gradient-main);
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 6px var(--neon-cyan);
}

/* ── Floating logo icon ── */
.logo-icon { animation: float 3.5s ease-in-out infinite; }

/* ── Toast Slide ── */
.toast { animation: slideInRight 0.35s ease; }
.toast.removing { animation: slideInRight 0.35s ease reverse; }
