/* Base styles */
body {
    background: #f5f5f5;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
}

/* Sidebar core styles */
.sidebar-wrapper {
    width: 300px;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    background-color: #3c6d79;
    top: 0;
    left: -300px;
    z-index: 999;
    transition: all 0.3s ease;
    overflow: visible;
}

/* Page wrapper */
.page-wrapper {
    height: 100vh;
}

.page-wrapper.toggled .sidebar-wrapper {
    left: 0px;
}

@media screen and (min-width: 768px) {
    .page-wrapper.toggled .page-content {
        padding-left: 300px;
    }
}

/* Sidebar components */
.sidebar-content {
    max-height: calc(100% - 30px);
    height: calc(100% - 30px);
    overflow-y: auto;
    position: relative;
    overflow: visible;
}

.sidebar-content.desktop {
    overflow-y: hidden;
}

/* Sidebar brand/header */
.sidebar-brand {
    padding: 10px 20px;
    display: flex;
    align-items: center;
}

.sidebar-brand > a {
    text-transform: uppercase;
    font-weight: bold;
    flex-grow: 1;
    color: #E0E2EE;
    text-decoration: none;
}

.sidebar-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    overflow: hidden;
}

.sidebar-header .user-pic {
    float: left;
    width: 60px;
    padding: 2px;
    border-radius: 12px;
    margin-right: 15px;
    overflow: hidden;
}

.sidebar-header .user-info {
    float: left;
    color: #E0E2EE;
}

.sidebar-header .user-info > span {
    display: block;
}

.sidebar-header .user-info .user-role {
    font-size: 12px;
}

.sidebar-header .user-info .user-status {
    font-size: 11px;
    margin-top: 4px;
}

.sidebar-header .user-info .user-status i {
    font-size: 8px;
    margin-right: 4px;
    color: #5cb85c;
}

.header-logo {
    margin-left: auto;
    padding-right: 10px;
}

/* Menu styles */
.sidebar-menu,
.sidebar-menu ul,
.treeview-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}



.sidebar-menu > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5px 12px 15px;
  }
  .menu-actions {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    flex-shrink: 0; /* Prevents folder icon from wrapping */
  }

.menu-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 0; /* Important for text overflow handling */
  }



.menu-content > i {
    width: 20px;
}

.menu-content > span {
    margin-left: 10px;
    flex-grow: 1;
}

.sidebar-menu > li > a > .fa {
    width: 20px;
}

.sidebar-menu > li:hover > a,
.sidebar-menu > li.active > a {
    color: #E0E2EE;
    background: #f9ae65;
    border-left-color: #f9ae65;
    font-weight: 600;
}

/* Treeview menu */
.treeview-menu {
    display: none;
    list-style: none;
    padding: 0 0 0 5px;
    margin: 0;
    background: #4a858f;
}

.sidebar-menu > li > .treeview-menu {
    margin: 0 1px;
}

.treeview-menu > li {
    margin: 0;
    position: relative;
}

.treeview-menu > li > a {
    padding: 5px 5px 5px 15px;
    display: block;
    font-size: 14px;
    color: #E0E2EE;
}

.treeview-menu > li.active > a,
.treeview-menu > li > a:hover {
    color: #E0E2EE;
    background: #f9ae65;
    font-weight: 600;
}

/* Show/Hide sidebar button */
#show-sidebar {
    position: fixed;
    left: 0;
    top: 10px;
    border-radius: 0 4px 4px 0px;
    width: 35px;
    transition-delay: 0.3s;
}

.page-wrapper.toggled #show-sidebar {
    left: -40px;
}

/* Sidebar footer */
.sidebar-footer {
    position: absolute;
    width: 100%;
    bottom: 0;
    display: flex;
    background: #e9ecef;
    box-shadow: 0px -1px 5px rgba(0,0,0,0.1);
    border-top: 1px solid #dee2e6;
}

.sidebar-footer > a {
    flex-grow: 1;
    text-align: center;
    height: 30px;
    line-height: 30px;
    position: relative;
    color: #495057;
}

.sidebar-footer > a:hover {
    color: #212529;
}

/* Scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #525965 transparent;
}

/* Page content */
.page-content {
    display: inline-block;
    width: 100%;
    padding-left: 0px;
    padding-top: 20px;
    overflow-x: hidden;
}

.page-content > div {
    padding: 20px 40px;
}

/* Login form styles */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    color: #196b83;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #0b2235;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #4a92ae;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #196b83;
}

