/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════════════════════ */
:root {
  --primary:          #5865f2;
  --primary-dark:     #4752c4;
  --secondary:        #7289da;
  --neutral-bg:       #f0f2f5;
  --neutral-card:     #ffffff;
  --neutral-border:   #e4e6eb;
  --neutral-text:     #1c1e21;
  --neutral-muted:    #65676b;
  --accent-success:   #28a745;
  --accent-warning:   #ffc107;
  --accent-danger:    #dc3545;
  --accent-info:      #17a2b8;
  --chat-self-bg:     #5865f2;
  --chat-self-color:  #ffffff;
  --chat-other-bg:    #e4e6eb;
  --chat-other-color: #1c1e21;
  --chat-sys-bg:      rgba(0, 0, 0, 0.06);
  --chat-sys-color:   #65676b;
  --radius:           0.75rem;
  --radius-sm:        0.5rem;
  --transition:       0.22s ease;
  --header-h:         64px;
  --footer-h:         46px;
  --sidebar-w:        320px;
}

.dark-mode,
#chat-page-wrapper.dark-mode {
  --primary:          #7289da;
  --primary-dark:     #5865f2;
  --neutral-bg:       #18191a;
  --neutral-card:     #242526;
  --neutral-border:   #3a3b3c;
  --neutral-text:     #e4e6eb;
  --neutral-muted:    #b0b3b8;
  --chat-other-bg:    #3a3b3c;
  --chat-other-color: #e4e6eb;
  --chat-sys-bg:      rgba(255, 255, 255, 0.07);
  --chat-sys-color:   #b0b3b8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET / BASE
═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  /* Suporte ao safe-area do iPhone (notch/home bar) */
  padding-env: safe-area-inset-top safe-area-inset-right safe-area-inset-bottom safe-area-inset-left;
}

body {
  height: 100%;
  font-family: "Poppins", sans-serif;
  background-color: var(--neutral-bg);
  color: var(--neutral-text);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition), color var(--transition);
  overflow: hidden; /* padrão: sem scroll de página (chat) */
}

/* Landing page precisa de scroll */
body.landing-page {
  overflow: auto;
  height: auto;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ─── Gradient ─────────────────────────────────────────────────────────── */
.bg-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
  color: #fff;
}

