/* =========================================
   RESET E CONFIGURAÇÕES GLOBAIS
   ========================================= */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: #0f172a;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(239, 68, 68, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =========================================
   HEADER GLOBAL
   ========================================= */
.site-header {
  width: 100%;
  padding: 20px 40px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  transition: opacity 0.2s;
}
.logo-header:hover { opacity: 0.8; }

/* MENU */
.site-nav {
  display: flex;
  gap: 15px;
}

.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* =========================================
   CONTAINERS E LAYOUT
   ========================================= */
.container-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  width: 100%;
}

.container {
  width: 100%;
  max-width: 930px;
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); 
  margin-bottom: 30px;
  transition: transform 0.3s ease;
}

.app-header { text-align: center; margin-bottom: 30px; }
.app-header h1 { font-size: 32px; font-weight: 800; color: #ffffff; margin-bottom: 8px; }
.subtitle { color: #94a3b8; font-size: 15px; }

/* =========================================
   INPUTS E BOTÕES (PÁGINA DE VÍDEO)
   ========================================= */
.input-group { display: flex; gap: 12px; margin-bottom: 20px; }
.input-wrapper { position: relative; flex: 1; display: flex; align-items: center; }

input[type="text"] {
  width: 100%;
  padding: 16px 48px 16px 20px;
  font-size: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  outline: none;
  transition: all 0.3s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
input[type="text"]::placeholder { color: #64748b; }
input[type="text"]:focus { border-color: #ef4444; background: rgba(15, 23, 42, 0.8); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2), inset 0 2px 4px rgba(0,0,0,0.3); }

#btn-paste { position: absolute; right: 12px; background: transparent; border: none; font-size: 20px; cursor: pointer; opacity: 0.7; transition: opacity 0.2s, transform 0.2s; }
#btn-paste:hover { opacity: 1; transform: scale(1.1); }

.btn-extrair {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 700;
  color: white;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  box-shadow: 0 6px 0 #7f1d1d, 0 10px 15px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}
.btn-extrair:hover:not(:disabled) { background: linear-gradient(180deg, #f87171 0%, #dc2626 100%); transform: translateY(-2px); box-shadow: 0 8px 0 #7f1d1d, 0 12px 20px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.btn-extrair:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #7f1d1d, 0 4px 5px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.1); }
.btn-extrair:disabled { background: #475569; box-shadow: none; cursor: not-allowed; transform: translateY(4px); }

.aviso-legal { background-color: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); color: #fcd34d; padding: 14px 18px; border-radius: 10px; font-size: 13px; line-height: 1.6; margin-bottom: 20px; }

#resultado-container { border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; overflow: hidden; background: rgba(15, 23, 42, 0.4); animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

.action-bar { background-color: rgba(30, 41, 59, 0.8); padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-secundario {
  padding: 10px 18px; font-size: 13px; font-weight: 600; color: #e2e8f0;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 1px solid #475569; border-radius: 8px; cursor: pointer; transition: all 0.1s;
  box-shadow: 0 3px 0 #0f172a, 0 4px 6px rgba(0,0,0,0.3);
}
.btn-secundario:hover { background: linear-gradient(180deg, #475569 0%, #334155 100%); transform: translateY(-1px); }
.btn-secundario:active { transform: translateY(2px); box-shadow: 0 1px 0 #0f172a; }

#resultado { padding: 24px; white-space: pre-wrap; font-size: 15px; line-height: 1.8; color: #cbd5e1; max-height: 400px; overflow-y: auto; }

/* =========================================
   BANNER UNDERSITES
   ========================================= */
.banner-undersites { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px; padding: 30px 40px; }
.banner-content { flex: 1; min-width: 300px; }
.banner-logo { display: inline-flex; align-items: center; gap: 6px; background: rgba(59, 130, 246, 0.2); color: #93c5fd; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 12px; border: 1px solid rgba(59, 130, 246, 0.3); }
.banner-content h2 { font-size: 24px; color: #fff; margin-bottom: 8px; }
.banner-content p { color: #94a3b8; font-size: 15px; line-height: 1.6; }
.banner-actions { display: flex; flex-direction: column; gap: 12px; min-width: 220px; }
.banner-actions a { text-align: center; text-decoration: none; font-size: 15px; font-weight: 600; border-radius: 10px; padding: 14px 20px; transition: all 0.2s; }

.btn-primario { background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); color: white; box-shadow: 0 4px 0 #1e3a8a, 0 6px 10px rgba(0,0,0,0.3); }
.btn-primario:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #1e3a8a, 0 8px 15px rgba(0,0,0,0.4); }
.btn-primario:active { transform: translateY(2px); box-shadow: 0 2px 0 #1e3a8a; }

.btn-outline { background: transparent; color: #cbd5e1; border: 1px solid #475569; }
.btn-outline:hover { background: rgba(71, 85, 105, 0.3); color: #fff; }

.link-texto { color: #60a5fa; padding: 4px !important; background: transparent !important; font-size: 14px !important; font-weight: 500 !important; }
.link-texto:hover { text-decoration: underline; color: #93c5fd; }

/* =========================================
   HISTÓRICO E SKELETON
   ========================================= */
#historico-container { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
#historico-container h3 { font-size: 14px; font-weight: 600; color: #94a3b8; margin-bottom: 12px; }
#historico-lista { list-style: none; display: flex; flex-direction: column; gap: 8px; }
#historico-lista li { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(30, 41, 59, 0.5); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 10px; font-size: 13px; color: #cbd5e1; cursor: pointer; transition: all 0.2s; }
#historico-lista li:hover { background: rgba(30, 41, 59, 0.8); border-color: rgba(255, 255, 255, 0.15); transform: translateX(4px); }
#historico-lista li span.titulo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80%; }
#historico-lista li span.acao { font-size: 11px; font-weight: 600; color: #60a5fa; }

.skeleton { border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 20px; background: rgba(15, 23, 42, 0.4); }
.skeleton-header { height: 24px; width: 30%; background: rgba(255,255,255,0.1); border-radius: 4px; margin-bottom: 16px; animation: pulse 1.5s infinite; }
.skeleton-line { height: 16px; background: rgba(255,255,255,0.1); border-radius: 4px; margin-bottom: 10px; animation: pulse 1.5s infinite; }
.skeleton-line.short { width: 60%; }

.tag-idioma { background: rgba(37, 99, 235, 0.2); color: #93c5fd; border: 1px solid rgba(37, 99, 235, 0.3); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }

/* =========================================
   FOOTER E ANIMAÇÕES GLOBAIS
   ========================================= */
.site-footer { width: 100%; text-align: center; padding: 30px 20px; border-top: 1px solid rgba(255, 255, 255, 0.05); background: rgba(15, 23, 42, 0.8); margin-top: auto; }
.site-footer p { color: #64748b; font-size: 13px; margin-bottom: 4px; }
.site-footer a { color: #60a5fa; text-decoration: none; font-weight: 600; transition: color 0.2s; }
.site-footer a:hover { color: #93c5fd; text-decoration: underline; }

@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.loader { border: 2px solid rgba(255,255,255,0.3); border-top: 2px solid white; border-radius: 50%; width: 16px; height: 16px; animation: spin 1s linear infinite; margin-right: 8px; display: none; }

/* =========================================
   MODAL PWA
   ========================================= */
.pwa-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

.pwa-modal-box {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(20px);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pwa-modal-icon {
  font-size: 56px;
  margin-bottom: 15px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.pwa-modal-box h2 {
  color: #ffffff;
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: 700;
}

.pwa-modal-box p {
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 25px;
}

.pwa-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

/* Botão de Instalar no Header */
.btn-install-header {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-install-header:hover {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: #34d399 !important;
}

/* =========================================
   RESPONSIVIDADE
   ========================================= */
@media (max-width: 650px) {
  .site-header { padding: 15px 20px; }
  .container { padding: 24px; border-radius: 16px; }
  .app-header h1 { font-size: 24px; }
  .input-group { flex-direction: column; }
  .btn-extrair { width: 100%; }
  .banner-undersites { flex-direction: column; text-align: center; padding: 24px; }
  .banner-actions { width: 100%; margin-top: 10px; }
  .action-bar { flex-direction: column; align-items: flex-start; }
  .action-buttons { width: 100%; justify-content: space-between; }
  .btn-install-header { display: none !important; }
}

/* Mantém a altura estável ao trocar de aba */
.tab-content {
  min-height: 400px; 
}

/* =========================================
   ESTILOS DAS ABAS (TABS) - REUTILIZÁVEL
   ========================================= */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px;
  border-radius: 12px;
  flex-wrap: wrap; /* Permite quebrar linha no celular */
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap; /* Evita que o texto quebre */
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Ajuste do input de texto para o QR Code (textarea) */
textarea {
  width: 100%;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  resize: none;
  outline: none;
  transition: all 0.3s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

textarea:focus {
  border-color: #ef4444;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* Ajuste dos labels do Wi-Fi */
.input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.input-group input[type="radio"] {
  accent-color: #3b82f6;
  width: 16px;
  height: 16px;
}

/* =========================================
   AJUSTE DO MENU COM 4 ITENS
   ========================================= */
.site-nav {
  display: flex;
  gap: 10px; /* Reduzido de 15px para 10px para caber tudo */
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  padding: 8px 12px; /* Reduzido o preenchimento lateral */
  font-size: 13px;   /* Fonte um pouco menor para caber no celular */
}

/* No celular, o menu fica alinhado e o botão de instalar esconde */
@media (max-width: 650px) {
  .site-header {
    flex-direction: column;
    padding: 15px;
    gap: 15px;
  }
  
  .site-nav {
    justify-content: center;
    width: 100%;
  }
}