/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Toast notifications */
.toast {
    animation: slideInToast 0.3s ease-out forwards;
}

@keyframes slideInToast {
    from {
        transform: translateX(400px) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Sidebar collapse animation - Optimized */
#sidebar {
    overflow: hidden;
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    will-change: width;
    contain: layout style;
}

#sidebar.sidebar-expanded {
    width: 20rem;
}

#sidebar.sidebar-collapsed {
    width: 5rem;
    gap: 0.75rem;
    padding: 0.5rem;
}

/* Hide full content divs in collapsed mode */
#sidebar.sidebar-collapsed section > div:last-of-type {
    display: none;
}

/* Style headers in collapsed mode - center and fixed size */
#sidebar.sidebar-collapsed section > div:first-of-type {
    border: none !important;
    padding: 0.75rem !important;
    width: 4rem !important;
    height: 4rem !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Show flex container for icons */
#sidebar.sidebar-collapsed section > div:first-of-type > div {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    gap: 0 !important;
}

/* Hide only the text container div */
#sidebar.sidebar-collapsed section > div:first-of-type > div > div {
    display: none !important;
}

/* Make SVG icons properly sized and visible */
#sidebar.sidebar-collapsed section > div:first-of-type > div > svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
    flex-shrink: 0 !important;
}

/* Toggle button styling in collapsed mode */
#sidebar.sidebar-collapsed section:first-child > div {
    width: 3.5rem !important;
    height: 3.5rem !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 1rem !important;
    border: 1px solid #e2e8f0 !important;
}

/* Toggle arrow animation */
#toggleArrow {
    transition: transform 0.3s ease;
}

/* SVG rotation animation */
svg {
    transition: transform 0.3s ease;
}

/* Hidden sections */
.sectionContent.hidden {
    display: none;
}

/* Table optimization */
#previewBody {
    contain: layout style paint;
}

table {
    table-layout: fixed;
}

tbody tr {
    contain: layout style;
}

/* Disable transitions on hover during scroll */
body.scrolling * {
    pointer-events: none;
    transition: none !important;
}
