/**
 * group-coaching.css v2
 * Styles: Admin + Member + Moderation + AutoPilot + LIVE-Banner
 * Mobile-first, Light + Dark Mode
 */

/* ═══ ADMIN: Raumliste ═══ */
.admin-gc { padding: 0 4px; }
.admin-gc__grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .admin-gc__grid { grid-template-columns: repeat(2, 1fr); } }

/* ═══ MEMBER: Raumliste ═══ */
.gc-room-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .gc-room-grid { grid-template-columns: repeat(2, 1fr); } }

/* ═══ COACHING-RAUM ═══ */
.gc-room { display: flex; flex-direction: column; height: calc(100vh - 60px); height: calc(100dvh - 60px); overflow: hidden; }
.gc-room__loading, .gc-room__error { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; text-align: center; padding: 24px; color: var(--text-muted, #6B7280); }
.gc-room__error h2 { color: var(--text, #111827); } body.dark .gc-room__error h2 { color: #E2E8F0; }

/* ═══ HEADER ═══ */
.gc-room__header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border, #E5E7EB); background: var(--bg-card, #fff); flex-shrink: 0; gap: 8px; min-height: 52px; }
body.dark .gc-room__header { background: #1E293B; border-color: #334155; }
.gc-room__header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gc-room__header-right { flex-shrink: 0; }
.gc-room__title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.gc-room__title h2 { font-size: 16px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
@media (min-width: 768px) { .gc-room__title h2 { max-width: 400px; } }
.gc-participant-count { font-size: 13px; color: var(--text-muted, #6B7280); white-space: nowrap; }

/* ═══ BADGES ═══ */
.gc-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.gc-badge--live { background: #DCFCE7; color: #166534; } .gc-badge--mode { background: #DBEAFE; color: #1E40AF; } .gc-badge--voice { background: #FEF3C7; color: #92400E; }
body.dark .gc-badge--live { background: #14532D; color: #86EFAC; } body.dark .gc-badge--mode { background: #1E3A5F; color: #93C5FD; } body.dark .gc-badge--voice { background: #78350F; color: #FDE68A; }

/* ═══ BODY ═══ */
.gc-room__body { display: flex; flex: 1; overflow: hidden; min-height: 0; }
.gc-room__chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.gc-room__sidebar { display: none; width: 240px; flex-shrink: 0; border-left: 1px solid var(--border, #E5E7EB); padding: 12px; overflow-y: auto; background: var(--bg-card, #fff); }
body.dark .gc-room__sidebar { background: #1E293B; border-color: #334155; }
@media (min-width: 768px) { .gc-room__sidebar { display: block; } }
.gc-room__sidebar h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted, #6B7280); }

/* ═══ MESSAGES ═══ */
.gc-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.gc-messages__empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; text-align: center; color: var(--text-muted, #6B7280); gap: 4px; padding: 32px 16px; }
.gc-msg { display: flex; gap: 10px; max-width: 85%; animation: gc-fadeIn 0.2s ease; }
.gc-msg--own { margin-left: auto; flex-direction: row-reverse; }
.gc-msg--system { max-width: 100%; justify-content: center; text-align: center; font-size: 12px; color: var(--text-muted, #6B7280); padding: 4px 0; }
.gc-msg--pending { opacity: 0.6; }
@keyframes gc-fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.gc-msg__avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--primary, #6366F1); }
.gc-msg--ai .gc-msg__avatar { background: linear-gradient(135deg, #6366F1, #8B5CF6); font-size: 11px; }
.gc-msg--own .gc-msg__avatar { background: #10B981; }
.gc-msg__body { min-width: 0; }
.gc-msg__name { font-size: 12px; font-weight: 600; margin-bottom: 2px; color: var(--text-muted, #6B7280); }
.gc-msg__text { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; background: var(--bg-card, #fff); border: 1px solid var(--border, #E5E7EB); word-break: break-word; }
body.dark .gc-msg__text { background: #1E293B; border-color: #334155; }
.gc-msg--ai .gc-msg__text { background: #EEF2FF; border-color: #C7D2FE; }
body.dark .gc-msg--ai .gc-msg__text { background: #1E1B4B; border-color: #4338CA; }
.gc-msg--own .gc-msg__text { background: #D1FAE5; border-color: #6EE7B7; border-bottom-right-radius: 4px; }
body.dark .gc-msg--own .gc-msg__text { background: #064E3B; border-color: #059669; }
.gc-msg__meta { font-size: 11px; color: var(--text-muted, #6B7280); margin-top: 4px; padding-left: 4px; }

/* ═══ VOICE ═══ */
.gc-voice-player { margin-top: 6px; }
.gc-voice-btn { font-size: 12px !important; padding: 4px 10px !important; border-radius: 99px !important; }

/* ═══ INPUT ═══ */
.gc-room__input { padding: 10px 16px; border-top: 1px solid var(--border, #E5E7EB); background: var(--bg-card, #fff); flex-shrink: 0; }
body.dark .gc-room__input { background: #1E293B; border-color: #334155; }
.gc-input__form { display: flex; gap: 8px; align-items: flex-end; }
.gc-input__textarea { flex: 1; resize: none; border: 1px solid var(--border, #E5E7EB); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-family: inherit; background: var(--bg, #F9FAFB); min-height: 42px; max-height: 120px; }
body.dark .gc-input__textarea { background: #0F172A; border-color: #334155; color: #E2E8F0; }
.gc-input__textarea:focus { outline: none; border-color: var(--primary, #6366F1); box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
.gc-input__send { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; padding: 0 !important; }
.gc-input__hand-raise { text-align: center; padding: 8px 0; }
.gc-input__hint { font-size: 12px; color: var(--text-muted, #6B7280); margin-top: 6px; }

/* ═══ PARTICIPANTS + HAND-RAISE ═══ */
.gc-participant { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.gc-participant--me { font-weight: 600; }
.gc-participant__status { font-size: 12px; flex-shrink: 0; }
.gc-participant__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-hand-queue { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border, #E5E7EB); }
.gc-hand-queue h4 { font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--text-muted, #6B7280); text-transform: uppercase; }
.gc-hand-queue__empty { font-size: 12px; color: var(--text-muted, #6B7280); }

/* ═══ CREDIT TIER CARDS ═══ */
.gc-tier-card { transition: border-color 0.15s, box-shadow 0.15s; }
.gc-tier-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.gc-tier-active { box-shadow: 0 0 0 2px rgba(99,102,241,0.3); }

/* ═══ AUTOPILOT TOOLBAR (Admin Moderation) ═══ */
.gc-autopilot-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.gc-autopilot-bar .btn { min-width: 0; }

/* ═══ LIVE CHAT FEED (Admin Moderation) ═══ */
.gc-chat-msg { padding: 8px 0; border-bottom: 1px solid var(--border, #E5E7EB); }
.gc-chat-msg:last-child { border-bottom: none; }
.gc-chat-msg__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; font-size: 12px; }
.gc-chat-msg__text { font-size: 13px; line-height: 1.45; color: var(--text, #111827); }
body.dark .gc-chat-msg__text { color: #E2E8F0; }
.gc-chat-ai { background: rgba(99,102,241,0.06); border-radius: 8px; padding: 8px 10px !important; margin: 4px -4px; }
body.dark .gc-chat-ai { background: rgba(99,102,241,0.12); }
.gc-chat-coach { background: rgba(16,185,129,0.06); border-radius: 8px; padding: 8px 10px !important; margin: 4px -4px; }
body.dark .gc-chat-coach { background: rgba(16,185,129,0.12); }

/* ═══ LIVE-BANNER (Member) ═══ */
.gc-live-banner { margin: 12px 16px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%); box-shadow: 0 4px 12px rgba(220,38,38,0.3); animation: gc-bannerSlide 0.3s ease-out; }
@keyframes gc-bannerSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.gc-live-banner__content { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; }
.gc-live-banner__pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex-shrink: 0; animation: gc-pulse 1.5s ease-in-out infinite; }
@keyframes gc-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.3); } }
.gc-live-banner__text { flex: 1; min-width: 0; }
.gc-live-banner__text strong { display: block; font-size: 14px; font-weight: 700; }
.gc-live-banner__meta { display: block; font-size: 12px; opacity: 0.85; margin-top: 2px; }
.gc-live-banner__btn { flex-shrink: 0; background: #fff; color: #DC2626; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform 0.15s; }
.gc-live-banner__btn:hover { transform: scale(1.03); }
.gc-live-banner__close { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 20px; cursor: pointer; padding: 0 4px; flex-shrink: 0; }
.gc-live-banner__close:hover { color: #fff; }

/* ═══ MOBILE ═══ */
@media (max-width: 480px) {
    .gc-room__title h2 { max-width: 140px; font-size: 14px; }
    .gc-badge { font-size: 10px; padding: 1px 6px; }
    .gc-messages { padding: 10px; gap: 8px; }
    .gc-msg { max-width: 92%; }
    .gc-msg__avatar { width: 30px; height: 30px; font-size: 11px; }
    .gc-msg__text { padding: 8px 12px; font-size: 13px; border-radius: 14px; }
    .gc-room__input { padding: 8px 12px; }
    .gc-input__textarea { padding: 8px 12px; font-size: 13px; }
    .gc-tier-card { padding: 8px !important; }
    .gc-live-banner { margin: 8px 10px; }
    .gc-live-banner__content { padding: 10px 12px; gap: 8px; }
    .gc-live-banner__btn { padding: 6px 12px; font-size: 12px; }
    .gc-autopilot-bar { flex-direction: column; }
    .gc-autopilot-bar .btn { width: 100%; }
}
