/* ===========================================================
   GED — Módulo Captura de Fotos via Celular
   Estilos específicos do módulo, seguindo identidade visual
   do tema.css (variáveis CSS corporativas).
=========================================================== */

/* ---------------------------------------------------------------------------
   Tela do Computador — Grade de fotos recebidas
--------------------------------------------------------------------------- */

.captura-container {
  animation: ged-fade-up 0.25s ease both;
}

/* QR Code container */
.captura-qrcode-area {
  background: var(--ged-card);
  border: 1px solid var(--ged-borda);
  border-radius: var(--ged-raio-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--ged-sombra-card);
}

.captura-qrcode-area canvas {
  margin: 0 auto;
  display: block;
}

/* Status da conexão */
.captura-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: all 0.3s ease;
}

.captura-status .captura-status-ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.captura-status-aguardando {
  background: var(--ged-aviso-bg);
  color: var(--ged-aviso);
}
.captura-status-aguardando .captura-status-ponto {
  background: var(--ged-aviso);
  animation: ged-pulso 1.6s ease-in-out infinite;
}

.captura-status-conectado {
  background: var(--ged-sucesso-bg);
  color: var(--ged-sucesso);
}
.captura-status-conectado .captura-status-ponto {
  background: var(--ged-sucesso);
}

.captura-status-recebendo {
  background: var(--ged-info-bg);
  color: var(--ged-info);
}
.captura-status-recebendo .captura-status-ponto {
  background: var(--ged-info);
  animation: ged-pulso 1.0s ease-in-out infinite;
}

.captura-status-encerrada {
  background: #F1F5F9;
  color: #64748B;
}
.captura-status-encerrada .captura-status-ponto {
  background: #64748B;
}

/* Grade de fotos */
.captura-fotos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* Card de foto individual */
.captura-foto-card {
  background: var(--ged-card);
  border: 1px solid var(--ged-borda);
  border-radius: var(--ged-raio-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  animation: ged-fade-up 0.3s ease both;
}

.captura-foto-card:hover {
  border-color: var(--ged-azul-500);
  box-shadow: var(--ged-sombra-elevada);
  transform: translateY(-2px);
}

.captura-foto-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #F1F5F9;
}

.captura-foto-info {
  padding: 8px 10px;
  border-top: 1px solid var(--ged-borda);
}

.captura-foto-nome {
  font-size: 11px;
  font-weight: 600;
  color: var(--ged-texto);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.captura-foto-meta {
  font-size: 10px;
  color: var(--ged-texto-terciario);
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
}

/* Sessão info badge */
.captura-sessao-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ged-azul-700);
  background: var(--ged-azul-50);
  border: 1px solid var(--ged-azul-100);
  padding: 4px 12px;
  border-radius: var(--ged-raio-md);
}

/* Contador de fotos */
.captura-contador {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ged-texto);
}

.captura-contador-numero {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ged-azul-600);
}

/* Modal de visualização de foto */
.captura-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  animation: ged-fade-up 0.2s ease both;
}

.captura-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--ged-raio-lg);
  box-shadow: var(--ged-sombra-modal);
  object-fit: contain;
}

.captura-lightbox-fechar {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.captura-lightbox-fechar:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------------------------------------------------------------------------
   Tela Mobile — Interface de captura
--------------------------------------------------------------------------- */

.mobile-container {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mobile-header {
  padding: 16px 20px;
  text-align: center;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}

.mobile-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.mobile-header p {
  font-size: 12px;
  color: #64748B;
  margin: 4px 0 0;
}

.mobile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 16px;
}

.mobile-video-container {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.mobile-video-container video {
  width: 100%;
  display: block;
}

.mobile-preview-container {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.mobile-preview-container img {
  width: 100%;
  display: block;
  border-radius: 12px;
}

/* Botões mobile — grandes e fáceis de usar */
.mobile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 500px;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-btn:active {
  transform: scale(0.97);
}

.mobile-btn-primario {
  background: #2563EB;
  color: white;
}

.mobile-btn-primario:hover {
  background: #1D4ED8;
}

.mobile-btn-sucesso {
  background: #16A34A;
  color: white;
}

.mobile-btn-sucesso:hover {
  background: #15803D;
}

.mobile-btn-perigo {
  background: white;
  color: #DC2626;
  border: 2px solid #DC2626;
}

.mobile-btn-perigo:hover {
  background: #FEE2E2;
}

.mobile-btn-capturar {
  width: 72px;
  height: 72px;
  max-width: 72px;
  border-radius: 50%;
  background: white;
  border: 4px solid #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  padding: 0;
}

.mobile-btn-capturar::after {
  content: '';
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #2563EB;
  display: block;
  transition: transform 0.15s ease;
}

.mobile-btn-capturar:active::after {
  transform: scale(0.85);
}

.mobile-btns-row {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 500px;
}

.mobile-btns-row .mobile-btn {
  flex: 1;
}

/* Mensagem de sessão encerrada no mobile */
.mobile-encerrada {
  text-align: center;
  padding: 40px 20px;
}

.mobile-encerrada-icone {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #64748B;
}

.mobile-encerrada h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 8px;
}

.mobile-encerrada p {
  font-size: 14px;
  color: #64748B;
  margin: 0;
}

/* Status de envio no mobile */
.mobile-enviando {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #2563EB;
  padding: 12px;
}

/* Mensagem de sucesso no mobile */
.mobile-sucesso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #16A34A;
  padding: 12px;
  background: #DCFCE7;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  animation: ged-fade-up 0.3s ease both;
}

/* ---------------------------------------------------------------------------
   Modo Lote (Batch) — UI
--------------------------------------------------------------------------- */

.mobile-tabs-container {
  display: flex;
  background: #F1F5F9;
  border-radius: 999px;
  padding: 4px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto 16px;
}

.mobile-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-tab.ativo {
  background: white;
  color: #0F172A;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mobile-lote-galeria {
  width: 100%;
  max-width: 500px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 4px;
  margin-top: auto;
  min-height: 100px;
  align-items: center;
}

.mobile-lote-item {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #E2E8F0;
  animation: ged-fade-up 0.2s ease both;
}

.mobile-lote-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-lote-item-remover {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #DC2626;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mobile-btn-lote-enviar {
  width: 100%;
  max-width: 500px;
  background: #2563EB;
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  margin: 12px 0;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: ged-fade-up 0.3s ease both;
}

.mobile-btn-lote-enviar:active {
  transform: scale(0.97);
}

.mobile-btn-lote-enviar .badge {
  background: white;
  color: #2563EB;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
