/* Fonctionnalités Meet */

#meetPresentingBanner {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  background: rgba(0, 122, 255, 0.92);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.35);
  pointer-events: none;
}

#meetPresentingBanner.is-hidden {
  display: none !important;
}

.meet-presenting-stop {
  margin-left: 0.5rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
}

.meet-presenting-stop:hover {
  background: rgba(0, 0, 0, 0.4);
}

#callTopParticipantCount {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 0.35rem;
}

#openParticipantsBtn {
  position: relative;
}

#openParticipantsBtn .meet-participant-count-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #007aff;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

#meetParticipantsPanel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 92vw);
  z-index: 26000;
  background: rgba(18, 18, 22, 0.97);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
}

#meetParticipantsPanel.is-open {
  transform: translateX(0);
}

.meet-participants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.meet-participants-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.meet-participants-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 0.25rem;
}

#meetParticipantsList {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  overflow-y: auto;
  flex: 1;
}

.meet-participant-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  color: #fff;
}

.meet-participant-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.meet-participant-item.is-pinned {
  background: rgba(0, 122, 255, 0.12);
}

.meet-participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007aff, #5856d6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.meet-participant-info {
  flex: 1;
  min-width: 0;
}

.meet-participant-name {
  display: block;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meet-participant-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.meet-participant-badge {
  font-size: 0.625rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.meet-participant-badge--host {
  background: rgba(255, 193, 7, 0.25);
  color: #ffc107;
}

.meet-participant-badge--hand {
  background: rgba(52, 199, 89, 0.2);
}

.meet-participant-badge--present {
  background: rgba(0, 122, 255, 0.25);
  color: #4da3ff;
}

.meet-participant-status {
  flex-shrink: 0;
}

.meet-media-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.meet-media-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #34c759;
}

.meet-media-icon.is-off {
  color: #ff6b6b;
  background: rgba(255, 59, 48, 0.15);
}

.meet-media-icon--locked {
  outline: 1px solid rgba(255, 193, 7, 0.55);
}

.meet-media-icon svg {
  width: 14px;
  height: 14px;
}

.meet-participant-badge--lock {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.meet-participant-reorder {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
}

.meet-reorder-btn {
  width: 24px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.meet-reorder-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.meet-reorder-btn svg {
  width: 14px;
  height: 14px;
}

.meet-pin-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  padding: 0.2rem;
}

.meet-pin-btn:hover {
  opacity: 1;
}

.meet-participant-host-ctrls {
  display: flex;
  gap: 0.2rem;
}

.meet-host-ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0;
}

.meet-host-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.meet-host-ctrl-btn svg {
  width: 15px;
  height: 15px;
}

.meet-host-ctrl-btn--danger {
  color: #ff6b6b;
  background: rgba(255, 59, 48, 0.15);
}

.meet-host-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meet-host-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Tuiles vidéo avec nom + icônes */
.meet-video-tile {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.meet-video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meet-video-tile-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.75rem;
  pointer-events: none;
}

.meet-video-tile-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.meet-video-tile-badges {
  font-size: 0.65rem;
  opacity: 0.85;
}

.meet-video-tile-label .meet-media-icon {
  width: 18px;
  height: 18px;
}

.meet-video-tile-label .meet-media-icon svg {
  width: 12px;
  height: 12px;
}

body.messages-app #videoCallContainer .video-container.group-call-layout .meet-video-tile {
  max-width: none;
}

.meet-conn-badge {
  font-size: 0.625rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.meet-conn-badge--bad {
  background: rgba(255, 59, 48, 0.2);
  color: #ff6b6b;
}

body.messages-app #videoCallContainer video.meet-conn-reconnecting {
  outline: 2px dashed rgba(255, 193, 7, 0.7);
}

body.messages-app #videoCallContainer video.meet-conn-failed {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.raised-hand-grant-btn {
  margin-left: auto;
  background: rgba(52, 199, 89, 0.2);
  border: none;
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

#meetHostActions {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#meetHostActions.is-hidden {
  display: none !important;
}

.meet-host-btn {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.8125rem;
  cursor: pointer;
  text-align: left;
}

.meet-host-btn--danger {
  border-color: rgba(255, 59, 48, 0.4);
  color: #ff6b6b;
}

.meet-shortcuts-hint {
  padding: 0.5rem 1rem 1rem;
  font-size: 0.6875rem;
  opacity: 0.45;
  color: #fff;
  line-height: 1.5;
}

/* Speaker actif */
body.messages-app #videoCallContainer video.meet-spotlight {
  outline: 3px solid #34c759;
  outline-offset: 2px;
  box-shadow: 0 0 24px rgba(52, 199, 89, 0.45);
}

/* Vue orateur */
body.messages-app #videoCallContainer .video-container.meet-layout-speaker {
  display: grid !important;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  gap: 8px;
}

body.messages-app #videoCallContainer .video-container.meet-layout-speaker {
  grid-template-rows: 1fr auto;
  align-content: stretch;
}

body.messages-app #videoCallContainer .video-container.meet-layout-speaker .meet-video-tile.meet-tile-spotlight,
body.messages-app #videoCallContainer .video-container.meet-layout-speaker .meet-video-tile:has(video.meet-pinned) {
  grid-column: 1 / -1;
  grid-row: 1;
  max-height: 72vh;
  width: 100%;
  max-width: none;
  aspect-ratio: auto;
}

body.messages-app #videoCallContainer .video-container.meet-layout-speaker .meet-video-tile:not(.meet-tile-spotlight):not(:has(video.meet-pinned)) {
  max-height: 110px;
  aspect-ratio: 16 / 9;
}

body.messages-app #videoCallContainer .video-container.meet-layout-speaker video.meet-pinned {
  object-fit: contain !important;
}

.call-top-participants.meet-capacity-warn {
  color: #ffc107;
}

.call-top-participants.meet-capacity-full {
  color: #ff6b6b;
  font-weight: 700;
}

#layoutToggleBtn.is-active {
  background: rgba(0, 122, 255, 0.3) !important;
}
