/* ═══════════════════════════════════════════════════════════
   MEET — Layout & UI Overrides
   Não editar para personalização de marca — usa brand.css.
   ═══════════════════════════════════════════════════════════ */

/* ── Tipografia global ────────────────────────────────────── */
body, input, button, select, textarea {
  font-family: var(--brand-font) !important;
}

/* ── Seleção de texto ─────────────────────────────────────── */
::selection {
  background-color: var(--brand-primary-20);
  color: var(--brand-primary);
}

/* ══════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════ */
#header {
  background: var(--brand-surface) !important;
  border-bottom: 1px solid var(--brand-border) !important;
  box-shadow: 0 1px 0 var(--brand-border);
  padding: 0 16px !important;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-text) !important;
}

#logoname {
  color: var(--brand-text) !important;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Logo via CSS para fácil substituição */
#logoname::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background: var(--brand-primary);
  border-radius: 7px;
  flex-shrink: 0;
}

#head1 input, #head1a input {
  border: 1px solid var(--brand-border) !important;
  border-radius: var(--brand-radius-sm) !important;
  background: var(--brand-surface2) !important;
  color: var(--brand-text) !important;
  font-family: var(--brand-font) !important;
  padding: 6px 10px;
  font-size: 0.85rem;
}

#head1 input:focus, #head1a input:focus {
  outline: none;
  border-color: var(--brand-primary) !important;
}

#jumptoroomButton, #head1 button, #head1a button {
  background: var(--brand-primary) !important;
  color: white !important;
  border-radius: var(--brand-radius-sm) !important;
  border: none !important;
  padding: 6px 14px;
  font-family: var(--brand-font) !important;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

#head2, #head4 {
  color: var(--brand-muted) !important;
  font-size: 0.8rem;
}

#roomid, #dirroomid {
  color: var(--brand-primary) !important;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   TOOLBAR PRINCIPAL — #subControlButtons
   ══════════════════════════════════════════════════════════ */
#controlButtons {
  bottom: 12px !important;
  padding: 0 12px !important;
}

#subControlButtons {
  background: var(--brand-surface) !important;
  border: 1px solid var(--brand-border) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10) !important;
  border-radius: 14px !important;
  padding: 6px 8px !important;
  gap: 2px;
  min-width: unset !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  cursor: default !important;
}

/* Botões individuais */
#subControlButtons div.float,
#subControlButtons div.float2 {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: var(--brand-radius-sm) !important;
  color: var(--brand-muted) !important;
  opacity: 1 !important;
  min-width: 48px !important;
  min-height: 48px !important;
  margin: 2px !important;
  padding: 4px !important;
  transition: background 0.15s, color 0.15s !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

#subControlButtons div.float:hover {
  background: var(--brand-primary-10) !important;
  color: var(--brand-primary) !important;
  border-radius: var(--brand-radius-sm) !important;
}

/* Ícones UIcons dentro dos botões */
#subControlButtons div.float i,
#subControlButtons div.float2 i {
  font-size: 22px !important;
  line-height: 1 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Classe toggleSize — só controla tamanho do ícone */
.toggleSize {
  font-size: 22px !important;
}

/* ── Separador visual entre grupos de botões ──────────────── */
.toolbar-divider {
  width: 1px;
  height: 28px;
  background: var(--brand-border);
  margin: 0 6px;
  flex-shrink: 0;
  align-self: center;
}

/* ── Botão Hangup ─────────────────────────────────────────── */
#hangupbutton,
#hangupbutton2 {
  background: var(--brand-primary) !important;
  color: white !important;
  border-radius: 50% !important;
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  margin-left: 8px !important;
}

#hangupbutton:hover,
#hangupbutton2:hover {
  background: var(--brand-primary-hover) !important;
  color: white !important;
}

#hangupbutton i,
#hangupbutton2 i {
  font-size: 20px !important;
}

/* ── Estados activos (mute, active) ──────────────────────── */
#mutebutton[aria-pressed="true"],
#mutevideobutton[aria-pressed="true"] {
  background: var(--brand-primary-10) !important;
  color: var(--brand-primary) !important;
}

#mutebutton[aria-pressed="true"] i,
#mutevideobutton[aria-pressed="true"] i {
  color: var(--brand-primary) !important;
}

.video-mute-state #mutebutton i,
.video-mute-state #mutevideobutton i {
  color: var(--brand-primary) !important;
}

/* Botões active/on (classe orange, red, green) */
#subControlButtons div.orange {
  background: rgba(234, 88, 12, 0.10) !important;
  color: #ea580c !important;
}

#subControlButtons div.red {
  background: var(--brand-primary-10) !important;
  color: var(--brand-primary) !important;
}

#subControlButtons div.green {
  background: rgba(34, 197, 94, 0.10) !important;
  color: #16a34a !important;
}

/* ── Notificações (badge) ─────────────────────────────────── */
#chatNotification,
#queueNotification,
#transferNotification {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 1.5px solid var(--brand-surface);
  font-size: 0;
}

#chatbutton,
#queuebutton,
#sharefilebutton {
  position: relative;
}

