/* --- Professional Color Scheme for Rehabilitation Center --- */
:root {
    --primary-color: #005f73;   /* A deep, trustworthy teal/blue */
    --primary-hover: #0a9396;  /* A slightly lighter, active teal */
    --accent-color: #94d2bd;    /* A soft, calming mint green */
    --success-color: #2a9d8f;   /* A positive, reassuring green */
    --danger-color: #e76f51;    /* A clear but not overly aggressive red/orange */
    --light-gray: #f8f9fa;      /* Clean, light background */
    --medium-gray: #e9ecef;    /* For borders and subtle backgrounds */
    --dark-gray: #6c757d;       /* Secondary text */
    --text-color: #212529;      /* Main text color for readability */
    --white: #fff;
}

/* --- Sidebar Container --- */
.nav-lateral {
    border-right: 1px solid var(--medium-gray);
    box-shadow: 3px 0px 15px -5px rgba(0,0,0,0.1);
}

/* --- Menu Header/Logo Styles --- */
.nav-lateral-content {
    background-color: var(--primary-color); /* Use primary blue for the header background */
}

.nav-lateral-avatar {
    padding: 20px 10px;
    background-color: var(--primary-color);
    color: var(--white);
}

.nav-lateral-avatar img {
    max-width: 120px;  /* Increased max-width for better visibility */
    max-height: 120px; /* Set a max-height */
    border-radius: 15px; /* Softer, rounded rectangle corners */
    object-fit: contain; /* Ensure the entire logo is visible without being cropped */
    border: 3px solid var(--white);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* --- Modern Menu Styles --- */

/* Hide the 'x' icon inside the avatar section for a cleaner look */
.nav-lateral-avatar > .fa-times-circle {
    display: none;
}

/* Style for all menu links */
.nav-lateral-menu a {
    text-decoration: none !important; /* Remove underline */
    display: block;
    padding: 12px 15px; /* Increased padding for better spacing */
    margin: 4px 10px; /* Vertical margin for separation, horizontal for inset look */
    border-radius: 8px; /* Slightly more rounded corners for a softer look */
    color: var(--text-color); /* Main text color */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    position: relative; /* Needed for positioning the arrow icon */
    box-sizing: border-box; /* Include padding and border in the element's total width */
}


/* Hover effect for all menu links */
.nav-lateral-menu a:hover {
    background-color: var(--primary-hover); /* Use accent color on hover */
    color: var(--white);
}

/* Style for the currently active link (if you have a class for it) */
.nav-lateral-menu li.active > a {
    background-color: var(--primary-color); /* Use primary color for active link */
    color: var(--primary-color); /* Use a primary color for the text */
    color: var(--white);
    font-weight: 500;
}

/* Submenu styling */
.nav-lateral-menu ul ul {
    padding-left: 15px; /* Indent submenus */
    margin-left: 15px;
    border-left: 2px solid var(--accent-color); /* Use a subtle accent color for the guide line */
    list-style: none; /* Remove default list bullets */
}

.nav-lateral-menu ul ul a {
    padding-left: 15px; /* Adjust padding for sub-items */
    font-size: 0.9rem; /* Slightly smaller font for sub-items */
    margin: 2px 0;
    color: var(--dark-gray);
    font-weight: 400;
}

/* --- Submenu Toggle Button Fix --- */

/* Position the down-arrow icon on the right */
.nav-btn-submenu > .fa-chevron-down {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

/* Rotate the arrow when the submenu is active/open */
.nav-btn-submenu.active > .fa-chevron-down {
    transform: translateY(-50%) rotate(180deg);
}

/* --- Scrollbar Dragger Position Fix --- */
.mCSB_scrollTools_vertical .mCSB_dragger {
    margin-left: 10px;
}

/* Ensure the menu bar separator is a light, subtle color */
.nav-lateral-bar {
    background-color: var(--medium-gray);
}

/* --- System-Wide Button & Form Styles --- */

/* Primary Action Button (Save, Submit, etc.) */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--white);
}

/* Success Button */
.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

/* Warning/Danger Buttons (Delete, Deactivate) */
.btn-warning,
.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--white);
}
.btn-warning:hover,
.btn-danger:hover {
    background-color: #d95f43; /* A slightly darker shade for hover */
    border-color: #d95f43;
    color: var(--white);
}

/* Style for focused form inputs to match the theme */
.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(148, 210, 189, 0.5); /* Accent color with transparency */
}

/* --- Responsive Design Adjustments --- */

/* For tablets and smaller devices */
@media (max-width: 991.98px) {
    .nav-lateral {
        transform: translateX(-100%); /* Hide menu off-screen by default */
        transition: transform 0.3s ease-in-out;
    }

    .nav-lateral.show-nav-lateral {
        transform: translateX(0); /* Bring menu into view when toggled */
        z-index: 1040; /* Ensure it's above the page content */
    }

    .page-content {
        padding-left: 0 !important; /* Remove the fixed padding */
    }

    .nav-lateral-bg.show-nav-lateral {
        display: block; /* Show the overlay */
        z-index: 1039; /* Position it behind the menu but over the content */
    }

    .navbar-info .float-left {
        display: block !important; /* Ensure the toggle button is always visible */
    }
}
