/* ============================================================
   CYBERENTA Meet — Styles visioconférence
   ============================================================ */

.hidden { display: none !important; }

/* ── Lobby / pré-jonction ────────────────────────────────────── */
.lobby {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-secondary); padding: var(--space-6);
}
.lobby-card {
    width: 100%; max-width: 440px;
    background: var(--surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-xl); padding: var(--space-8); box-shadow: var(--shadow-lg);
}
.lobby-brand { text-align: center; margin-bottom: var(--space-6); }
.lobby-brand h1 { font-size: var(--text-2xl); margin: var(--space-2) 0 0; }
.lobby-brand-icon {
    width: 56px; height: 56px; border-radius: var(--radius-lg);
    background: var(--accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: var(--space-2);
}
.lobby-block { margin-bottom: var(--space-4); }
.lobby-block h3 { display: flex; align-items: center; gap: 8px; font-size: var(--text-base); margin-bottom: var(--space-3); }
.lobby-block .form-group { margin-bottom: var(--space-3); }
.lobby-sep { text-align: center; position: relative; margin: var(--space-5) 0; color: var(--text-tertiary); }
.lobby-sep::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border-light); }
.lobby-sep span { position: relative; background: var(--surface); padding: 0 12px; font-size: var(--text-sm); }

.preview-wrap {
    position: relative; aspect-ratio: 16/9; background: #111;
    border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-3);
}
.preview-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; opacity: 0.5; }
.preview-off svg { width: 48px; height: 48px; }
.preview-controls { display: flex; justify-content: center; gap: var(--space-3); margin-bottom: var(--space-2); }

/* ── Boutons de contrôle ─────────────────────────────────────── */
.ctrl-btn {
    width: 52px; height: 52px; border-radius: 50%;
    border: none; background: #2a2a2e; color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
.ctrl-btn:hover { transform: translateY(-1px); }
.ctrl-btn svg { width: 22px; height: 22px; }
.ctrl-btn.off { background: var(--danger); }
.ctrl-btn.active { background: var(--accent); }
.ctrl-btn.ctrl-leave { background: var(--danger); }
.ctrl-btn.ctrl-leave:hover { background: #d70015; }

/* ── Salle ───────────────────────────────────────────────────── */
.meet-body { margin: 0; }
.room {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    background: #0f0f10; color: #fff;
}
.room-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: #18181b; border-bottom: 1px solid #2a2a2e;
}
.room-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--text-sm); }
.room-top-right { display: flex; align-items: center; gap: 6px; }
.icon-btn {
    position: relative; width: 40px; height: 40px; border-radius: 10px;
    border: none; background: transparent; color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #2a2a2e; }
.icon-btn svg { width: 20px; height: 20px; }
.badge-count {
    position: absolute; top: 2px; right: 2px; background: var(--accent); color: #fff;
    font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

.room-main { flex: 1; display: flex; overflow: hidden; position: relative; }

.video-grid {
    flex: 1; display: grid; gap: 10px; padding: 14px;
    grid-template-columns: repeat(var(--cols, 1), 1fr);
    align-content: center; overflow: auto;
}
.tile {
    position: relative; background: #1c1c1f; border-radius: var(--radius-lg);
    overflow: hidden; aspect-ratio: 16/9; min-height: 140px;
}
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile video[muted], .tile.self video { transform: scaleX(-1); }
.tile-avatar {
    position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2b5876, #4e4376);
}
.tile-avatar span { font-size: 28px; font-weight: 600; color: #fff; }
.tile.cam-off video { display: none; }
.tile.cam-off .tile-avatar { display: flex; }
.tile-name {
    position: absolute; left: 8px; bottom: 8px;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 12px;
    padding: 3px 8px; border-radius: 6px; max-width: 80%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Panneaux latéraux ───────────────────────────────────────── */
.side-panel {
    width: 320px; max-width: 85vw; background: #18181b; border-left: 1px solid #2a2a2e;
    display: flex; flex-direction: column;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #2a2a2e; font-weight: 600; }
.people-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.people-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; }
.people-list li:hover { background: #222; }
.people-name { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); }
.people-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.people-actions { display: flex; gap: 2px; }
.people-actions .icon-btn { width: 32px; height: 32px; }
.people-actions .icon-btn:hover { background: var(--danger); }

.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 85%; }
.chat-msg.mine { align-self: flex-end; text-align: right; }
.chat-author { font-size: 11px; color: #9a9aa0; margin-bottom: 2px; }
.chat-bubble { display: inline-block; background: #2a2a2e; padding: 8px 12px; border-radius: 12px; font-size: var(--text-sm); word-break: break-word; text-align: left; }
.chat-msg.mine .chat-bubble { background: var(--accent); }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #2a2a2e; }
.chat-input .input { background: #0f0f10; border-color: #2a2a2e; color: #fff; }
.chat-input .icon-btn { background: var(--accent); }

/* ── Barre de contrôles ──────────────────────────────────────── */
.room-controls {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 16px; background: #18181b; border-top: 1px solid #2a2a2e;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .side-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; }
    .video-grid { grid-template-columns: repeat(var(--cols, 1), 1fr); padding: 8px; gap: 8px; }
    .tile { min-height: 110px; }
    .ctrl-btn { width: 46px; height: 46px; }
    .room-controls { gap: 8px; }
}
