/* Base Style */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7fc;
    color: #333;
    line-height: 1.6;
}

/* Container Layout */
.container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Sidebar */
.sidebar {
    background-color: #92dc92;
    color: white;
    width: 200px;
    height: calc(100vh - 50px); /* Adjusted for header height */
    position: fixed;
    top: 50px;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px 10px;
    overflow-y: auto;
    z-index: 10;
    transition: transform 0.3s ease-in-out; /* Smooth transition */
}

.sidebar.collapsed {
    transform: translateX(-200px); /* Slide out */
}

/* Menu Section */
.menu-section {
    margin-bottom: 20px;
}

.menu-btn {
    background-color: transparent;
    border: none;
    color: white;
    font-weight: bold;
    text-align: left;
    width: 100%;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.menu-btn:hover {
    background-color: #4caf50; /* Hover background for section buttons */
    border-radius: 5px;
}

/* Submenu buttons */
.submenu {
    display: none; /* Initially hidden */
    padding-left: 10px;
    margin-top: 5px;
}

.submenu button {
    background-color: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    text-align: left;
    width: 100%;
    padding: 8px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submenu button:hover {
    background-color: #388e3c; /* Darker hover background for submenu buttons */
    border-radius: 5px;
}

/* Section Divider */
.section-divider {
    border: none;
    border-top: 1px solid #ccc;
    margin: 20px 0;
}

/* Logout Section */
.logout-section {
    padding-top: 10px;
}

.logout-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #e74c3c; /* Red for logout button */
    color: white;
    border: none;
    padding: 10px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #c0392b; /* Darker red for hover */
}


/* Header Bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #4CAF50;
    color: white;
    padding: 20px 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: padding-left 0.3s ease;
}

.header-bar .page-title {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Content */
.content {
    margin-left: 200px;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: calc(100% - 200px);
    transition: margin-left 0.3s ease, width 0.3s ease; /* Smooth transition */
}

.content.collapsed {
    margin-left: 0;
    width: 100%;
}

/* Forms */
input, select, button {
    font-size: 1rem;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    width: 100%;
}

input:focus, select:focus, button:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Buttons */
button {
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #388E3C;
}

/* Form Container */
.add-user-container {
    max-width: 500px;
    margin: 30px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.add-user-container h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 20px;
}

.error-message, .success-message {
    color: red;
    text-align: center;
    font-weight: bold;
}

.success-message {
    color: green;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
    text-align: left;
    padding: 12px;
}

th {
    background-color: #f4f4f4;
}

/* Section Titles */
section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .content {
        margin-left: 0;
    }

    .header-bar {
        padding-left: 0;
    }

    .container {
        flex-direction: column;
    }
}
