/* ============================================================
   Group Sessions Modal — Full-viewport overlay
   Manage sessions in/out of a group
   Desktop: two-column layout | Mobile: tabbed view
   ============================================================ */

/* ---- Overlay Container ---- */
.gs-overlay {
    position: fixed;
    inset: 0;
    z-index: 10004;
    background: var(--bg-color, #000);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.gs-overlay.open {
    transform: translateX(0);
    pointer-events: auto;
}

/* ---- Header ---- */
.gs-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    flex-shrink: 0;
}

.gs-header-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

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

.gs-header-info h2 {
    font-family: var(--font-display, 'DM Sans', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #e4e4e7);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-header-info p {
    font-size: 0.8rem;
    color: var(--text-muted, #71717a);
    margin: 3px 0 0;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.gs-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover, #1a1a1d);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    color: var(--text-secondary, #a1a1aa);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.gs-close-btn:hover {
    background: var(--surface-active, #27272a);
    color: var(--text-primary, #e4e4e7);
}

/* ---- Mobile Tab Bar (hidden on desktop) ---- */
.gs-tab-bar {
    display: none;
    padding: 0 28px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    flex-shrink: 0;
}

.gs-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted, #71717a);
    font-family: var(--font-display, 'DM Sans', sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.15s;
}

.gs-tab.active {
    color: var(--text-primary, #e4e4e7);
    border-bottom-color: var(--accent, #3bf692);
}

.gs-tab:hover:not(.active) {
    color: var(--text-secondary, #a1a1aa);
}

/* ---- Two-Column Content (Desktop) ---- */
.gs-columns {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.gs-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.gs-section + .gs-section {
    border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

/* Section header */
.gs-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 10px;
    flex-shrink: 0;
}

.gs-section-title {
    font-family: var(--font-display, 'DM Sans', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted, #71717a);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gs-section-count {
    font-family: var(--font-display, 'DM Sans', sans-serif);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary, #a1a1aa);
    background: var(--surface-hover, rgba(255, 255, 255, 0.06));
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.gs-section-spacer {
    flex: 1;
}

/* Select All checkbox */
.gs-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted, #71717a);
    cursor: pointer;
    letter-spacing: 0.02em;
}

.gs-select-all input[type="checkbox"] {
    accent-color: var(--accent, #3bf692);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Bulk action button */
.gs-bulk-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.gs-bulk-btn.visible {
    display: flex;
}

.gs-bulk-btn.add {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    box-shadow: 0 1px 4px rgba(91, 33, 182, 0.3);
}

.gs-bulk-btn.remove {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    box-shadow: 0 1px 4px rgba(185, 28, 28, 0.3);
}

.gs-bulk-btn:hover {
    opacity: 0.9;
}

/* Section search */
.gs-section-search {
    padding: 0 20px 10px;
    flex-shrink: 0;
}

.gs-search-input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    background: var(--input-bg, #18181b);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-md, 8px);
    color: var(--text-primary, #e4e4e7);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    outline: none;
    transition: border-color 0.2s;
    min-height: 40px;
}

.gs-search-input::placeholder {
    color: var(--text-muted, #71717a);
    font-weight: 400;
    letter-spacing: 0.015em;
}

.gs-search-input:focus {
    border-color: var(--accent, #3bf692);
}

.gs-section-search {
    position: relative;
}

.gs-section-search i {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #71717a);
    font-size: 0.78rem;
    pointer-events: none;
}

/* Session list */
.gs-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px;
}

/* ---- Session Row ---- */
.gs-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.04));
    transition: background 0.12s;
    border-radius: var(--radius-sm, 6px);
}

.gs-row:hover {
    background: var(--surface-hover, rgba(255, 255, 255, 0.03));
}

.gs-row:last-child {
    border-bottom: none;
}

.gs-row-checkbox {
    accent-color: var(--accent, #3bf692);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

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

.gs-row-name {
    display: block;
    font-family: var(--font-display, 'DM Sans', sans-serif);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--text-primary, #e4e4e7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.gs-row-time {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted, #71717a);
    letter-spacing: 0.02em;
}

.gs-row-badge {
    font-family: var(--font-display, 'DM Sans', sans-serif);
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent, #3bf692);
    padding: 2px 7px;
    border-radius: 8px;
    min-width: 20px;
    text-align: center;
    letter-spacing: 0.02em;
}

/* Action button per row */
.gs-row-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.gs-row-action.add {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    box-shadow: 0 1px 4px rgba(91, 33, 182, 0.25);
}

.gs-row-action.add:hover {
    box-shadow: 0 2px 8px rgba(91, 33, 182, 0.4);
}

.gs-row-action.remove {
    background: var(--surface-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-muted, #71717a);
}

.gs-row-action.remove:hover {
    background: var(--error-dim, rgba(220, 38, 38, 0.15));
    color: var(--error-light, #ef4444);
}

/* Empty state per section */
.gs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.gs-empty i {
    font-size: 1.8rem;
    color: var(--text-muted, #71717a);
    margin-bottom: 12px;
}

.gs-empty p {
    font-size: 0.85rem;
    color: var(--text-muted, #71717a);
    margin: 0;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .gs-header {
        padding: 16px 16px 12px;
    }

    .gs-tab-bar {
        display: flex;
        padding: 0 16px;
    }

    .gs-columns {
        flex-direction: column;
    }

    /* Hide inactive section on mobile */
    .gs-section {
        display: none;
    }

    .gs-section.active {
        display: flex;
    }

    .gs-section + .gs-section {
        border-left: none;
    }

    .gs-section-search {
        padding: 0 16px 8px;
    }

    .gs-section-search i {
        left: 28px;
    }

    .gs-section-header {
        padding: 10px 16px 8px;
    }

    .gs-list {
        padding: 0 16px;
    }
}

/* ============================================================
   LIGHT THEME OVERRIDES
   ============================================================ */
html.light-theme .gs-overlay {
    background: var(--bg-color, #f8f2ed);
}

html.light-theme .gs-close-btn {
    background: var(--surface-hover, #efe7df);
    border-color: var(--border, rgba(0, 0, 0, 0.08));
}

html.light-theme .gs-search-input {
    background: var(--input-bg, #f3ece5);
    border-color: var(--border, rgba(0, 0, 0, 0.1));
}

html.light-theme .gs-row:hover {
    background: var(--surface-hover, #efe7df);
}

html.light-theme .gs-row-action.remove {
    background: var(--surface-hover, #efe7df);
}

html.light-theme .gs-section-count {
    background: var(--surface-hover, #efe7df);
}

html.light-theme .gs-row-badge {
    background: var(--accent, #1aab8a);
}
