/* Modern Black Sidebar - Fixed */

/* Base Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 70px;
    background: #000000;
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 1000;
    transition: width 0.25s ease;
    overflow: hidden;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

.sidebar:hover {
    width: 220px;
}

/* Programmatic expansion (for touch/keyboard) */
.sidebar.expanded {
    width: 220px;
}

/* Scrollable Nav Container */
.nav-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0 90px 0; /* Extra bottom padding to prevent overlap with profile */
    scrollbar-width: thin;
    scrollbar-color: #1a1a1a #000000;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Webkit Scrollbar Styling for Sidebar */
.nav-container::-webkit-scrollbar {
    width: 6px;
}

.nav-container::-webkit-scrollbar-track {
    background: #000000;
}

.nav-container::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.nav-container::-webkit-scrollbar-thumb:hover {
    background: #2a2a2a;
}

/* Logo Section */
.logo {
    font-size: 28px;
    color: #ffffff;
    height: 50px;
    min-height: 50px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    padding-left: 22px;
    position: relative;
    user-select: none;
    cursor: pointer;
    flex-shrink: 0;
}

.logo::after {
    content: "Mercury Network";
    position: absolute;
    left: 60px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    letter-spacing: -0.01em;
}

.sidebar:hover .logo::after,
.sidebar.expanded .logo::after {
    opacity: 1;
    transition-delay: 0.1s;
}

/* Navigation Items */
.nav-item {
    height: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding-left: 22px;
    color: #888;
    text-decoration: none;
    position: relative;
    margin: 2px 0;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Left indicator bar */
.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    height: 60%;
    width: 3px;
    background: #ffffff;
    transition: transform 0.2s ease;
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.nav-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active::before {
    transform: translateY(-50%) scaleY(1);
}

/* Navigation Icons */
.nav-item i {
    font-size: 18px;
    width: 26px;
    min-width: 26px;
    text-align: center;
    color: inherit;
}

/* Navigation Text */
.nav-item span {
    margin-left: 16px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sidebar:hover .nav-item span,
.sidebar.expanded .nav-item span {
    opacity: 1;
    transition-delay: 0.05s;
}

/* Simple tooltip */
.nav-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    border: 1px solid #2a2a2a;
}

.sidebar:hover .nav-item[data-tooltip]:hover::after,
.sidebar.expanded .nav-item[data-tooltip]:hover::after {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar:hover,
    .sidebar.expanded {
        width: 200px;
    }
    
    .logo {
        padding-left: 16px;
        font-size: 26px;
    }
    
    .nav-item {
        padding-left: 17px;
        height: 44px;
        min-height: 44px;
    }
    
    .nav-item i {
        font-size: 16px;
    }

    .sidebar-profile-link {
        padding-left: 17px;
        height: 44px;
    }

    .sidebar-avatar {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }

    .sidebar-avatar span {
        font-size: 11px;
    }

    .profile-name {
        font-size: 13px;
    }

    .profile-level-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .profile-xp-bar {
        height: 12px;
    }

    .profile-xp-text {
        font-size: 0.58rem;
    }

    .profile-cash-section {
        font-size: 0.7rem;
        padding: 3px 6px;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 55px;
    }
    
    .sidebar:hover,
    .sidebar.expanded {
        width: 180px;
    }

    .sidebar-profile-link {
        padding-left: 14px;
        height: 42px;
    }

    .sidebar-avatar {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .sidebar-avatar span {
        font-size: 10px;
    }

    .profile-name {
        font-size: 12px;
    }

    .profile-level-badge {
        font-size: 0.7rem;
        padding: 2px 7px;
    }

    .profile-level-badge i {
        font-size: 0.65rem;
    }

    .profile-xp-bar {
        height: 10px;
    }

    .profile-xp-text {
        font-size: 0.54rem;
    }

    .profile-cash-section {
        font-size: 0.68rem;
        padding: 2px 5px;
        gap: 5px;
    }
}

/* Ultra-narrow devices */
@media (max-width: 360px) {
    .sidebar {
        width: 50px;
    }

    .sidebar:hover,
    .sidebar.expanded {
        width: 170px;
    }

    .logo {
        padding-left: 11px;
        font-size: 24px;
    }

    .nav-item {
        padding-left: 12px;
    }

    .sidebar-profile-link {
        padding-left: 12px;
        height: 40px;
    }

    .sidebar-avatar {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }

    .sidebar-avatar span {
        font-size: 9px;
    }

    .profile-name {
        font-size: 11px;
    }

    .profile-level-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .profile-level-badge i {
        font-size: 0.6rem;
    }

    .profile-xp-bar {
        height: 8px;
    }

    .profile-xp-text {
        font-size: 0.5rem;
    }

    .profile-cash-section {
        font-size: 0.65rem;
        padding: 2px 4px;
        gap: 4px;
    }
}

/* Profile Section - Fixed at Bottom */
.sidebar-profile {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 0;
    border-top: 1px solid #1a1a1a;
    background: #000000;
}

/* Profile link - matches nav-item styling */
.sidebar-profile-link {
    height: 48px;
    display: flex;
    align-items: center;
    padding-left: 22px;
    color: #888;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Hover effects matching nav items */
.sidebar-profile-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    height: 60%;
    width: 3px;
    background: #ffffff;
    transition: transform 0.2s ease;
}

.sidebar-profile-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-profile-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}

/* Profile avatar */
.sidebar-avatar {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-profile-link:hover .sidebar-avatar {
    border-color: rgba(255, 213, 79, 0.3);
    box-shadow: 0 0 8px rgba(255, 213, 79, 0.2);
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-avatar span {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

/* Expanded content */
.sidebar-profile-expand {
    margin-left: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.sidebar:hover .sidebar-profile-expand,
.sidebar.expanded .sidebar-profile-expand {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.05s;
}

/* Profile main info */
.profile-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Level badge - exactly like profile.html */
.profile-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 9999px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.profile-level-badge i {
    color: #ffd700;
    font-size: 0.75rem;
}

/* XP Section - exactly like profile.html */
.profile-xp-section {
    width: 100%;
}

.profile-xp-bar {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 9999px;
    height: 14px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.profile-xp-fill {
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
    position: relative;
}

.profile-xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.62rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
    white-space: nowrap;
}

/* Cash Section */
.profile-cash-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    width: 100%;
    font-size: 0.75rem;
}

.profile-cash-section i {
    flex-shrink: 0;
}

/* Tooltip for collapsed state */
.sidebar-profile-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    border: 1px solid #2a2a2a;
}

.sidebar:hover .sidebar-profile-link[data-tooltip]:hover::after,
.sidebar.expanded .sidebar-profile-link[data-tooltip]:hover::after {
    display: none;
}

