/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    font-family: Arial, sans-serif;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #4CAF50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.header .logo {
    font-size: 1.4rem;
    font-weight: bold;
}

.top-menu {
    position: relative;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    display: none;
    cursor: pointer;
}

.menu-links a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
    transition: color 0.3s;
}

.menu-links a:hover {
    color: #ffecb3;
}

/* Desktop Layout: Sidebar + Content Side by Side */
.container {
    display: flex;
	margin-top: 70px;
}

/* Sidebar Styling */
.sidebar {
    background: #f4f4f4;
    width: 250px; /* Fixed width for desktop */
    padding: 1rem;
    position: fixed;
    top: 70px; /* Below the header */
    left: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

/* Content Styling */
.content {
    margin-left: 270px; /* Adjust to match sidebar width */
    padding: 1rem;
    flex-grow: 1; /* Makes it take remaining space */
}

/* Mobile View: Sidebar Becomes Collapsible */
@media screen and (max-width: 768px) {
    .container {
        flex-direction: column; /* Stack sidebar & content */
    }

    .sidebar {
        width: 100%; /* Full width on mobile */
        position: static; /* No fixed positioning */
        height: auto; /* Auto height */
        transform: translateX(0); /* Ensure it's visible */
    }

    .content {
        margin-left: 0; /* Remove sidebar offset */
    }
}

.sidebar .menu {
    list-style: none;
}

.sidebar .menu a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 0.5rem 0;
}

.sidebar .menu a:hover {
    color: #4CAF50;
}
/* Hide submenus by default */
.submenu-items {
    display: none;
    position: static;
    background: #f4f4f4;
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 3px solid #4CAF50;
}

/* Show submenu on hover for desktop users */
.submenu:hover .submenu-items {
    display: block;
}

/* Ensure submenu stays open when clicked (for touchscreen users) */
.submenu.open .submenu-items {
    display: block;
}


/* Main Content */
.content {
    margin-left: 270px;
    padding: 1rem;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .menu-links {
        display: none;
        flex-direction: column;
        position: absolute;
        right: 0;
        background: #4CAF50;
        top: 100%;
        padding: 1rem;
    }
    .menu-links a {
        display: block;
        margin: 0.5rem 0;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    .content {
        margin-left: 0;
    }
}
