/**
 * Sidebar Loader Styles
 * Persistent sidebar with AJAX content loading
 */

/* Main layout adjustments */
body {
    overflow: hidden;
}

#layout-wrapper {
    display: flex;
    height: 100vh;
    flex-direction: column;
}

.vertical-menu {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    border-right: 1px solid #e9ecef;
}

.main-content {
    margin-left: 280px;
    margin-top: 60px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#page-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 60px;
}

/* Loading state */
.content-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-loader {
    animation: fadeIn 0.3s ease-in;
}

.page-loader .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Smooth transitions */
.main-content {
    animation: contentFadeIn 0.3s ease-in;
}

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

/* Sidebar active states */
.metismenu .active > a,
.metismenu a.active {
    color: #E6112D;
    background-color: rgba(230, 17, 45, 0.1);
    border-left: 3px solid #E6112D;
}

.metismenu .mm-active > a {
    color: #E6112D;
    font-weight: 600;
}

/* Scrollbar styling */
.vertical-menu::-webkit-scrollbar {
    width: 6px;
}

.vertical-menu::-webkit-scrollbar-track {
    background: transparent;
}

.vertical-menu::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.vertical-menu::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .vertical-menu {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 250px;
    }

    .vertical-menu.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.sidebar-overlay::before {
        content: '';
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/* Smooth page transitions */
.page-content {
    animation: pageSlideIn 0.3s ease-out;
}

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

/* Link cursor feedback */
a[data-page-link],
#sidebar-menu a,
.sidebar-menu a {
    cursor: pointer;
    user-select: none;
}

a[data-page-link]:hover,
#sidebar-menu a:hover,
.sidebar-menu a:hover {
    text-decoration: none;
}

/* Prevent sidebar flicker */
.vertical-menu {
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 60px;
    left: 280px;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: overlayFadeIn 0.2s ease;
}

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

/* Disable text selection during load */
.content-loading {
    user-select: none;
}

/* Breadcrumb styling for page nav */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: #E6112D;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Page transition fade */
.page-content {
    min-height: calc(100vh - 120px);
}

/* Smooth footer visibility */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid #e9ecef;
}
