/* ============================================================
   team.css — Team page view styles
   ============================================================ */

/* ── Page Container ────────────────────────────── */
.team-view {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* ── Section ───────────────────────────────────── */
.team-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.team-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-1);
}

.team-section-title {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--font-semibold);
}

.team-section-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--font-semibold);
}

/* ── Page Divider ──────────────────────────────── */
.team-page-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-2) 0;
}

.team-page-divider-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--font-semibold);
    text-align: center;
    margin-top: var(--space-1);
}

/* ── My Teams List ─────────────────────────────── */
.team-teams-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.team-team-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
}

.team-team-row:hover {
    background: var(--bg-hover);
}

.team-team-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    flex-shrink: 0;
    text-transform: uppercase;
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
}

.team-team-icon.active {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

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

.team-team-name {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: var(--font-medium);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-team-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* ── Active Badge ──────────────────────────────── */
.team-active-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    color: var(--accent-success);
    background: var(--accent-success-bg);
    flex-shrink: 0;
}

/* ── Team Action Buttons ───────────────────────── */
.team-switch-btn {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.team-switch-btn:hover {
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.team-leave-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    opacity: 0;
}

.team-team-row:hover .team-leave-btn {
    opacity: 1;
}

.team-leave-btn:hover {
    color: var(--accent-danger);
    background: var(--accent-danger-bg);
}

/* ── Invites Received ──────────────────────────── */
.team-invites-received-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.team-invite-received-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
}

.team-invite-received-row:hover {
    background: var(--bg-hover);
}

.team-invite-received-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

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

.team-invite-received-team {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: var(--font-medium);
}

.team-invite-received-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
}

.team-invite-received-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

.team-accept-btn {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent-success);
    color: white;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.team-accept-btn:hover {
    opacity: 0.85;
}

.team-decline-btn {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.team-decline-btn:hover {
    color: var(--accent-danger);
    border-color: var(--accent-danger);
    background: var(--accent-danger-bg);
}

/* ── Team Name Section ─────────────────────────── */
.team-name-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.team-name-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    padding: var(--space-3) var(--space-3);
    transition: border-color var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
}

.team-name-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.team-name-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Members List ──────────────────────────────── */
.team-member-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.team-member-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
}

.team-member-row:hover {
    background: var(--bg-hover);
}

.team-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    flex-shrink: 0;
    text-transform: uppercase;
}

.team-member-avatar.owner {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
}

.team-member-avatar.admin {
    background: var(--accent-info-bg);
    color: var(--accent-info);
}

.team-member-avatar.member {
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
}

.team-member-avatar.viewer {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

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

.team-member-email {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: var(--font-medium);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-member-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
}

/* ── Role Badges ───────────────────────────────── */
.team-role-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    text-transform: capitalize;
}

.team-role-badge.owner {
    color: var(--accent-warning);
    background: var(--accent-warning-bg);
}

.team-role-badge.admin {
    color: var(--accent-info);
    background: var(--accent-info-bg);
}

.team-role-badge.member {
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

.team-role-badge.viewer {
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
}

/* ── Role Select ───────────────────────────────── */
.team-role-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    padding: 3px 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.team-role-select:focus {
    outline: none;
    border-color: var(--border-focus);
}

/* ── Remove Button ─────────────────────────────── */
.team-remove-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    line-height: 1;
    opacity: 0;
}

.team-member-row:hover .team-remove-btn,
.team-pending-row:hover .team-remove-btn {
    opacity: 1;
}

.team-remove-btn:hover {
    color: var(--accent-danger);
    background: var(--accent-danger-bg);
}

/* ── Invite Form ───────────────────────────────── */
.team-invite-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.team-invite-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.team-invite-email {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-3);
    min-width: 0;
    box-sizing: border-box;
}

.team-invite-email:focus {
    outline: none;
    border-color: var(--border-focus);
}

.team-invite-bottom {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    justify-content: flex-end;
}

.team-invite-role {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
}

.team-invite-role:focus {
    outline: none;
    border-color: var(--border-focus);
}

.team-invite-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    padding: var(--space-2) var(--space-5);
    cursor: pointer;
    transition: background var(--transition-fast);
    white-space: nowrap;
}

.team-invite-btn:hover {
    background: var(--accent-primary-hover);
}

.team-invite-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Pending Invites (Sent) ────────────────────── */
.team-pending-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.team-pending-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
}

.team-pending-row:hover {
    background: var(--bg-hover);
}

.team-pending-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

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

.team-pending-email {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-pending-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
}

/* ── Viewer Banner ─────────────────────────────── */
.team-viewer-banner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.team-viewer-banner-icon {
    font-size: var(--text-base);
    flex-shrink: 0;
}

/* ── Empty States ──────────────────────────────── */
.team-empty {
    padding: var(--space-4);
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}
