/* =====================================================================
   LINK DO INSTA V2 — Design System
   Extraído do index.html original para o painel e as telas do sistema.
   ===================================================================== */

:root {
  --bg-color: #050505;
  --card-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-color: #00f2ff;
  --whatsapp-green: #25D366;
  --gradient-text: linear-gradient(90deg, #fff 0%, #a5b4fc 100%);
  --gradient-green: linear-gradient(to right, #4ade80, #22c55e);
  --gradient-purple: linear-gradient(to right, #c084fc, #db2777);
  --texto-suave: #94a3b8;
  --perigo: #f43f5e;
  --aviso: #ffc107;
}

body {
  background-color: var(--bg-color);
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
  min-height: 100vh;
}

h1, h2, h3, .brand-font {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.03em;
}

a { color: var(--accent-color); }

/* --- Orbs de fundo --- */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.45;
  animation: floatOrb 10s infinite ease-in-out alternate;
  pointer-events: none;
}
.orb-1 { width: 400px; height: 400px; background: #4c1d95; top: -10%; left: -10%; }
.orb-2 { width: 300px; height: 300px; background: #0ea5e9; bottom: 10%; right: -5%; animation-delay: -5s; }

@keyframes floatOrb {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(30px, 50px); }
}

/* --- Marca --- */
.navbar-brand, .ldi-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  background: linear-gradient(90deg, #ffffff, #00f2ff, #ffffff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shineLogo 3s linear infinite;
  text-decoration: none;
}

@keyframes shineLogo {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* --- Botões --- */
.btn-shimmer {
  background: linear-gradient(45deg, #00f2ff, #0078ff);
  color: #fff !important;
  font-weight: 800;
  padding: 8px 25px;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 0 15px rgba(0, 242, 255, 0.5);
  animation: pulseShimmer 2s infinite ease-in-out;
  border: 1px solid rgba(255,255,255,0.3);
  transition: 0.3s;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  display: inline-block;
}
.btn-shimmer:hover { transform: scale(1.05); color: #fff; }

@keyframes pulseShimmer {
  0%   { box-shadow: 0 0 10px rgba(0, 242, 255, 0.3); }
  50%  { box-shadow: 0 0 25px rgba(0, 242, 255, 0.8); }
  100% { box-shadow: 0 0 10px rgba(0, 242, 255, 0.3); }
}

.btn-glow {
  background: #fff;
  color: #000;
  border-radius: 50px;
  padding: 12px 35px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border: none;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
.btn-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 0%; height: 100%;
  background: #00f2ff;
  transition: width 0.3s ease;
  z-index: -1;
}
.btn-glow:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(0, 242, 255, 0.4);
  color: #000;
}
.btn-glow:hover::before { width: 100%; }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: #e2e8f0;
  border-radius: 50px;
  padding: 9px 22px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: 0.3s;
}
.btn-ghost:hover { background: rgba(0,242,255,0.1); border-color: var(--accent-color); color: #fff; }

.btn-perigo {
  background: transparent;
  border: 1px solid var(--perigo);
  color: var(--perigo);
  border-radius: 50px;
  padding: 9px 22px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.3s;
}
.btn-perigo:hover { background: var(--perigo); color: #fff; }

/* --- Cards de vidro --- */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  transition: transform 0.3s;
  position: relative;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #00f2ff, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient { background: linear-gradient(to right, #a78bfa, #2dd4bf); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* --- Formulários --- */
.input-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 14px;
  border-radius: 12px;
  width: 100%;
  margin-bottom: 15px;
  transition: 0.3s;
  font-size: 0.95rem;
}
.input-dark::placeholder { color: #64748b; }
.input-dark:focus {
  outline: none;
  border-color: #00f2ff;
  box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}
.input-dark:disabled { opacity: 0.5; cursor: not-allowed; }

select.input-dark option { background: #12121c; color: #fff; }

.label-campo {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texto-suave);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-color { border: none; width: 50px; height: 46px; border-radius: 10px; cursor: pointer; background: none; padding: 0; }

.input-prefixo {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  margin-bottom: 15px;
}
.input-prefixo span {
  padding: 14px 12px;
  color: var(--texto-suave);
  font-size: 0.9rem;
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.input-prefixo .input-dark { border: none; margin: 0; border-radius: 0; background: transparent; }

/* --- Alertas / flash --- */
.alerta {
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.4s ease;
}
.alerta-sucesso { background: rgba(34,197,94,0.1);  border: 1px solid #22c55e; color: #86efac; }
.alerta-erro    { background: rgba(244,63,94,0.1);  border: 1px solid var(--perigo); color: #fda4af; }
.alerta-aviso   { background: rgba(255,193,7,0.1);  border: 1px solid var(--aviso); color: #fde68a; }
.alerta-info    { background: rgba(0,242,255,0.07); border: 1px dashed var(--accent-color); color: #a5f3fc; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* --- Navbar do painel --- */
.ldi-nav {
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.ldi-nav a.nav-item {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 50px;
  transition: 0.25s;
}
.ldi-nav a.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.ldi-nav a.nav-item.ativo { background: rgba(0,242,255,0.12); color: var(--accent-color); }

/* --- Feedback de envio (evita duplo clique em CRUD e pagamento) --- */
.enviando {
  opacity: .65;
  pointer-events: none;
  position: relative;
}
.spinner-inline {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: girar .6s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}

@keyframes girar { to { transform: rotate(360deg); } }

/* Some sozinho depois de alguns segundos, sem tirar a leitura do usuário */
.alerta.sumindo {
  animation: sumir .5s ease forwards;
}

@keyframes sumir {
  to { opacity: 0; transform: translateY(-8px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}

/* Destaque momentâneo no item recém-alterado */
.recem-salvo {
  animation: piscar 1.6s ease;
}

@keyframes piscar {
  0%   { box-shadow: 0 0 0 0 rgba(0,242,255,.5); }
  40%  { box-shadow: 0 0 0 6px rgba(0,242,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,242,255,0); }
}

/* --- Estatísticas --- */
.stat-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.35) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 22px;
  height: 100%;
}
.stat-valor {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.stat-rotulo {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--texto-suave);
  margin-top: 4px;
}

/* Gráfico de barras em CSS puro, sem biblioteca externa */
.gr-barras { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.gr-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.gr-barra {
  width: 100%;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #00f2ff, #0078ff);
  min-height: 2px;
  transition: height 0.5s ease;
}
.gr-barra.clicks { background: linear-gradient(180deg, #c084fc, #7c3aed); }
.gr-rotulo { font-size: 0.65rem; color: #64748b; white-space: nowrap; }

/* --- Lista de botões do editor --- */
.link-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: 0.25s;
}
.link-item:hover { border-color: rgba(0,242,255,0.4); }
.link-item.inativo { opacity: 0.45; }
.link-item.arrastando { opacity: 0.4; border-style: dashed; }
.link-item .puxador { cursor: grab; color: #475569; font-size: 1.2rem; }
.link-item .puxador:active { cursor: grabbing; }
.link-item .titulo { font-weight: 600; color: #fff; font-size: 0.95rem; }
.link-item .destino { font-size: 0.78rem; color: var(--texto-suave); word-break: break-all; }

.badge-cliques {
  background: rgba(0,242,255,0.1);
  color: var(--accent-color);
  border-radius: 50px;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

/* --- Cadeado de recurso pago --- */
.bloqueado { position: relative; }
.bloqueado::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(5,5,5,0.55);
  backdrop-filter: blur(2px);
  border-radius: 14px;
  z-index: 5;
}
.selo-pro {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(45deg, #ffc107, #ff9800);
  color: #000;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.aviso-upgrade {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 14px;
}

/* --- Cards de plano --- */
.plano-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0.4) 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 22px;
  padding: 30px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: 0.3s;
}
.plano-card:hover { transform: translateY(-5px); border-color: var(--accent-color); }
.plano-card.destaque { border-color: var(--accent-color); box-shadow: 0 0 30px rgba(0,242,255,0.15); }
.plano-preco { font-family: 'Space Grotesk', sans-serif; font-size: 2.4rem; font-weight: 700; color: #fff; }
.plano-lista { list-style: none; padding: 0; margin: 20px 0; flex-grow: 1; }
.plano-lista li { padding: 7px 0; font-size: 0.9rem; color: #cbd5e1; display: flex; align-items: flex-start; gap: 9px; }
.plano-lista li i { color: #22c55e; margin-top: 3px; }
.plano-lista li.off { color: #64748b; }
.plano-lista li.off i { color: #475569; }

.badge-economia {
  background: var(--gradient-green);
  color: #04210f;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
}

/* --- Tabelas do admin --- */
.tabela-dl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tabela-dl th {
  text-align: left;
  padding: 12px;
  color: var(--texto-suave);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
.tabela-dl td { padding: 14px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
.tabela-dl tr:hover td { background: rgba(255,255,255,0.02); }
.tabela-wrap { overflow-x: auto; }

.pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pill-gratis    { background: rgba(148,163,184,0.15); color: #cbd5e1; }
.pill-pro       { background: rgba(0,242,255,0.13);   color: var(--accent-color); }
.pill-vip       { background: rgba(255,193,7,0.15);   color: var(--aviso); }
.pill-pendente  { background: rgba(255,193,7,0.15);   color: var(--aviso); }
.pill-ativo     { background: rgba(34,197,94,0.13);   color: #4ade80; }
.pill-expirado  { background: rgba(244,63,94,0.13);   color: #fb7185; }
.pill-recusado  { background: rgba(244,63,94,0.13);   color: #fb7185; }
.pill-aprovado  { background: rgba(34,197,94,0.13);   color: #4ade80; }
.pill-bloqueado { background: rgba(244,63,94,0.2);    color: #fb7185; }

/* --- Preview do celular no editor --- */
.preview-sticky { position: sticky; top: 90px; }
.phone-mockup {
  width: 300px; height: 600px; background: #111; border-radius: 45px;
  border: 8px solid #2a2a2a;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,0,0,0.8);
  margin: 0 auto; position: relative; overflow: hidden;
}
.phone-mockup iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Prévia montada no DOM: reflete o que ainda não foi salvo */
#preview-corpo {
  width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden;
  padding: 26px 18px 20px;
  display: flex; flex-direction: column; align-items: center;
  transition: background .3s ease, color .3s ease;
}
#preview-corpo::-webkit-scrollbar { width: 0; }

#pv-avatar {
  width: 66px; height: 66px; border-radius: 50%;
  border: 2px solid var(--accent-color);
  background-color: rgba(127,127,127,.2);
  background-size: cover; background-position: center;
  margin-bottom: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
#pv-titulo {
  font-size: .98rem; margin: 0 0 6px; text-align: center;
  word-break: break-word; letter-spacing: -.02em; line-height: 1.25;
}
#pv-bio {
  font-size: .68rem; line-height: 1.45; opacity: .78; text-align: center;
  margin: 0 0 16px; white-space: pre-wrap; word-break: break-word;
}
#pv-links { width: 100%; }
.pv-botao {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px; margin-bottom: 8px;
  font-size: .68rem; font-weight: 600; backdrop-filter: blur(4px);
}
.pv-botao span { flex-grow: 1; text-align: center; word-break: break-word; }
.pv-botao i { font-size: .85rem; flex-shrink: 0; }
.pv-texto { width: 100%; text-align: center; font-size: .65rem; opacity: .7; margin: 4px 0 10px; }
.pv-vazio { text-align: center; font-size: .68rem; opacity: .5; padding: 20px 0; }
#pv-selo { margin-top: auto; padding-top: 16px; font-size: .58rem; opacity: .5; text-align: center; }

/* Filtro de categoria da galeria de temas */
.filtro-cat.ativo {
  background: rgba(0,242,255,.14);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* --- Rodapé --- */
.ldi-footer {
  border-top: 1px solid var(--glass-border);
  margin-top: 70px;
  padding: 40px 0;
  background: #020202;
  font-size: 0.85rem;
  color: var(--texto-suave);
}
.ldi-footer a { color: var(--texto-suave); text-decoration: none; }
.ldi-footer a:hover { color: var(--accent-color); }

/* --- Utilitários --- */
.texto-suave { color: var(--texto-suave); }
.divisor { height: 1px; background: var(--glass-border); margin: 26px 0; border: 0; }
.copiavel { cursor: pointer; font-family: monospace; }
.copiavel:hover { color: var(--accent-color); }

/* --- Responsivo --- */
@media (max-width: 991px) {
  .preview-sticky { position: static; margin-bottom: 30px; }
}
@media (max-width: 768px) {
  .glass-card { padding: 1.4rem; border-radius: 18px; }
  .stat-valor { font-size: 1.6rem; }
  .phone-mockup { width: 260px; height: 520px; }
  .ldi-menu-conta { position: static; transform: none; margin-top: 10px; }
  .link-item { flex-wrap: wrap; }
}