/* ─── Logo ─────────────────────────────────────────────────────────────── */
.logo {
  font-weight: 700;
  font-size: 1.6rem;
  background: linear-gradient(to right, #fff, rgba(255,255,255,0.78));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* ─── Cards ────────────────────────────────────────────────────────────── */
.card {
  background-color: var(--neutral-card);
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: background-color var(--transition), border-color var(--transition);
  color: var(--neutral-text);
}
.card-header {
  border-bottom: 1px solid var(--neutral-border);
  padding: 0.85rem 1.2rem;
  font-weight: 600;
}
.card-body { padding: 1.2rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT PAGE — Arquitetura de layout sem conflito com Bootstrap
   Estratégia: wrapper absoluto que preenche 100dvh, sem vh-100 no HTML
═══════════════════════════════════════════════════════════════════════════ */

/* O wrapper raiz do Bootstrap (container-fluid.d-flex.vh-100) é sobrescrito */
.chat-page-wrapper {
  position: fixed;
  inset: 0;
  /* dvh = dynamic viewport height: respeita teclado virtual no mobile */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--neutral-bg);
}

/* ─── Header ───────────────────────────────────────────────────────────── */
.chat-header-bar {
  flex-shrink: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 10;
  padding: 0 1rem;
}
.chat-header-bar .container-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Main area ────────────────────────────────────────────────────────── */
.chat-main {
  flex: 1 1 0;
  min-height: 0; /* CRÍTICO: sem isso o flex-child não comprime */
  display: flex;
  overflow: hidden;
  padding: 10px;
  gap: 10px;
}

/* ─── Coluna do chat (esquerda/centro) ─────────────────────────────────── */
.chat-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Sidebar (direita) ────────────────────────────────────────────────── */
.sidebar-col {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Card principal do chat */
.chat-card {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--neutral-border);
  background-color: var(--neutral-card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: background-color var(--transition), border-color var(--transition);
}

/* Card da sidebar */
.sidebar-card {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--neutral-border);
  background-color: var(--neutral-card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: background-color var(--transition), border-color var(--transition);
}
.sidebar-card .sidebar-header {
  flex-shrink: 0;
  padding: 0.85rem 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--neutral-border);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
}
.sidebar-card .sidebar-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-card .sidebar-body::-webkit-scrollbar { width: 4px; }
.sidebar-card .sidebar-body::-webkit-scrollbar-thumb {
  background: var(--neutral-border);
  border-radius: 4px;
}

/* ─── Footer ───────────────────────────────────────────────────────────── */
.chat-footer-bar {
  flex-shrink: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  font-size: 0.82rem;
  padding: 0 1rem;
  /* Respeita home bar do iPhone */
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}
.chat-footer-bar a { color: rgba(255,255,255,0.85); text-decoration: underline; }
.chat-footer-bar a:hover { color: #fff; }

/* ─── Header buttons ───────────────────────────────────────────────────── */
.chat-header-bar .btn-outline-light {
  color: #fff;
  border-color: rgba(255,255,255,0.45);
  background-color: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all var(--transition);
}
.chat-header-bar .btn-outline-light:hover {
  background-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   VIDEO CHAT
═══════════════════════════════════════════════════════════════════════════ */
#video-chat {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#video-chat.hidden { display: none !important; }

.video-container {
  flex: 1 1 0;
  min-height: 0;
  background-color: #202124;
  position: relative;
  overflow: hidden;
  border-radius: 0;
}

.main-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.self-video {
  position: absolute;
  width: 160px;
  height: 120px;
  bottom: 80px;
  right: 16px;
  border-radius: var(--radius);
  border: 2px solid rgba(255,255,255,0.3);
  object-fit: cover;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: all var(--transition);
}
.self-video:hover { transform: scale(1.04); border-color: var(--primary); }

.video-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  background-color: rgba(20, 20, 24, 0.82);
  padding: 10px 16px;
  border-radius: 50px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity var(--transition), transform var(--transition);
}
.video-container:hover .video-controls {
  opacity: 1;
  transform: translateX(-50%) translateY(-3px);
}

.btn-control {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.14);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.18s ease;
  flex-shrink: 0;
  cursor: pointer;
}
.btn-control:hover { background-color: rgba(255,255,255,0.26); transform: scale(1.1); }
.btn-control.btn-danger { background-color: #ea4335 !important; }

#video-filter {
  background-color: rgba(255,255,255,0.14);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 5px 12px;
  max-width: 120px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
#video-filter:hover { background-color: rgba(255,255,255,0.24); }
#video-filter option { background-color: #202124; color: #fff; }

.video-status {
  position: absolute;
  top: 14px;
  left: 14px;
  background-color: rgba(20,20,24,0.82);
  color: #fff;
  padding: 6px 14px;
  border-radius: 24px;
  z-index: 10;
  font-weight: 500;
  font-size: 0.88rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 7px;
}
.video-status::before {
  content: "";
  width: 8px;
  height: 8px;
  background-color: #34a853;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

/* Fullscreen */
.fullscreen-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background-color: #000;
  border-radius: 0;
}
.fullscreen-video .main-video { object-fit: contain; }
.fullscreen-video .self-video { width: 190px; height: 142px; bottom: 88px; right: 20px; }
.fullscreen-video .video-controls { bottom: 24px; }
.fullscreen-video .btn-control { width: 50px; height: 50px; font-size: 1.2rem; }

/* Hidden HUD */
.hidden-hud .video-controls,
.hidden-hud .video-status,
.hidden-hud .self-video { opacity: 0; transition: opacity 0.35s ease; pointer-events: none; }
.hidden-hud:hover .video-controls,
.hidden-hud:hover .video-status,
.hidden-hud:hover .self-video { opacity: 1; pointer-events: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   TEXT CHAT — Scroll interno, nunca cresce além do container
═══════════════════════════════════════════════════════════════════════════ */
#text-chat {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Cabeçalho do chat */
.chat-peer-header {
  flex-shrink: 0;
  background-color: var(--neutral-card);
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-border);
  transition: background-color var(--transition);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.chat-avatar-info h6 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--neutral-text);
}
.chat-avatar-info small {
  font-size: 0.78rem;
  color: var(--accent-warning);
}

/* Área de mensagens — SCROLL ACONTECE AQUI */
#chat-box {
  flex: 1 1 0;
  min-height: 0;       /* ESSENCIAL: sem isso o div não comprime e a tela cresce */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--neutral-bg);
  scroll-behavior: smooth;
  transition: background-color var(--transition);
  /* Scroll suave no iOS */
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar fina customizada */
#chat-box::-webkit-scrollbar { width: 4px; }
#chat-box::-webkit-scrollbar-thumb {
  background-color: var(--neutral-border);
  border-radius: 4px;
}
#chat-box::-webkit-scrollbar-track { background: transparent; }

