﻿body {
    margin: 0;
    font-family: sans-serif;
}

.app-layout {
    display: flex;
    height: calc(100vh - 90px);
}

/* Main sidebar */
.main-sidebar {
    background: #f7f2ee;
    color: white;
    transition: width 0.3s;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .main-sidebar.expanded {
        width: 200px;
    }

    .main-sidebar.collapsed {
        width: 70px;
    }

        .main-sidebar.collapsed.hover-expanded {
            width: 200px !important;
        }
    .main-sidebar ul li.main-item.active:before {
        content: "";
        width: 4px;
        height: 100%;
        position: absolute;
        left: 0px;
        top: 0px;
    }
.main-sidebar ul li.main-item.active:before {
    background: rgb(68, 185, 241);
}

    .main-sidebar ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .main-sidebar li {
        position: relative;
        padding: 0;
    }

    .main-sidebar .main-link {
        display: flex;
        align-items: center;
        padding: 10px;
        color: white;
        text-decoration: none;
        cursor: pointer;
        user-select: none;
    }

        .main-sidebar .main-link:hover,
        .main-sidebar .main-link:focus {
            /*background: #34495e;*/
            outline: none;
        }

    .main-sidebar li.active .main-link {
        background: #ece8e5;
    }


    .main-sidebar .icon {
        width: 50px;
        text-align: center;
        font-size: 1.2em;
    }

    .main-sidebar .icon img {
        width: 50px;
        text-align: center;
        font-size: 1.2em;
    }

    .main-sidebar .title {
        flex: 1;
        white-space: nowrap;
        opacity: 1;
        transition: opacity 0.2s;
        padding: 0 0 0 10px;
        color:black;
    }

    .main-sidebar.collapsed .title {
        opacity: 0;
    }
    /* Show title on hover */
    .main-sidebar.collapsed.hover-expanded .title {
        opacity: 1;
        transition: opacity 0.2s;
    }

/* Show/Hide buttons */
.sidebar-toggle-btn {
    background: #34495e;
    border: none;
    color: white;
    padding: 10px;
    width: 100%;
    cursor: pointer;
    font-size: 1em;
    user-select: none;
    transition: background 0.3s;
}

    .sidebar-toggle-btn:hover,
    .sidebar-toggle-btn:focus {
        background: #1abc9c;
        outline: none;
    }

.main-sidebar .show-child-btn {
    display: none;
}

.main-sidebar.show-child-btn-visible .show-child-btn {
    display: block;
}

/* Child sidebar */
.child-sidebar {
    background: #ece8e5;
    width: 240px;
    border-left: 1px solid #ccc;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .child-sidebar.hidden {
        display: none;
    }

/* Child menu */
.child-menu {
    display: none;
}

    .child-menu:not(.hidden) {
        display: block;
    }

/* Nested nav styles */
.child-sidebar h3 {
    padding : 0.5rem;
}
/* Nested nav styles */
.child-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.child-sidebar li {
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.child-sidebar li.active a {
   font-weight:bold;
}


.child-sidebar a {
    display: block;
    padding: 8px 12px 8px 28px;
    text-decoration: none;
    color: #333;
}

    .child-sidebar a:hover,
    .child-sidebar a:focus {
        background: #e0e0e0;
        outline: none;
    }

.child-sidebar li.has-children > a::before {
    content: '▶';
    position: absolute;
    left: 8px;
    font-size: 0.8em;
    transition: transform 0.2s;
}

.child-sidebar li.open > a::before {
    transform: rotate(90deg);
}

.child-sidebar li ul {
    max-height: 0;
    overflow: hidden;
    padding-left: 10px;
    transition: max-height 0.3s ease;
}

.child-sidebar li.open > ul {
    max-height: 500px;
}

/* Bottom container for child sidebar button */
.child-sidebar .bottom-btn-container {
    padding: 10px;
    border-top: 1px solid #ccc;
}