/* Remote Network Connection - Sidebar Styles
   Standalone CSS for the aside component
*/

/* CSS Variables (Light/Dark mode) */
:root {
    --bg-color: #f3f3f3;
    --sidebar-bg: #f3f3f3;
    --card-bg: #ffffff;
    --text-primary: #1f1f1f;
    --text-secondary: #5d5d5d;
    --accent: #b0f000;
    --border: #e5e5e5;
    --nav-active-bg: #ffffff;
    --hover-bg: rgba(0,0,0,0.05);
    --radius: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #202020;
        --sidebar-bg: #202020;
        --card-bg: #2b2b2b;
        --text-primary: #ffffff;
        --text-secondary: #999999;
        --nav-active-bg: #323232;
        --hover-bg: rgba(255,255,255,0.05);
        --border: #333333;
    }
}

/* Base styles for aside */
aside {
    width: 350px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 8px;
    flex-shrink: 0;
    z-index: 100;
    height: 100%; /* Changed from 100vh to fill the new .settings-layout wrapper */
    box-sizing: border-box;
}

/* Brand/Logo section */
.brand {
    font-size: 18px;
    font-weight: 600;
    padding: 0 12px 16px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 8px;
    user-select: none;
}

/* Navigation container */
nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    flex: 1;
}

/* Nav button base style */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 12px;
    text-decoration: none;
    color: var(--text-primary);
    fill: var(--text-primary);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
    transition: background 0.1s, color 0.1s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--hover-bg);
}

/* Active state */
.nav-btn.active {
    background: var(--nav-active-bg);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border-color: var(--border);
}

.nav-btn.active svg {
    fill: var(--accent);
}

/* Icon sizing */
.nav-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 1px;
    flex-shrink: 0;
}

/* Sub-items */
.nav-sub-item {
    margin-left: 24px;
    padding-left: 10px;
    font-size: 13px;
    position: relative;
    display: none;
    border-left: 2px solid var(--border);
    border-radius: 0 6px 6px 0;
}

.nav-sub-item.visible-item {
    display: flex;
    animation: expandIn 0.2s ease;
    color: var(--accent);
    border-left-color: var(--accent);
}

.hidden-item {
    display: none;
}

@keyframes expandIn {
    from { 
        opacity: 0; 
        transform: translateY(-3px); 
        max-height: 0; 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
        max-height: 40px; 
    }
}

/* Responsive Mobile View */
@media (max-width: 768px) {
    aside {
        width: 100%;
        height: auto; /* Allow auto height on mobile to fit content */
        padding: 8px 12px;
        border-bottom: 1px solid var(--border);
        border-right: none;
        flex-shrink: 0;
        overflow-x: auto; /* Enable horizontal scroll for tabs */
        white-space: nowrap;
        display: block;
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar for cleaner look */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    aside::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .brand {
        display: none;
    }
    
    nav {
        display: flex;
        flex-direction: row;
        gap: 4px;
        padding-bottom: 4px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        justify-content: center;
        border-radius: 16px; /* Pill shape */
        background: var(--card-bg);
        border: 1px solid var(--border);
        height: 32px;
    }
    
    .nav-btn.active {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }
    
    .nav-btn.active svg {
        fill: white;
    }
    
    .nav-sub-item {
        margin-left: 0;
        border-left: none;
        border: 1px solid var(--accent);
        background: var(--accent);
    }

    .nav-btn span {
        font-size: 14px;
        margin-left: 6px;
        display: inline-block;
    }
    
    .nav-btn svg {
        width: 24px;
        height: 24px;
        margin: 0;
    }
}


/* User Menu Wrapper (Bottom area) */
.user-menu-wrapper {
    margin-top: auto;
    position: relative;
    padding-top: 12px;
    display: flex;
    justify-content: flex-start;
    border-top: 1px solid var(--border);
}

/* Avatar Button Style */
.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--card-bg); 
    border: 2px solid var(--border);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.avatar-btn:hover, .user-menu-wrapper:hover .avatar-btn {
    border-color: var(--accent); 
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.avatar-initials {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

/* Online status dot */
.avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border: 2px solid var(--sidebar-bg); 
    border-radius: 50%;
}

/* --- Dropdown Menu --- */
.user-dropdown {
    position: absolute;
    bottom: 100%; 
    left: 10px; 
    width: 200px; 
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px 0;
    margin-bottom: 10px; 
    
    /* Animation state (hidden) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
}

/* Active state (JS adds .show class) */
.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Menu Header (Name) */
.dropdown-header {
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Menu Items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.1s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
}

.dropdown-item.danger:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .user-menu-wrapper {
        margin-top: 0; 
        border-top: none;
        border-left: 1px solid var(--border);
        padding: 4px 12px;
    }

    .user-dropdown {
        bottom: 50px; 
        left: auto;
        right: 10px; /* Align to right on mobile */
    }
}