/* Bubbles de mensagem */
.message-bubble {
  margin: 0;
  padding: 9px 15px;
  border-radius: 18px;
  max-width: 75%;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.5;
  font-size: 0.92rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  /* Evita que o bubble cresça além do pai */
  flex-shrink: 0;
}

.message-self {
  background-color: var(--chat-self-bg);
  color: var(--chat-self-color);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.message-stranger {
  background-color: var(--chat-other-bg);
  color: var(--chat-other-color);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.message-system {
  background-color: var(--chat-sys-bg);
  color: var(--chat-sys-color);
  align-self: center;
  font-style: italic;
  font-size: 0.8rem;
  border-radius: 10px;
  padding: 5px 12px;
  max-width: 88%;
  box-shadow: none;
}

/* Compatibilidade com código que ainda usa <p> */
#chat-box p {
  margin: 0;
  padding: 9px 15px;
  border-radius: 18px;
  max-width: 75%;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.5;
  font-size: 0.92rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
#chat-box p.message-self {
  background-color: var(--chat-self-bg);
  color: var(--chat-self-color);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
#chat-box p.message-stranger {
  background-color: var(--chat-other-bg);
  color: var(--chat-other-color);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
#chat-box p.message-system {
  background-color: var(--chat-sys-bg);
  color: var(--chat-sys-color);
  align-self: center;
  font-style: italic;
  font-size: 0.8rem;
  border-radius: 10px;
  padding: 5px 12px;
  max-width: 88%;
  box-shadow: none;
}

.welcome-msg {
  color: var(--neutral-muted);
  font-style: italic;
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
}

/* Typing indicator */
#typing-indicator {
  color: var(--chat-sys-color);
  font-style: italic;
  font-size: 0.8rem;
  align-self: flex-start;
  padding: 5px 12px;
  background: var(--chat-sys-bg);
  border-radius: 10px;
  animation: typingPulse 1.2s ease infinite;
  margin: 0;
  flex-shrink: 0;
}
@keyframes typingPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* Input area — NUNCA CRESCE, fixo na base */
.input-area {
  flex-shrink: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--neutral-border);
  background-color: var(--neutral-card);
  transition: background-color var(--transition);
  /* Respeita home bar do iPhone */
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.input-group-chat {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--neutral-border);
  border-radius: 24px;
  background-color: var(--neutral-card);
  padding: 4px 6px 4px 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input-group-chat:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.14);
}
.input-group-chat input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--neutral-text);
  font-family: "Poppins", sans-serif;
  font-size: 0.92rem;
  padding: 6px 0;
  min-width: 0; /* Evita que o input quebre o layout flex */
}
.input-group-chat input::placeholder { color: var(--neutral-muted); }
.input-group-chat input:disabled { cursor: not-allowed; opacity: 0.6; }
.input-group-chat .btn-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--neutral-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 1rem;
}
.input-group-chat .btn-icon:hover:not(:disabled) {
  background-color: var(--neutral-border);
  color: var(--primary);
}
.input-group-chat .btn-icon:disabled { opacity: 0.4; cursor: not-allowed; }
.input-group-chat .btn-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 0.92rem;
  box-shadow: 0 2px 8px rgba(88,101,242,0.3);
}
.input-group-chat .btn-send:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(88,101,242,0.4);
}
.input-group-chat .btn-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR — Botões de controle
═══════════════════════════════════════════════════════════════════════════ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  box-shadow: 0 3px 10px rgba(88,101,242,0.22);
  transition: all var(--transition);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(88,101,242,0.32);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  transition: all var(--transition);
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

/* Modo de chat — btn-group */
.mode-group {
  display: flex;
  gap: 6px;
}
.mode-group .btn {
  flex: 1;
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm) !important;
}
.mode-group .btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: var(--primary);
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--neutral-border);
  margin: 4px 0;
}

