﻿/* ========== WORKSPACE SWITCHER DROPDOWN ========== */
.workspace-header {
    position: relative;
}

.workspace-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 4px;
    overflow: hidden;
    min-width: 240px;
}

.workspace-dropdown-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted, #888);
    border-bottom: 1px solid var(--border, #e0e0e0);
}

.workspace-dropdown-list {
    max-height: 200px;
    overflow-y: auto;
}

.workspace-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.workspace-dropdown-item:hover {
    background: var(--bg-hover, #f5f5f5);
}

.workspace-dropdown-item.active {
    background: var(--bg-active, #e8f4f4);
}

.workspace-dropdown-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--accent, var(--primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.workspace-dropdown-info {
    flex: 1;
    min-width: 0;
}

.workspace-dropdown-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-dropdown-role {
    font-size: 11px;
    color: var(--text-muted, #888);
    text-transform: capitalize;
}

.workspace-check {
    color: var(--accent, var(--primary));
    font-weight: bold;
}

.workspace-dropdown-divider {
    height: 1px;
    background: var(--border, #e0e0e0);
    margin: 4px 0;
}

.workspace-dropdown-action .workspace-dropdown-icon {
    background: var(--bg-secondary, #f0f0f0);
    color: var(--text-muted, #888);
}

/* ========== TEAM MODAL ========== */
.team-modal {
    max-width: 500px;
    width: 90%;
    /* Prevent content (encryption + API keys sections) from getting clipped
       on shorter viewports — cap height and scroll the inner content. */
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.team-section {
    margin-bottom: 20px;
}

.team-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted, #888);
    margin-bottom: 10px;
}

.team-members-list,
.team-pending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-member-item,
.team-invite-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary, #f8f8f8);
    border-radius: 8px;
}

.team-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent, var(--primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.team-member-info {
    flex: 1;
    min-width: 0;
}

.team-member-email {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-role {
    font-size: 12px;
    color: var(--text-muted, #888);
    text-transform: capitalize;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    cursor: pointer;
    border-radius: 4px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-hover, #eee);
    color: var(--text-primary, #333);
}

/* ========== DARK MODE ========== */
.dark-mode .workspace-dropdown {
    background: var(--bg-primary, #1e1e1e);
    border-color: var(--border, #333);
}

.dark-mode .workspace-dropdown-item:hover {
    background: var(--bg-hover, #2a2a2a);
}

.dark-mode .workspace-dropdown-item.active {
    background: var(--bg-active, #2a3a3a);
}

.dark-mode .team-member-item,
.dark-mode .team-invite-item {
    background: var(--bg-secondary, #2a2a2a);
}
