/* Sidebar Menu Toggle Buttons */

/* Mobile Button (Inside Search Bar) */
#sidebar-menu-btn-mobile {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #555;
    font-size: 20px;
    cursor: pointer;
    display: none;
    /* Hidden by default (desktop) */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    margin-left: 5px;
    flex-shrink: 0;
}

#sidebar-menu-btn-mobile:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

/* Desktop Button (Top Right Corner) */
#sidebar-menu-btn-desktop {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1005;
    /* Matches home-link-desktop */
    background-color: #fff;
    border: 1px solid #b8b8b8;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

#sidebar-menu-btn-desktop:hover {
    transform: scale(1.1);
    color: var(--primary-color);
    background-color: #f0f8ff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Responsive Visibility */
@media (max-width: 768px) {
    #sidebar-menu-btn-desktop {
        display: none;
    }

    #sidebar-menu-btn-mobile {
        display: flex;
    }
}

/* Sidebar Container */
#right-sidebar-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 25px;
    padding-bottom: calc(25px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow-x: hidden;
}

#right-sidebar-menu.open {
    transform: translateX(0);
}

/* Overlay */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 20px;
}

.sidebar-title {
    font-size: 24px;
    font-weight: 800;
    /* Made it bolder */
    color: var(--text-color, #333);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.sidebar-title img {
    height: 24px;
    width: auto;
}

#sidebar-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#sidebar-close-btn:hover {
    color: var(--primary-color, #0078A8);
    background-color: #f0f2f5;
    transform: rotate(90deg);
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav li {
    margin-bottom: 15px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#right-sidebar-menu.open .sidebar-nav li {
    opacity: 1;
    transform: translateX(0);
}

#right-sidebar-menu.open .sidebar-nav li:nth-child(1) {
    transition-delay: 0.1s;
}

#right-sidebar-menu.open .sidebar-nav li:nth-child(2) {
    transition-delay: 0.15s;
}

#right-sidebar-menu.open .sidebar-nav li:nth-child(3) {
    transition-delay: 0.2s;
}

#right-sidebar-menu.open .sidebar-nav li:nth-child(4) {
    transition-delay: 0.25s;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color, #333);
    text-decoration: none;
    padding: 12px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: var(--light-gray, #f0f2f5);
    color: var(--primary-color, #0078A8);
    padding-left: 15px;
}

.sidebar-nav a.active {
    font-weight: 600;
    background-color: #e6f3f8;
    /* Very light primary color */
}

.sidebar-nav a i {
    width: 24px;
    text-align: center;
    font-size: 18px;
}

/* Sidebar Footer & Socials */
.sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 25px;
    margin-top: auto;
}

.sidebar-footer h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-socials {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

.sidebar-socials a {
    width: 40px;
    height: 40px;
    background-color: var(--light-gray, #f0f2f5);
    color: var(--text-color, #333);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-socials a:hover {
    background-color: var(--primary-color, #0078A8);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 120, 168, 0.2);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #right-sidebar-menu {
        width: 100%;
        max-width: 100%;
    }
}