.online-stats { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}
.stat-row .badge {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.social-share { display: flex; flex-direction: column; gap: 8px; }
.social-share p { margin: 0; font-size: 0.85rem; color: var(--neutral-muted); }
.social-share .share-btns { display: flex; gap: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════
   NOTIFICAÇÕES
═══════════════════════════════════════════════════════════════════════════ */
.notification {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  max-width: 300px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.14);
  border-radius: 10px;
  padding: 11px 16px;
  border-left: 4px solid;
  font-size: 0.86rem;
  transition: opacity 0.4s ease;
}
.notification.alert-success { border-left-color: var(--accent-success); }
.notification.alert-warning { border-left-color: var(--accent-warning); }
.notification.alert-danger  { border-left-color: var(--accent-danger); }
.notification.alert-info    { border-left-color: var(--accent-info); }

/* ═══════════════════════════════════════════════════════════════════════════
   EMOJI PICKER
═══════════════════════════════════════════════════════════════════════════ */
emoji-picker {
  position: fixed;
  bottom: 70px;
  right: 16px;
  z-index: 1050;
  --background: var(--neutral-card);
  --border-color: var(--neutral-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.16);
}

/* ─── Utility ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE
═══════════════════════════════════════════════════════════════════════════ */
.landing-page { overflow-x: hidden; }

.navbar {
  padding: 0.85rem 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transition: all var(--transition);
}
.navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  padding: 0.45rem 1rem;
  transition: all 0.2s ease;
}
.navbar-dark .navbar-nav .nav-link:hover { color: #fff; transform: translateY(-2px); }

.hero-section {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 110px 0 170px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}
.hero-wave { position: absolute; bottom: 0; left: 0; width: 100%; }
.hero-image-container { position: relative; padding: 20px; }
.hero-image-container img {
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transition: transform 0.5s ease;
}
.hero-image-container:hover img { transform: translateY(-10px); }

.chat-bubble {
  position: absolute;
  background: #fff;
  color: #333;
  padding: 11px 16px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  max-width: 210px;
  z-index: 2;
  font-size: 0.88rem;
  animation: floatBubble 3s ease-in-out infinite;
}
.chat-bubble-1 { top: 30px; left: 0; animation-delay: 0s; }
.chat-bubble-2 { bottom: 40px; right: 0; animation-delay: 1.5s; }

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.feature-card {
  background-color: var(--neutral-card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.05);
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--neutral-border);
}
.feature-card:hover { transform: translateY(-8px); box-shadow: 0 14px 32px rgba(0,0,0,0.1); }

.feature-icon {
  width: 66px; height: 66px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
  color: #fff; font-size: 26px;
  transform: rotate(-5deg);
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}
.feature-card:hover .feature-icon { transform: rotate(0deg); }
.feature-card h3 { font-weight: 600; margin-bottom: 10px; font-size: 1.2rem; }

.cta-section {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  position: relative; overflow: hidden;
}
.cta-section::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7z' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.4; pointer-events: none;
}

.footer { background-color: #1a1a1a; color: #fff; }
.footer h5 { font-weight: 600; position: relative; display: inline-block; }
.footer h5::after {
  content: "";
  position: absolute; left: 0; bottom: -8px;
  width: 38px; height: 3px;
  background: var(--primary); border-radius: 3px;
}
.social-links a {
  color: #fff; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%; margin-right: 7px;
  transition: all var(--transition);
}
.social-links a:hover { background: var(--primary); transform: translateY(-3px); }

.how-it-works-list { list-style: none; padding: 0; }
.how-it-works-list li { display: flex; align-items: flex-start; margin-bottom: 22px; }
.step-number {
  width: 34px; height: 34px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; margin-right: 14px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (992px)
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  .hero-section { padding: 80px 0 120px; }
  :root { --sidebar-w: 260px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE CONTROLS DRAWER
   No mobile, a sidebar vira um drawer que sobe da base da tela.
   O .sidebar-col padrao fica oculto e um bottom-bar substitui.
═══════════════════════════════════════════════════════════════════════════ */

/* Overlay escuro atras do drawer */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 1040;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeInOverlay 0.22s ease;
}
.drawer-overlay.open { display: block; }

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* O drawer em si */
.controls-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background-color: var(--neutral-card);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.22);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0, 0.16, 1);
  /* Respeita home bar do iPhone */
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  /* Oculto por padrao — so aparece no mobile via JS */
  display: none;
}
.controls-drawer.open {
  transform: translateY(0);
}