/* ── Volume slider panel ──────────────────────────────────── */
.speaker-volume-panel {
  background: var(--brand-surface) !important;
  border: 1px solid var(--brand-border) !important;
  border-radius: var(--brand-radius) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10) !important;
}

/* ══════════════════════════════════════════════════════════
   MOBILE ESSENTIAL BAR
   Barra fixa no fundo com 5 botões essenciais.
   Visível apenas em mobile (< 640px).
   ══════════════════════════════════════════════════════════ */
#meetMobileBar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 996;
  background: var(--brand-surface);
  border-top: 1px solid var(--brand-border);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
  height: 68px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mbar-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--brand-radius-sm);
  background: transparent;
  color: var(--brand-muted);
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.mbar-btn i {
  font-size: 22px;
  line-height: 1;
}

.mbar-btn .mbar-lbl {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--brand-font);
}

.mbar-btn.muted {
  color: var(--brand-primary);
  background: var(--brand-primary-10);
}

.mbar-btn.active {
  color: var(--brand-primary);
}

.mbar-btn.hangup {
  background: var(--brand-primary);
  color: white;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  margin-left: 4px;
  gap: 0;
}

.mbar-btn.hangup .mbar-lbl {
  display: none;
}

.mbar-btn.hangup:active {
  background: var(--brand-primary-hover);
}

.mbar-divider {
  width: 1px;
  height: 28px;
  background: var(--brand-border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Badge de notificação na barra mobile */
.mbar-btn .mbar-notif {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 1.5px solid var(--brand-surface);
}

/* ══════════════════════════════════════════════════════════
   PAINEL "MAIS" — Overlay mobile com todos os botões
   ══════════════════════════════════════════════════════════ */
#meetMorePanel {
  display: none;
  position: fixed;
  bottom: 68px;
  left: 0;
  right: 0;
  z-index: 995;
  background: var(--brand-surface);
  border-top: 1px solid var(--brand-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  padding: 12px 8px 16px;
}

#meetMorePanel.open {
  display: block;
}

#meetMorePanel .more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 4px 10px;
  border-radius: var(--brand-radius-sm);
  background: var(--brand-surface2);
  color: var(--brand-muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--brand-font);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.more-item i {
  font-size: 22px;
  line-height: 1;
}

.more-item:active {
  background: var(--brand-primary-10);
  color: var(--brand-primary);
}

.more-item.active {
  background: var(--brand-primary-10);
  color: var(--brand-primary);
}

/* ── Botão "Mais" no estado activo ────────────────────────── */
#meetMoreToggle.active {
  color: var(--brand-primary);
  background: var(--brand-primary-10);
  border-radius: var(--brand-radius-sm);
}

/* ══════════════════════════════════════════════════════════
   MINI TASKBAR (canto superior direito)
   ══════════════════════════════════════════════════════════ */
#miniTaskBar i {
  color: var(--brand-muted) !important;
  font-size: 20px !important;
}

#miniTaskBar span:hover i {
  color: var(--brand-primary) !important;
}

/* ══════════════════════════════════════════════════════════
   CHAT MODULE
   ══════════════════════════════════════════════════════════ */
#chatModule {
  background: var(--brand-surface) !important;
  border: 1px solid var(--brand-border) !important;
  border-radius: var(--brand-radius) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08) !important;
}

#chatInput {
  border: 1px solid var(--brand-border) !important;
  border-radius: 20px !important;
  background: var(--brand-surface2) !important;
  color: var(--brand-text) !important;
  font-family: var(--brand-font) !important;
  padding: 6px 14px !important;
}

#chatInput:focus {
  border-color: var(--brand-primary) !important;
  outline: none !important;
}

.chatBarInputButton {
  background: var(--brand-primary) !important;
  color: white !important;
  border-radius: 20px !important;
  border: none !important;
  font-family: var(--brand-font) !important;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   VÍDEO — tiles e bordas
   ══════════════════════════════════════════════════════════ */
.videoHolder {
  border-radius: var(--brand-radius) !important;
  border: 1px solid var(--brand-border) !important;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ══════════════════════════════════════════════════════════
   BREAKPOINTS — apenas 3
   ══════════════════════════════════════════════════════════ */

/* TABLET: 640px – 1024px */
@media only screen and (max-width: 1024px) and (min-width: 641px) {
  #subControlButtons {
    flex-wrap: wrap !important;
    max-width: 90vw;
  }
}

/* MOBILE: < 640px */
@media only screen and (max-width: 640px) {

  /* Mostrar barra mobile, esconder toolbar original */
  #meetMobileBar {
    display: flex;
  }

  #controlButtons {
    display: none !important;
  }

  /* Header compacto */
  #header {
    height: 46px !important;
    padding: 0 10px !important;
    font-size: 0.82rem;
  }

  #logoname {
    font-size: 0.82rem;
  }

  #logoname::before {
    width: 22px;
    height: 22px;
    border-radius: 5px;
  }

  /* Área de vídeo com espaço para a barra mobile */
  #container {
    padding-bottom: 68px;
  }

  /* Chat em fullscreen no mobile */
  #chatModule {
    position: fixed !important;
    top: 46px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 68px !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    z-index: 990;
  }
}
