.premium-sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a1a, #2e2e2e);
    color: #e0e0e0;
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transition: width 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden; /* Added to prevent horizontal overflow */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-title {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    font-weight: bold;
    color: #1a73e8;
}

.user-info {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.username {
    font-weight: 600;
}

.user-status {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-icon {
    font-size: 0.6rem;
}

.status-icon.offline { color: #888; }
.status-icon.online { color: #2e7d32; }

.sidebar-toggle {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5rem;
    display: none; /* Hidden on desktop by default */
}

/* Profile Section */
.profile-section {
    text-align: center;
    margin-bottom: 20px;
}

.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #1a73e8;
    transition: transform 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.05);
}

.profile-stats {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #bbb;
}

.profile-stats span {
    display: block;
    margin: 5px 0;
}

.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.auth-btn {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
}

/* Navigation Menu */
.sidebar-nav .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 5px;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, padding-left 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background-color: #333;
    padding-left: 20px;
}

.nav-link i {
    font-size: 1.2rem;
}

.dropdown-toggle::after {
    display: none; /* Hide default Bootstrap arrow */
}

.dropdown-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown.open .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    list-style: none;
    padding: 5px 0;
    margin-left: 20px;
    background: #252525;
    border-radius: 5px;
    position: relative; /* Changed from default to keep within sidebar */
    width: calc(100% - 20px); /* Ensure it fits within sidebar padding */
}

.dropdown.open .dropdown-menu {
    display: block;
    max-height: 200px; /* Added to limit dropdown height */
    overflow-y: auto; /* Added to scroll if content exceeds max-height */
}

.dropdown-item {
    padding: 8px 15px;
    color: #e0e0e0;
    text-decoration: none;
    display: block;
}

.dropdown-item:hover {
    background-color: #3a3a3a;
}


/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 20px;
    width: calc(100% - 40px);
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #bbb;
    text-decoration: none;
    border-radius: 5px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #e0e0e0;
    background-color: #333;
}

.sidebar-upgrade {
    margin-top: 10px;
}

.upgrade-btn {
    display: block;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #1a73e8, #2e7d32);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.upgrade-btn:hover {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 767px) {
    .premium-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 10px;
        transform: translateX(-100%);
    }

    .premium-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-header {
        flex-direction: row-reverse;
    }

    .profile-section {
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: left;
    }

    .profile-img {
        width: 60px;
        height: 60px;
    }

    .profile-stats {
        font-size: 0.8rem;
    }

    .profile-actions {
        flex-direction: column;
        gap: 5px;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    [data-tooltip]:hover::after {
        display: none; /* Hide tooltips on mobile */
    }
}