/* Handle de arrastar (indicador visual no topo do drawer) */
.drawer-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--neutral-border);
}
.drawer-handle-bar {
  width: 40px;
  height: 4px;
  background-color: var(--neutral-border);
  border-radius: 4px;
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
}
.drawer-handle-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--neutral-text);
}
.drawer-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--neutral-border);
  color: var(--neutral-text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
.drawer-close-btn:hover { background: var(--neutral-muted); color: #fff; }

/* Conteudo do drawer com scroll */
.drawer-content {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* Barra inferior fixa no mobile (sempre visivel) */
.mobile-bottom-bar {
  display: none; /* mostrado apenas no mobile via media query */
  flex-shrink: 0;
  height: 60px;
  background-color: var(--neutral-card);
  border-top: 1px solid var(--neutral-border);
  padding: 0 10px;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  z-index: 20;
}

.mobile-bar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--neutral-muted);
  font-size: 0.62rem;
  font-weight: 500;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.18s ease;
  padding: 6px 4px;
  line-height: 1.2;
}
.mobile-bar-btn i {
  font-size: 1.2rem;
  margin-bottom: 1px;
}
.mobile-bar-btn:active { background-color: var(--neutral-border); }
.mobile-bar-btn.active {
  color: var(--primary);
}
.mobile-bar-btn.btn-next {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  flex: 1.4;
}
.mobile-bar-btn.btn-next:active { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Abaixo de 768px
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  :root {
    --header-h: 54px;
    --footer-h: 0px; /* footer de chat oculto no mobile, substituido pela bottom-bar */
  }

  /* Esconde footer de rodape no mobile (ocupa espaço) */
  .chat-footer-bar { display: none; }

  /* Esconde a sidebar lateral */
  .sidebar-col { display: none; }

  /* Mostra a bottom bar */
  .mobile-bottom-bar { display: flex; }

  /* Mostra o drawer */
  .controls-drawer { display: flex; }

  /* Chat main: ocupa toda a tela verticalmente */
  .chat-main {
    flex-direction: column;
    padding: 6px 6px 0 6px;
    gap: 0;
  }

  /* Chat col ocupa todo o espaco disponivel acima da bottom bar */
  .chat-col {
    flex: 1 1 0;
    min-height: 0;
    padding-bottom: 4px;
  }

  /* Vídeo self-view menor */
  .self-video {
    width: 90px;
    height: 68px;
    bottom: 72px;
    right: 10px;
  }

  /* Controles de vídeo */
  .video-controls {
    bottom: 10px;
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100% - 20px);
    border-radius: 16px;
  }
  .btn-control { width: 36px; height: 36px; font-size: 0.88rem; }
  #video-filter { max-width: 90px; font-size: 0.74rem; padding: 4px 8px; }

  /* Emoji picker */
  emoji-picker {
    right: 6px;
    bottom: 70px;
    width: calc(100vw - 12px);
    max-width: 360px;
  }

  /* Notificacoes */
  .notification {
    right: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
  }

  /* Chat bubbles hero */
  .chat-bubble { display: none; }

  /* Logo */
  .logo { font-size: 1.3rem; }

  /* Mensagens */
  #chat-box p, .message-bubble { font-size: 0.88rem; }

  /* Input */
  .input-area { padding: 8px 10px; }
  .input-group-chat input { font-size: 0.88rem; }
}

/* Extra small < 400px */
@media (max-width: 399px) {
  .btn-control { width: 32px; height: 32px; font-size: 0.82rem; }
  .self-video { width: 76px; height: 57px; }
  #chat-box p, .message-bubble { max-width: 88%; }
  .mobile-bar-btn { font-size: 0.58rem; }
  .mobile-bar-btn i { font-size: 1.1rem; }
}

/* Landscape mobile */
@media (max-height: 480px) and (orientation: landscape) {
  :root {
    --header-h: 46px;
  }
  .self-video { width: 80px; height: 60px; bottom: 60px; }
  .video-controls { bottom: 6px; }
  /* Em landscape, esconde a bottom bar e mostra sidebar compacta */
  .mobile-bottom-bar { display: none; }
  .sidebar-col {
    display: flex;
    flex: 0 0 200px;
    width: 200px;
  }
  .chat-main {
    flex-direction: row;
    padding: 4px;
    gap: 4px;
  }
}
