/* =========================================
   SIDEBAR CONTAINER
========================================= */
.sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    top: 10;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

/* Mobile close button */
.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
}

/* Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Logo */
.sidebar-logo img {
    width: 150px;
    display: block;
    margin: 0 auto 25px auto;
}

/* =========================================
   MAIN MENU LIST
========================================= */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 12px; /* ⬅ adds spacing between parent menus */
}

/* =========================================
   TOP-LEVEL MENU STYLE (Dashboard + Parents)
========================================= */

/* Shared menu row layout */
.menu-link,
.menu-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 6px;
    cursor: pointer;
    color: #374151;
    text-decoration: none;
    font-size: 15px;
    transition: 0.2s ease;
    white-space: nowrap;       
    overflow: hidden;         
    text-overflow: ellipsis;   
}

.menu-link:hover,
.menu-main:hover {
    background: #f3f4f6;
}

/* Icons (left side) */
.menu-link span.material-symbols-rounded,
.menu-main span.material-symbols-rounded {
    font-size: 22px;
    margin-right: 10px;
    color: #4b5563;
}

/* Text alignment fix */
.menu-main span.label,
.menu-link span.label {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

/* Arrow */
.submenu-arrow {
    font-size: 20px;
    transition: transform 0.25s ease;
    margin-left: auto;
}

/* Rotate arrow when active */
.menu-item.active .submenu-arrow {
    transform: rotate(180deg);
}

/* Active parent */
.menu-item.active .menu-main {
    background: #e8f1ff;
    color: #cc3366;
    font-weight: 600;
}

/* =========================================
   SUBMENU
========================================= */

.submenu {
    background: #fafafa;
    border-left: 3px solid #cc3366;
    margin-top: 6px;
    margin-left: 14px;
    padding: 8px 0;
    border-radius: 4px;
    display: none;
    flex-direction: column;
}

.menu-item.active .submenu {
    display: flex;
}

/* Submenu links */
.submenu li a {
    display: block;
    padding: 10px 18px;
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    transition: 0.2s ease;
}

.submenu li a:hover {
    background: #eef3ff;
    color: #cc3366;
}

/* Active submenu highlight */
.submenu li.active a {
    background: #dce9ff;
    color: #cc3366;
    font-weight: 600;
}

/* =========================================
   MOBILE
========================================= */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .mobile-close-btn {
        display: block;
    }
}
