/* ══════════════════════════════════════════════════════════════════════════
   Group Management Styles — Dark Theme
   ══════════════════════════════════════════════════════════════════════════ */

.groups-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.group-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.group-card:hover {
    box-shadow: var(--shadow-md);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.group-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: var(--text);
}

.badge-active {
    background: var(--success-bg);
    color: var(--success);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 600;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-owner {
    background: var(--warning-bg);
    color: var(--warning);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 600;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-expired {
    background: var(--warning-bg);
    color: var(--warning);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 600;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.group-details {
    margin-bottom: 15px;
}

.group-details p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.group-code {
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--mono);
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary);
    font-size: 1.05em;
}

.group-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.members-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-card {
    background: var(--surface-alt);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

.member-card:hover {
    box-shadow: var(--shadow-sm);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-icon {
    font-size: 1.8em;
}

.member-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.member-details strong {
    color: var(--text);
    font-size: 1.05em;
}

.member-details small {
    color: var(--text-muted);
    font-size: 0.85em;
}

/* Presence status styling */
.presence-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.presence-status[data-status="online"] { color: var(--success); }
.presence-status[data-status="offline"] { color: var(--text-muted); }
.presence-status[data-status="away"] { color: var(--warning); }
.presence-status[data-status="idle"] { color: var(--text-secondary); }
.presence-status[data-status="dnd"] { color: var(--danger); }

/* Typing Indicator Container */
.typing-indicator-container {
    display: none;
    padding: 8px 12px;
    background: var(--surface-alt);
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease;
}

/* Typing Dots Animation */
.typing-dots {
    display: inline-block;
    width: 24px;
}

.typing-dots::after {
    content: '...';
    animation: typingDots 1.4s infinite;
    font-weight: bold;
    letter-spacing: 2px;
}

@keyframes typingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Presence Indicator (scoped to groups tab — inline badge style) */
#groupsTab .presence-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9em;
    font-weight: 500;
}

#groupsTab .presence-indicator.status-online { background: var(--success-bg); color: var(--success); }
#groupsTab .presence-indicator.status-away { background: var(--warning-bg); color: var(--warning); }
#groupsTab .presence-indicator.status-idle { background: var(--surface-alt); color: var(--text-secondary); }
#groupsTab .presence-indicator.status-dnd { background: var(--danger-bg); color: var(--danger); }
#groupsTab .presence-indicator.status-offline { background: var(--surface-alt); color: var(--text-muted); }

/* Presence Selector */
.presence-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 15px;
}

.presence-selector label {
    font-weight: 600;
    color: var(--text-secondary);
}

.presence-selector select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
}

/* Status indicator inline */
.status-indicator {
    display: inline-block;
    font-size: 0.9em;
    margin-right: 4px;
}

/* Online pulse animation */
.status-online-pulse {
    position: relative;
}

.status-online-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ========== Member Approval Styles ========== */

.badge-approval {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-pending {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    animation: pendingPulse 2s infinite;
}

@keyframes pendingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#groupsTab .btn-warning {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#groupsTab .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

#groupsTab .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#groupsTab .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Pending Requests */
.pending-requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f97316;
}

.pending-requests-header h4 {
    margin: 0;
    color: #f97316;
    font-size: 1.1em;
}

.pending-member-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.12) 0%, rgba(234, 88, 12, 0.08) 100%);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 4px solid #f97316;
    margin-bottom: 10px;
}

.pending-member-card:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.2);
}

.pending-actions {
    display: flex;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #7c3aed;
}

.checkbox-label span {
    user-select: none;
}