.error-message {
    color: #dc3545;
    margin-bottom: 15px;
    text-align: center;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #428bca;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #2a6496;
}

/* Additional Sidebar Menu Styles */
.sidebar-menu li.header {
    padding: 10px 25px 10px 15px;
    font-size: 12px;
    color: #f9ae65;
    background: #3c6d79;
}

.sidebar-menu li > a > .fa-angle-left {
    display: none;
}

.sidebar-menu li.active > a > .fa-angle-left {
    transform: rotate(-90deg);
}

.sidebar-menu li.active > .treeview-menu {
    display: block;
}

.sidebar-menu a {
    color: #E0E2EE;
    text-decoration: none;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.treeview-menu .treeview-menu {
    padding-left: 20px;
}

.treeview-menu > li > a > .fa {
    width: 20px;
}

.treeview-menu > li > a > .fa-angle-left,
.treeview-menu > li > a > .fa-angle-down {
    width: auto;
}

.sidebar-menu > li .label,
.sidebar-menu > li .badge {
    margin-top: 3px;
    margin-right: 5px;
}

/* Content wrapper */
.content-wrapper {
    margin-left: 250px;
    padding: 15px;
}

iframe[name="iframe"] {
    width: 100%;
    height: 100vh;
    border: none;
    display: block;
}

.iframe-container {
    height: 100vh;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Menu launch icon styles */
.menu-launch {
    margin-left: 15px;
    opacity: 0.7;
    cursor: pointer;
    padding: 5px;
}

.menu-launch:hover {
    opacity: 1;
    color: #f9ae65;
}

/* Ensure proper spacing for menu items */
.sidebar-menu > li > a {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-menu > li > a > span:not(.pull-right) {
    flex-grow: 1;
    margin-left: 10px;
}

.sidebar-menu > li > a > .fa-angle-left {
    margin-left: 10px;
}

.fa-angle-left.pull-right {
    display: none;
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: fixed;
    opacity: 0;
    visibility: hidden;
    background: linear-gradient(145deg, #2c3e50, #3498db);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    width: max-content;
    max-width: 300px;
    left: 310px;
    transform: translateY(-50%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    white-space: normal;
    line-height: 1.5;
    pointer-events: none;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

[data-tooltip]:after {
    content: '';
    position: fixed;
    left: 302px;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: #2c3e50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip].show-tooltip:before,
[data-tooltip].show-tooltip:after {
    opacity: 1;
    visibility: visible;
}

[data-tooltip].show-tooltip:before {
    transform: translateY(-50%) translateX(5px);
    animation: tooltipGlow 2s infinite alternate;
}

@keyframes tooltipGlow {
    from {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                    0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    to {
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3),
                    0 0 0 1px rgba(255, 255, 255, 0.2);
    }
}

.treeview-menu [data-tooltip]:before {
    left: 310px;
    content: attr(data-tooltip);
}

.treeview-menu [data-tooltip]:after {
    left: 302px;
}

/* Only apply scroll to the menu itself */
.sidebar-menu {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: visible;
}


/* Ensure submenus don't inherit flex properties */
.treeview-menu {
    display: none;
    width: 100%;
}

.treeview-menu.menu-open {
    display: block;
}

/* Add these styles to your CSS file */
.treeview-menu > li > a.menu-item-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-right: 15px;
    box-sizing: border-box;
}

.menu-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.menu-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    white-space: nowrap;
}

.treeview-menu li a {
    padding-right: 8px;
}

.treeview-menu .treeview-menu > li > a.menu-item-container {
    padding-right: 15px;
}

.profile-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-pic {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-pic i {
    color: #E0E2EE;
}

/* Add these styles for the search box */
.sidebar-search {
    padding: 15px;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-search .input-group {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-search .form-control {
    background: transparent;
    border: none;
    color: #E0E2EE;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
}

.sidebar-search .form-control::placeholder {
    color: rgba(224,226,238,0.6);
}

.sidebar-search .form-control:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(249,174,101,0.3);
}

.sidebar-search .input-group-append {
    padding: 8px 12px;
    color: #E0E2EE;
    cursor: pointer;
    transition: color 0.3s ease;
}

.sidebar-search .input-group-append:hover {
    color: #f9ae65;
}

/* Highlight matching text in search results */
.sidebar-menu li.search-highlight > a {
    background-color: rgba(249,174,101,0.2);
}

/* Ensure search box is visible in mobile */
@media screen and (max-width: 768px) {
    .sidebar-search {
        padding: 10px;
    }
}