/* Sidebar Navigation Styles */
.platform-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: rgba(255, 255, 255, 0.85);
    /* Glass effect base */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--platform-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s var(--ease-out-expo);
    padding: var(--space-6) 0;
    box-sizing: border-box;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .platform-sidebar {
        background: rgba(28, 28, 30, 0.85);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Header Section */
.sidebar-header {
    padding: 0 var(--space-6) var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--ios-blue) 0%, #5856D6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Navigation Links */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius-medium);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 15px;
}

.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: var(--platform-primary-light);
    color: var(--platform-primary);
    font-weight: 600;
}

.sidebar-link .icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sidebar-link.active .icon {
    opacity: 1;
}

.sidebar-section-label {
    padding: var(--space-4) var(--space-4) var(--space-2);
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Footer Section */
.sidebar-footer {
    padding: var(--space-4) var(--space-4) 0;
    border-top: 1px solid var(--platform-border);
    margin-top: auto;
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-medium);
    transition: background-color 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.user-profile-mini:hover {
    background: rgba(0, 0, 0, 0.05);
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--platform-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
}

.user-info-mini {
    flex: 1;
    overflow: hidden;
}

.user-name-mini {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-mini {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Desktop Layout Adjustments - When Sidebar is Visible */
@media (min-width: 1025px) {

    /* Offset main content for sidebar width ONLY when sidebar is present */
    .platform-sidebar+.relative {
        margin-left: 280px;
    }

    /* Hide the in-page navigation toolbar on desktop - sidebar handles navigation */
    .ios-nav {
        display: none !important;
    }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .platform-sidebar {
        transform: translateX(-100%);
    }

    .platform-sidebar.open {
        transform: translateX(0);
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.1);
    }

    /* On mobile, show the navigation toolbar */
    .ios-nav {
        display: flex !important;
    }
}

/* Sign Out Button Styling */
.sidebar-signout {
    border-radius: var(--radius-medium);
}

.sidebar-signout:hover {
    background: rgba(255, 59, 48, 0.1);
    color: var(--platform-error);
    transform: translateX(2px);
}

.sidebar-signout .icon {
    opacity: 0.8;
}

.sidebar-signout:hover .icon {
    opacity: 1;
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    .sidebar-link:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .sidebar-link.active {
        background: rgba(10, 132, 255, 0.15);
    }

    .user-profile-mini:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .sidebar-signout:hover {
        background: rgba(255, 59, 48, 0.15);
    }
}