/* Shared Fotogenic Sidebar (app + account) */

.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 100;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding-left: 10px;
}

.logo-text {
    font-family: 'Jost', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.mobile-sidebar-close {
    display: none;
    margin-left: auto;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: auto;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.nav-item:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-color);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.25);
}

.nav-item.nav-item-highlighted,
.nav-item.nav-item-highlighted:hover,
.nav-item.nav-item-highlighted.active {
    background: var(--input-bg);
    color: var(--text-primary) !important;
    box-shadow: none;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-top-up {
    width: 100%;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-top: 12px;
    margin-bottom: 12px;
    transition: 0.2s;
}

.btn-top-up svg {
    width: 16px;
    height: 16px;
}

.btn-top-up:hover {
    filter: brightness(1.05);
}

.user-panel {
    margin-top: 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--input-bg);
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-credits {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}

.sidebar .icon-btn:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.sidebar .icon-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.sidebar-backdrop {
    display: none;
}

@media (min-width: 1201px) {
    .mobile-sidebar-close {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .app-container.sidebar-mobile-enabled .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 320px);
        height: 100%;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        z-index: 220;
    }

    .app-container.sidebar-mobile-enabled.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app-container.sidebar-mobile-enabled .brand {
        justify-content: space-between;
        padding-left: 0;
    }

    .app-container.sidebar-mobile-enabled .mobile-sidebar-close {
        display: inline-flex;
    }

    .app-container.sidebar-mobile-enabled .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 210;
    }

    .app-container.sidebar-mobile-enabled.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}
