/* base.css — Reset, typography, animations, scrollbar, HTMX transitions */

[x-cloak] {
    display: none !important;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Page transition animations */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

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

main {
    transition: opacity 0.15s ease-out;
}

main.htmx-swapping {
    opacity: 0;
    filter: blur(1px);
}

main.htmx-settling {
    opacity: 1;
}

main:not(.htmx-settled) {
    transition: none !important;
}

/* HTMX transitions */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator, .htmx-request.htmx-indicator {
    opacity: 1;
}

/* Smooth link transitions */
a {
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

/* Custom scrollbar - Dark theme */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #111111;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* Sidebar scroll — thin track, auto-hide */
.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar-scroll:hover {
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 2px;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar group */
.sidebar-group + .sidebar-group {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-group-toggle {
    cursor: pointer;
    transition: background 0.15s ease;
}

.sidebar-group-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-group-toggle:hover .group-label {
    color: #b0b0b0;
}

.sidebar-group-toggle .group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.15s ease;
}

.sidebar-group-toggle .group-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* Active group highlight (collapsed group with active page inside) */
.sidebar-group-toggle.group-active .group-dot {
    opacity: 1;
}
