* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.main-container {
    display: flex;
    height: 100vh;
    position: relative;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #00003A 0%, #3A003A 100%);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto; /* Allow sidebar to scroll if content exceeds viewport */
    overflow-x: hidden;
}

.logo-container {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    align-items: center;
    flex-shrink: 0; /* Prevent logo container from shrinking */
}

.brand-logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.logo-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 5px;
    text-transform: uppercase;
}

.menu-section {
    flex: 1 1 0; /* Grow and shrink, but start from 0 basis */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    min-height: 120px; /* Prevent menu from becoming too small, but allow other sections to be visible */
    /* Note: When sidebar scrolls, menu-section scrolls independently for better UX */
}

    /* UL/LI Styles */
    .menu-section ul,
    .admin-section ul,
    .bottom-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .menu-section li,
    .admin-section li,
    .bottom-menu li {
        position: relative;
    }

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

    .menu-item:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }

.menu-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-item i {
    font-size: 16px;
}

.chevron {
    transition: transform 0.3s ease;
    font-size: 14px;
}

    .chevron.rotated {
        transform: rotate(90deg);
    }

/* Submenu styles */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.2);
}

    .submenu.active {
        max-height: 1000px;
    }

    .submenu .menu-item {
        padding-left: 30px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .submenu .submenu .menu-item {
        padding-left: 40px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .submenu .submenu .submenu .menu-item {
        padding-left: 50px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

/* Admin section */
.admin-section {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 0;
    flex-shrink: 0; /* Prevent admin section from being pushed off screen */
}

.admin-label {
    padding: 12px 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Bottom menu */
.bottom-menu {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 0;
    flex-shrink: 0; /* Prevent bottom menu from being pushed off screen */
}

/* Content area */
.content-area {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: linear-gradient(180deg, #00003A 0%, #3A003A 100%);
    color: white;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.content-iframe {
    flex: 1;
    border: none;
    width: 100%;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Medium screen styles - tablets and small laptops */
@media (min-width: 769px) and (max-width: 1024px) {
    .menu-section {
        /* Ensure minimum usable space for scrolling on medium screens */
        min-height: 180px;
    }
    
    /* Make scrollbar more visible on medium screens */
    .menu-section::-webkit-scrollbar {
        width: 8px;
    }
    
    .menu-section::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.5);
        border-radius: 4px;
    }
    
    .menu-section::-webkit-scrollbar-thumb:hover {
        background: rgba(255,255,255,0.7);
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        overflow-y: auto;
    }

        .sidebar.active {
            transform: translateX(0);
        }

    .menu-section {
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 120px; /* Keep minimum height on mobile too */
    }

    .content-area {
        margin-left: 0;
    }

    .mobile-header {
        display: flex;
    }

    .overlay.active {
        display: block;
    }
}

/* Scrollbar styles */
.menu-section::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.menu-section::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.menu-section::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}
