/* Component Animations and Keyframes */
@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInNav {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes fadeInSkeleton {
    to {
        opacity: 1;
    }
}

/* Toast Animations */
@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastExit {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Modal Animations */
@keyframes modalBackdropIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalBackdropOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes modalBoxIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalBoxOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
}

/* Toast Classes */
.toast-enter {
    animation: toastEnter 0.3s var(--ease-out) forwards;
}

.toast-exit {
    animation: toastExit 0.25s var(--ease-in) forwards;
}

/* Modal Classes */
.modal-backdrop-enter {
    animation: modalBackdropIn 0.2s ease-out forwards;
}

.modal-backdrop-exit {
    animation: modalBackdropOut 0.15s ease-in forwards;
}

.modal-box-enter {
    animation: modalBoxIn 0.25s var(--ease-spring) forwards;
}

.modal-box-exit {
    animation: modalBoxOut 0.2s ease-in forwards;
}

/* Headless Layout Styles */
.headless-layout {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
}

.headless-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            #f0fdf4 0%,
            #dcfce7 25%,
            #bbf7d0 50%,
            #86efac 75%,
            #4ade80 100%);
    opacity: 0.15;
    z-index: 0;
}

.headless-background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(61, 203, 91, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(34, 197, 94, 0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

.headless-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 28rem;
}

/* Login Page Styles */
.login-container {
    width: 100%;
    animation: slideUp 0.5s var(--ease-out);
}

.login-card {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.logo-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(61, 203, 91, 0.3);
}

/* Navigation Menu Styles */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    color: #374151;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    opacity: 0;
    animation: slideInNav 0.3s var(--ease-out) forwards;
}

.nav-icon {
    transition: transform var(--duration-base) var(--ease-spring);
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-link.active {
    background-color: var(--primary);
    color: white;
}

.nav-link.active:hover {
    background-color: var(--primary-dark);
    color: white;
}

.nav-link.active .nav-icon {
    animation: bounce 0.6s var(--ease-spring);
}

/* Nav Section Collapsible */
.nav-section-content {
    animation: navSectionExpand 0.2s var(--ease-out);
    overflow: hidden;
}

@keyframes navSectionExpand {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State Styles */
.empty-state {
    animation: fadeIn 0.4s var(--ease-out);
}

.empty-state-icon {
    animation: scaleIn 0.5s var(--ease-spring);
}

/* Skeleton Loader Styles */
.skeleton-loader {
    width: 100%;
    padding: 1rem;
}

.skeleton-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInSkeleton 0.3s var(--ease-out) forwards;
}

.skeleton-cell {
    height: 1.5rem;
    background: linear-gradient(90deg,
            #f3f4f6 0%,
            #e5e7eb 50%,
            #f3f4f6 100%);
    background-size: 200% 100%;
    border-radius: 0.375rem;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ====================================
   Forecast Chart Styles
   ==================================== */
.forecast-chart {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    padding: 1rem 0;
    min-height: 220px;
}

.forecast-chart-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 80px;
}

.forecast-chart-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 180px;
}

.forecast-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.forecast-bar {
    width: 30px;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    animation: bar-grow 0.5s var(--ease-out) forwards;
    transform-origin: bottom;
}

@keyframes bar-grow {
    from {
        transform: scaleY(0);
    }

    to {
        transform: scaleY(1);
    }
}

.forecast-bar--planned {
    background: linear-gradient(to top, #94a3b8, #cbd5e1);
}

.forecast-bar--realized {
    background: linear-gradient(to top, #ef4444, #f87171);
}

.forecast-bar--forecast {
    background: linear-gradient(to top, #3b82f6, #60a5fa);
}

.forecast-bar-value {
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    min-height: 1rem;
}

.forecast-bar-value--planned {
    color: #64748b;
}

.forecast-bar-value--realized {
    color: #dc2626;
}

.forecast-bar-value--forecast {
    color: #2563eb;
}

.forecast-chart-month {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: capitalize;
}

.forecast-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.forecast-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.forecast-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.forecast-legend-dot--planned {
    background: #94a3b8;
}

.forecast-legend-dot--realized {
    background: #ef4444;
}

.forecast-legend-dot--forecast {
    background: #3b82f6;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .headless-background::before,
    .login-container,
    .nav-link,
    .nav-link:hover .nav-icon,
    .nav-link.active .nav-icon,
    .empty-state,
    .empty-state-icon,
    .skeleton-cell,
    .skeleton-row {
        animation: none !important;
    }

    .nav-link {
        opacity: 1;
    }

    .skeleton-row {
        opacity: 1;
    }

    .skeleton-cell {
        background: #f3f4f6;
    }

    .nav-link:hover .nav-icon,
    .nav-link.active .nav-icon {
        transform: none;
    }

    .forecast-bar {
        animation: none !important;
        transform: scaleY(1);
    }
}