/* ========================================================
   Templarios - Folha de Estilos Oficial
   Design Moderno Dark Glassmorphic (pt-PT)
   Versão: 1.0.0
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-primary: #070b14;
  --bg-secondary: #0c1220;
  --bg-card: #0f172a;
  --bg-card-inner: #070c17;
  --bg-card-hover: #131c31;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --accent-purple: #8b5cf6;
  --accent-purple-hover: #7c3aed;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 25px rgba(37, 99, 235, 0.25);
  --shadow-glow-green: 0 0 25px rgba(16, 185, 129, 0.25);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Fundo com iluminação radial suave */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, rgba(37, 99, 235, 0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================================
   Cabeçalho (Header)
   ======================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: transform var(--transition-fast);
}

.brand-wrapper:hover .brand-icon {
  transform: scale(1.05);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.admin-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.admin-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ========================================================
   Seção Hero (Título & Subtítulo)
   ======================================================== */
.hero-section {
  text-align: center;
  padding: 56px 16px 36px;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 60%, #f472b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========================================================
   Banner de Avisos Importantes (Notice Card)
   ======================================================== */
.notice-wrapper {
  max-width: 860px;
  margin: 0 auto 40px;
}

.notice-card {
  background: linear-gradient(180deg, rgba(22, 19, 14, 0.85) 0%, rgba(15, 17, 24, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 4px solid var(--accent-amber);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.notice-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notice-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.55;
}

.notice-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.code-pill-amber {
  display: inline-block;
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9em;
}

.code-pill-purple {
  display: inline-block;
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9em;
}

/* ========================================================
   Filtros & Barra de Pesquisa
   ======================================================== */
.search-filter-wrapper {
  max-width: 760px;
  margin: 0 auto 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.search-box-container {
  position: relative;
  width: 100%;
}

.search-icon-decor {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 20px;
  height: 20px;
}

.search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 16px 50px 16px 52px;
  color: #ffffff;
  font-size: 0.98rem;
  font-family: var(--font-main);
  outline: none;
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.search-input::placeholder {
  color: #475569;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 8px 25px rgba(0, 0, 0, 0.4);
  background: rgba(15, 23, 42, 0.9);
}

.search-clear-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition-fast);
  display: none;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Tabs de Categoria */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-main);
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

.tab-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* ========================================================
   Grelha de Colunas de Aplicações
   ======================================================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 70px;
  align-items: start;
}

@media (max-width: 1200px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
}

/* Coluna Individual */
.category-column {
  background: rgba(13, 19, 33, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-normal);
}

.category-column:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.column-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.column-icon-box {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.column-icon-box svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.column-title-wrap {
  display: flex;
  flex-direction: column;
}

.column-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.column-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.column-count-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.apps-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ========================================================
   Card da Aplicação
   ======================================================== */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-badge.tag-ios {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-badge.tag-appletv {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.tag-badge.tag-apk {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-badge.tag-googleplay {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.tag-badge.tag-windows {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.tag-badge.tag-web {
  background: rgba(236, 72, 153, 0.15);
  color: #f9a8d4;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.tag-badge.tag-smarttv {
  background: rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.tag-badge.tag-default {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.app-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.app-description {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Botões de Ação */
.action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.action-btn:active {
  transform: translateY(1px);
}

.action-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

/* Cores dos Botões */
.btn-apple {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
}
.btn-apple:hover {
  box-shadow: var(--shadow-glow-blue);
}

.btn-apk {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}
.btn-apk:hover {
  box-shadow: var(--shadow-glow-green);
}

.btn-windows {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
}

.btn-web {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
}

.btn-smarttv {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Caixa do Código de Ativação / Downloader */
.code-box-wrapper {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.code-box-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.code-box-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.code-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #34d399; /* Verde neon legível */
  user-select: all;
}

.code-value.portal-code {
  color: #c084fc; /* Roxo vibrante para portal code */
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-main);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.copy-btn.copied {
  background: #059669;
  border-color: #10b981;
  color: #ffffff;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ========================================================
   Estado Vazio (Sem resultados na pesquisa)
   ======================================================== */
.empty-state {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: rgba(13, 19, 33, 0.5);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-xl);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  fill: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ========================================================
   Rodapé (Footer)
   ======================================================== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 32px 0 40px;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: #ffffff;
}

/* ========================================================
   Toast Notificação (Copiado com sucesso)
   ======================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-left: 4px solid var(--accent-green);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.3s 2.7s forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  fill: var(--accent-green);
  flex-shrink: 0;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}
