/**
 * 加入已有分组对话框样式
 * ===========================================
 * 提供轻量级的列表选择界面，用于选择目标分组。
 */

.group-selection-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.45);
    z-index: 22000;
    width: 100vw;
    height: 100vh;
}

.group-selection-overlay.visible {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.group-selection-dialog {
    position: relative;
    width: min(420px, calc(100% - 64px));
    max-height: calc(100vh - 96px);
    background: var(--color-bg-tertiary, #2a2a2a);
    color: var(--color-text-secondary, #cccccc);
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--color-border-medium, #555555);
    box-shadow: var(--shadow-lg, 0 16px 32px rgba(0, 0, 0, 0.35));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[data-theme="light"] .group-selection-dialog {
    background: #ffffff;
    color: #1f2933;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.group-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-border-light, #333333);
}

[data-theme="light"] .group-selection-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.group-selection-title {
    font-size: var(--font-size-md, 1rem);
    font-weight: var(--font-weight-semibold, 600);
    margin: 0;
}

.group-selection-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: var(--radius-base, 4px);
    transition: background-color var(--duration-fast, 150ms) ease;
}

.group-selection-close:hover,
.group-selection-close:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .group-selection-close:hover,
[data-theme="light"] .group-selection-close:focus {
    background: rgba(15, 23, 42, 0.08);
}

.group-selection-body {
    padding: 16px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.group-selection-hint {
    margin: 0;
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-muted, #888888);
}

[data-theme="light"] .group-selection-hint {
    color: rgba(15, 23, 42, 0.6);
}

.group-selection-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    border: 1px solid var(--color-border-light, #333333);
    border-radius: var(--radius-md, 6px);
    background: rgba(20, 20, 20, 0.4);
    padding: 0;
}

.group-selection-list::-webkit-scrollbar {
    width: 6px;
}

.group-selection-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 3px;
}

[data-theme="light"] .group-selection-list {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(15, 23, 42, 0.12);
}

.group-selection-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 8px 14px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: background-color var(--duration-fast, 150ms) ease,
                color var(--duration-fast, 150ms) ease;
}

.group-selection-option:last-child {
    border-bottom: none;
}

.group-selection-option:hover,
.group-selection-option:focus {
    outline: none;
    background: rgba(255, 107, 53, 0.12);
}

[data-theme="light"] .group-selection-option:hover,
[data-theme="light"] .group-selection-option:focus {
    background: rgba(255, 107, 53, 0.08);
}

.group-selection-option .group-name {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-medium, 500);
    color: var(--color-text-primary, #f1f5f9);
}

[data-theme="light"] .group-selection-option .group-name {
    color: rgba(15, 23, 42, 0.85);
}

.group-selection-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--color-border-light, #333333);
}

[data-theme="light"] .group-selection-footer {
    border-top-color: rgba(15, 23, 42, 0.08);
}

.group-selection-cancel {
    min-width: 88px;
    height: 34px;
    border-radius: var(--radius-base, 4px);
    border: 1px solid var(--color-border-light, #333333);
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color var(--duration-fast, 150ms) ease,
                border-color var(--duration-fast, 150ms) ease;
}

.group-selection-cancel:hover,
.group-selection-cancel:focus {
    outline: none;
    border-color: var(--color-primary, #ff6b35);
    background: rgba(255, 107, 53, 0.1);
}

[data-theme="light"] .group-selection-cancel {
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .group-selection-cancel:hover,
[data-theme="light"] .group-selection-cancel:focus {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.24);
}
