/* Importing Google Fonts - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(#F1FAFF, #CBE4FF);
}

.sidebar {
    position: fixed;
    width: 270px;
    margin: 16px;
    border-radius: 16px;
    background: #007bff;
    height: calc(100vh - 32px);
    overflow: hidden;
    will-change: width;
    transition: width 0.38s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-radius 0.28s ease;
    left: 0px;
}

.sidebar.collapsed {
    width: 85px;
}

.sidebar .sidebar-header {
    display: flex;
    position: relative;
    padding: 25px 20px;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header .header-logo img {
    width: 46px;
    height: 46px;
    display: block;
    object-fit: contain;
    border-radius: 50%;


}

.sidebar-header .toggler {
    height: 35px;
    width: 35px;
    color: #007bff;
    border: none;
    cursor: pointer;
    display: flex;
    background: #fff;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.22s ease, color 0.22s ease;
}

.sidebar-header .sidebar-toggler {
    position: absolute;
    right: 20px;
}

.sidebar-header .menu-toggler {
    display: none;
}

.sidebar.collapsed .sidebar-header .toggler {
    transform: translate(-4px, 65px);
}

.sidebar-header .toggler:hover {
    background: #dde4fb;
}

.sidebar-header .toggler span {
    font-size: 1.75rem;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar.collapsed .sidebar-header .toggler span {
    transform: rotate(180deg);
}

.sidebar-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 4px;
    padding: 0 15px;
    flex-direction: column;
    transform: translateY(15px);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar.collapsed .sidebar-nav .primary-nav {
    transform: translateY(65px);
}

.sidebar-nav .nav-link {
    color: #fff;
    display: flex;
    gap: 12px;
    white-space: nowrap;
    border-radius: 8px;
    padding: 12px 15px;
    align-items: center;
    text-decoration: none;
    transition: color 0.22s ease, background-color 0.22s ease, border-radius 0.3s ease, padding 0.34s cubic-bezier(0.22, 1, 0.36, 1), transform 0.22s ease;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    border-radius: 12px;
}

.sidebar .sidebar-nav .nav-link .nav-label {
    display: inline-block;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: max-width 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar.collapsed .sidebar-nav .nav-link .nav-label {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
}

.sidebar-nav .nav-link .nav-icon {
    flex-shrink: 0;
    transition: transform 0.24s ease;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
}

.sidebar-nav .nav-link:hover {
    color: #151A2D;
    background: #fff;
}

.sidebar-nav .nav-item {
    position: relative;
}

.sidebar-nav .nav-tooltip {
    position: absolute;
    top: -10px;
    opacity: 0;
    color: #151A2D;
    display: none;
    pointer-events: none;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    background: #fff;
    left: calc(100% + 25px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    transition: 0s;
}

.sidebar.collapsed .sidebar-nav .nav-tooltip {
    display: block;
}

.sidebar-nav .nav-item:hover .nav-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(50%);
    transition: all 0.4s ease;
}

.sidebar-nav .secondary-nav {
    position: absolute;
    bottom: 30px;
    width: 100%;
}

/* Responsive media query code for small screens */

@media (max-width: 1024px) {
    .sidebar {
        width: 85px;
        /* Collapsed by default on small screens */
        margin: 13px;
        height: calc(100vh - 26px);
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .sidebar.menu-active {
        width: 270px;
        /* Expanded width on small screens */
        overflow-y: auto;
    }

    .sidebar .sidebar-header {
        position: sticky;
        top: 0;
        z-index: 20;
        border-radius: 16px;
        background: #007bff;
        padding: 8px 10px;
    }

    .sidebar-header .header-logo img {
        width: 40px;
        height: 40px;
    }

    .sidebar-header .sidebar-toggler {
        display: none;
        /* Hide desktop toggler on small screens */
    }

    .sidebar-header .menu-toggler {
        display: flex;
        /* Show mobile toggler on small screens */
        height: 30px;
        width: 30px;
    }

    .sidebar-header .menu-toggler span {
        font-size: 1.3rem;
    }

    .sidebar .sidebar-nav .nav-list {
        padding: 0 10px;
    }

    .sidebar-nav .nav-link {
        gap: 10px;
        padding: 10px;
        font-size: 0.94rem;
    }

    .sidebar-nav .nav-link .nav-icon {
        font-size: 1.37rem;
    }

    .sidebar-nav .secondary-nav {
        position: relative;
        bottom: 0;
        margin: 40px 0 30px;
    }
}

/* Style for the logout link */
.logout-link {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Space between icon and text */
    color: #dc3545;
    /* Red color for logout */
    text-decoration: none;
    font-weight: bold;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}


/* Hover effect */
.logout-link:hover {
    background: #f8d7da;
    /* Light red background */
}

/* Icon styling */

/* Autocomplete suggestions */
.suggestions {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestions li {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggestions li:last-child {
    border-bottom: none;
}

.suggestions li:hover {
    background-color: #f0f0f0;
}
