/* === Design Tokens === */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e5e5e5;
    --border-color: #e5e5e5;
    --text-primary: #0a0a0a;
    --text-secondary: #525252;
}

.dark {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --border-color: #262626;
    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
}

/* === Base === */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* === Animations === */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes progress-indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.animate-fade-in { animation: fade-in 0.15s ease-out; }
.animate-slide-up { animation: slide-up 0.2s ease-out; }
.animate-scale-in { animation: scale-in 0.15s ease-out; }
.animate-slide-in-right { animation: slide-in-right 0.2s ease-out; }
.animate-pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }
.animate-shake { animation: shake 0.3s ease-in-out; }

/* === Section transitions === */
[x-cloak] { display: none !important; }

/* === Form elements === */
input, select, textarea {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* === Sidebar === */
.sidebar-item {
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.dark .sidebar-item.active {
    background: rgba(59, 130, 246, 0.15);
}

/* === Skeleton loader === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Toast stack === */
.toast-enter { animation: slide-in-right 0.25s ease-out; }
.toast-leave { animation: slide-in-right 0.2s ease-in reverse; }

/* === Progress bar === */
.progress-bar-indeterminate::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 25%;
    height: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: inherit;
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}
