/* ============================================================
   RANKING PREMIADO ZK — GLOBAL CSS  v3.0
   Sistema responsivo: Mobile-first (320px → 480px → 768px → 1024px → 1280px)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ── Variáveis ─────────────────────────────────────────────── */
:root {
  --gold:          #D4AF37;
  --gold-light:    #FFD86B;
  --gold-dark:     #8A6420;
  --bg-deep:       #08090A;
  --bg-card:       #111318;
  --bg-card2:      #181C22;
  --border-gold:   rgba(212,175,55,0.35);
  --border-gold2:  rgba(212,175,55,0.15);
  --text-white:    #F5F5F5;
  --text-muted:    #B0B0B0;
  --text-dim:      #6B7280;
  --danger:        #E53E3E;
  --success:       #38A169;
  --info:          #3182CE;
  --font-title:    'Poppins', sans-serif;
  --font-ui:       'Inter', sans-serif;
  --font-rank:     'Bebas Neue', cursive;
  --glow-gold:     0 0 20px rgba(212,175,55,0.4), 0 0 60px rgba(212,175,55,0.15);
  --glow-sm:       0 0 10px rgba(212,175,55,0.3);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.5);
  --t:             0.22s ease;
  --sidebar-w:     240px;
  --topbar-h:      58px;
  --navbar-h:      64px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-deep);
  color: var(--text-white);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a  { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; height: auto; }
button { cursor: pointer; font-family: var(--font-title); border: none; outline: none; }
input, textarea, select { font-family: var(--font-ui); outline: none; box-sizing: border-box; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-title); font-weight: 600; font-size: 0.92rem;
  letter-spacing: 0.02em; transition: all var(--t);
  white-space: nowrap; text-decoration: none; border: none;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  color: #000;
  box-shadow: 0 4px 14px rgba(212,175,55,0.35);
}
.btn-primary:hover  { box-shadow: 0 6px 28px rgba(212,175,55,0.55); transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
}
.btn-outline:hover { background: rgba(212,175,55,0.08); box-shadow: var(--glow-sm); }

.btn-danger   { background: rgba(229,62,62,0.1);  border: 1.5px solid var(--danger);  color: var(--danger); }
.btn-danger:hover  { background: rgba(229,62,62,0.2); }
.btn-success  { background: rgba(56,161,105,0.1); border: 1.5px solid var(--success); color: var(--success); }
.btn-success:hover { background: rgba(56,161,105,0.2); }

.btn-sm   { padding: 8px 16px; font-size: 0.82rem; border-radius: 6px; }
.btn-lg   { padding: 15px 36px; font-size: 1rem; border-radius: 10px; }
.btn-full { width: 100%; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold2);
  border-radius: 12px;
  padding: clamp(14px, 3vw, 24px);
  box-shadow: var(--shadow-card);
}

/* ============================================================
   LOGO ZK
   ============================================================ */
.logo-zk { display: inline-block; position: relative; }
.logo-zk img {
  height: auto; width: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 0 6px rgba(212,175,55,0.45)) drop-shadow(0 2px 10px rgba(0,0,0,0.6));
  transition: filter var(--t);
}
.logo-zk:hover img {
  filter: drop-shadow(0 0 14px rgba(212,175,55,0.7)) drop-shadow(0 0 28px rgba(255,216,107,0.25)) drop-shadow(0 2px 10px rgba(0,0,0,0.6));
}

/* Tamanhos */
.logo-nav    img { height: 38px; max-width: 120px; }
.logo-hero   img { height: 90px; max-width: 260px; }
.logo-login  img { height: 76px; max-width: 210px; }
.logo-sidebar img { height: 40px; max-width: 130px; }
.logo-topbar  img { height: 30px; max-width: 90px; }
.logo-footer  img { height: 40px; max-width: 130px; }

/* Shine */
.logo-shine { position: relative; overflow: hidden; }
.logo-shine::after {
  content: '';
  position: absolute; top: -50%; left: -80%;
  width: 60%; height: 200%;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.16) 50%, transparent 70%);
  transform: skewX(-15deg);
  animation: shine 4.5s ease-in-out infinite;
}
@keyframes shine { 0%,45%{left:-80%} 65%,100%{left:130%} }

/* Pulse */
@keyframes logoPulse {
  0%,100% { filter: drop-shadow(0 0 6px rgba(212,175,55,0.45)); }
  50%     { filter: drop-shadow(0 0 18px rgba(212,175,55,0.75)) drop-shadow(0 0 36px rgba(255,216,107,0.2)); }
}
.logo-pulse img { animation: logoPulse 3.5s ease-in-out infinite; }

/* Watermark */
.page-watermark {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: min(220px, 35vw);
  opacity: 0.02; pointer-events: none; z-index: 0;
  filter: grayscale(1) brightness(2);
}

/* ============================================================
   RANK BADGES
   ============================================================ */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-family: var(--font-rank); font-size: 0.9rem; flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg,#FFE066,#D4AF37); color:#000; box-shadow:0 0 10px rgba(212,175,55,0.5); }
.rank-2 { background: linear-gradient(135deg,#E8E8E8,#A0A0A0); color:#000; }
.rank-3 { background: linear-gradient(135deg,#CD7F32,#8B4513); color:#fff; }
.rank-other { background: var(--bg-card2); border: 1px solid var(--border-gold2); color: var(--text-muted); }

/* ============================================================
   XP BAR
   ============================================================ */
.xp-bar-wrap { background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; height: 10px; }
.xp-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg,var(--gold-dark),var(--gold),var(--gold-light));
  position: relative; transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.xp-bar::after {
  content:''; position:absolute; top:0; right:0; width:40px; height:100%;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,0.3));
  border-radius:999px; animation:shimmer 2s ease-in-out infinite;
}
@keyframes shimmer { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed; top: 72px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: calc(100vw - 32px);
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-gold); border-left: 4px solid var(--gold);
  border-radius: 10px; padding: 12px 18px;
  font-size: 0.88rem; color: var(--text-white);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  min-width: 220px; max-width: 300px; word-break: break-word;
}
.toast.success { border-left-color: var(--success); }
.toast.danger  { border-left-color: var(--danger); }
@keyframes toastIn  { from{opacity:0;transform:translateX(40px)} to{opacity:1;transform:translateX(0)} }
@keyframes toastOut { from{opacity:1} to{opacity:0;transform:translateX(40px)} }

/* ============================================================
   FLOATING POINTS
   ============================================================ */
.pts-float {
  position: fixed; font-family: var(--font-rank); font-size: 1.8rem;
  color: var(--gold-light); text-shadow: 0 0 16px rgba(255,216,107,0.8);
  pointer-events: none; z-index: 9998;
  animation: floatUp 2s ease-out forwards;
}
@keyframes floatUp {
  0%  { opacity:1; transform:translateY(0) scale(1); }
  60% { opacity:1; transform:translateY(-70px) scale(1.2); }
  100%{ opacity:0; transform:translateY(-130px) scale(0.8); }
}

/* ============================================================
   BADGES DE NÍVEL
   ============================================================ */
.level-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; font-family: var(--font-title);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-bronze { background:rgba(205,127,50,0.15); border:1px solid #CD7F32; color:#CD7F32; }
.badge-prata  { background:rgba(160,160,160,0.15); border:1px solid #A0A0A0; color:#C8C8C8; }
.badge-ouro   { background:rgba(212,175,55,0.15);  border:1px solid var(--gold); color:var(--gold-light); box-shadow:0 0 6px rgba(212,175,55,0.25); }

/* ============================================================
   STATUS CHIPS
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.73rem; font-weight: 600; white-space: nowrap;
}
.chip-pending  { background:rgba(203,166,247,0.1); border:1px solid rgba(203,166,247,0.4); color:#CBA6F7; }
.chip-review   { background:rgba(250,179,135,0.1); border:1px solid rgba(250,179,135,0.4); color:#FAB387; }
.chip-approved { background:rgba(56,161,105,0.1);  border:1px solid rgba(56,161,105,0.4);  color:#68D391; }
.chip-rejected { background:rgba(229,62,62,0.1);   border:1px solid rgba(229,62,62,0.4);   color:#FC8181; }

/* ============================================================
   FORM
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.83rem; font-weight: 500; color: var(--text-muted); }
.form-input {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border-gold2);
  border-radius: 8px; padding: 12px 14px;
  color: var(--text-white); font-size: 0.93rem;
  transition: all var(--t); width: 100%;
}
.form-input:focus { border-color: var(--gold); background: rgba(255,255,255,0.07); box-shadow: 0 0 0 3px rgba(212,175,55,0.1); }
.form-input::placeholder { color: var(--text-dim); }

/* ============================================================
   LOADER
   ============================================================ */
#page-loader {
  position: fixed; inset: 0; background: var(--bg-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; z-index: 99999; transition: opacity 0.5s ease;
}
#page-loader.hidden { opacity: 0; pointer-events: none; }
.loader-logo { width: 100px; }
.loader-ring {
  width: 44px; height: 44px;
  border: 3px solid rgba(212,175,55,0.15); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.85s linear infinite;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* ============================================================
   NAVBAR (landing)
   ============================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--navbar-h);
  background: rgba(8,9,10,0.94); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-gold2);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(14px, 4vw, 48px); z-index: 1000;
}
.navbar-left  { display: flex; align-items: center; }
.navbar-right { display: flex; align-items: center; gap: 10px; }
.navbar-menu  { display: flex; align-items: center; gap: 24px; list-style: none; }
.navbar-menu a { color: var(--text-muted); font-size: 0.88rem; font-weight: 500; transition: color var(--t); }
.navbar-menu a:hover { color: var(--gold); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
  -webkit-tap-highlight-color: transparent;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--gold); border-radius: 2px; transition: all var(--t); }

/* Mobile drawer */
.mobile-drawer {
  position: fixed; top: var(--navbar-h); left: 0; right: 0;
  background: rgba(8,9,10,0.98); border-bottom: 1px solid var(--border-gold2);
  padding: 16px 20px; display: flex; flex-direction: column; gap: 4px;
  z-index: 999; transform: translateY(-110%); transition: transform 0.3s ease;
}
.mobile-drawer.open { transform: translateY(0); }
.mobile-drawer a {
  color: var(--text-muted); font-size: 0.95rem; padding: 12px 8px;
  border-bottom: 1px solid var(--border-gold2); transition: color var(--t);
  display: block;
}
.mobile-drawer a:last-child { border-bottom: none; }
.mobile-drawer a:hover { color: var(--gold); }

/* ============================================================
   APP LAYOUT — SIDEBAR + MAIN
   ============================================================ */

/* Estrutura principal */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #090B0D;
  border-right: 1px solid var(--border-gold2);
  display: flex; flex-direction: column;
  z-index: 600;
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-gold2);
  display: flex; align-items: center; justify-content: center;
  min-height: 72px; flex-shrink: 0;
}
.sidebar-nav {
  flex: 1; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 3px;
  overflow-y: auto;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 8px;
  color: var(--text-muted); font-size: 0.88rem; font-weight: 500;
  transition: all var(--t); cursor: pointer; text-decoration: none;
  white-space: nowrap; border-left: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-item:hover  { background: rgba(212,175,55,0.07); color: var(--gold); }
.sidebar-item.active { background: rgba(212,175,55,0.1); color: var(--gold); border-left-color: var(--gold); }
.sidebar-item .icon  { font-size: 1.05rem; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border-gold2); flex-shrink: 0; }

/* Main content — desktops: margem da sidebar */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh; min-width: 0;
  padding: 28px clamp(16px, 2.5vw, 36px) 60px;
  position: relative; box-sizing: border-box;
  overflow-x: hidden;
}

/* Topbar mobile */
.topbar-mobile {
  display: none;
  align-items: center; justify-content: space-between;
  padding: 0 14px; height: var(--topbar-h);
  background: #090B0D;
  border-bottom: 1px solid var(--border-gold2);
  position: sticky; top: 0; z-index: 500;
  width: 100%; flex-shrink: 0;
}
.topbar-mobile .logo-topbar { display: flex; align-items: center; }

/* Sidebar overlay (toque fora para fechar) */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 590;
  backdrop-filter: blur(2px);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-gold    { color: var(--gold); }
.text-gold-lt { color: var(--gold-light); }
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-center  { text-align: center; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }
.gap-24       { gap: 24px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mt-32  { margin-top: 32px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.overflow-x { overflow-x: auto; }

.section-title {
  font-family: var(--font-title); font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.35rem); color: var(--text-white);
  line-height: 1.3;
}
.section-title span { color: var(--gold); }

.divider-gold { border: none; border-top: 1px solid var(--border-gold2); margin: 20px 0; }

/* Avatar */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--bg-card2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 700; font-size: 0.85rem;
  color: var(--gold-light); flex-shrink: 0;
  border: 1.5px solid var(--border-gold2);
}

/* Table */
.table-wrap {
  overflow-x: auto; border-radius: 10px;
  border: 1px solid var(--border-gold2);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 420px; }
th {
  background: rgba(212,175,55,0.07);
  padding: 10px 12px; text-align: left;
  font-size: 0.73rem; color: var(--gold); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
td { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.04); font-size: 0.84rem; vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Mensagem vazia */
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-dim); }
.empty-state i { font-size: 2.5rem; margin-bottom: 10px; display: block; opacity: 0.35; }

/* msg boxes */
.msg-box { border-radius: 8px; padding: 10px 14px; font-size: 0.84rem; }
.msg-error   { background:rgba(229,62,62,0.1);  border:1px solid rgba(229,62,62,0.4);  color:#FC8181; }
.msg-success { background:rgba(56,161,105,0.1); border:1px solid rgba(56,161,105,0.4); color:#68D391; }

/* ============================================================
   RESPONSIVE — TABLET (768px–1023px)
   ============================================================ */
@media (min-width: 768px) {
  :root { --navbar-h: 68px; }
  .logo-nav    img { height: 42px; max-width: 138px; }
  .logo-hero   img { height: 130px; max-width: 340px; }
  .logo-login  img { height: 90px;  max-width: 240px; }
  .mobile-drawer { top: 68px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :root { --sidebar-w: 200px; }
  .sidebar-item { font-size: 0.84rem; padding: 10px 10px; }
  .sidebar-item .icon { width: 18px; font-size: 1rem; }
}

/* ============================================================
   RESPONSIVE — DESKTOP (1024px+)
   ============================================================ */
@media (min-width: 1024px) {
  .logo-hero img { height: 150px; max-width: 380px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  /* Navbar */
  .navbar-menu { display: none; }
  .navbar-right .btn-outline { display: none; }
  .hamburger { display: flex; }

  /* Toast */
  #toast-container { top: calc(var(--topbar-h) + 8px); right: 10px; left: 10px; }
  .toast { min-width: unset; max-width: 100%; }

  /* Sidebar vira drawer — sobreposta */
  .sidebar {
    transform: translateX(-100%);
    top: 0;
    z-index: 700;
    width: 260px;
  }
  .sidebar.open         { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  /* Topbar fica visível */
  .topbar-mobile { display: flex; }

  /* Main sem margem da sidebar */
  .main-content {
    margin-left: 0;
    padding: 16px 14px 50px;
  }

  /* Tabela */
  td, th { padding: 8px 10px; font-size: 0.79rem; }

  /* Botões */
  .btn-lg { padding: 14px 28px; font-size: 0.95rem; }

  /* Botão full-width em ações de cards */
  .action-full .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (< 480px)
   ============================================================ */
@media (max-width: 479px) {
  :root { --topbar-h: 54px; }
  body { font-size: 15px; }
  .btn { padding: 11px 18px; font-size: 0.85rem; }
  .btn-sm { padding: 7px 14px; font-size: 0.8rem; }
  .btn-lg { padding: 12px 22px; font-size: 0.9rem; }
  .card { padding: 14px 12px; }
  .section-title { font-size: 1rem; }
  .main-content { padding: 14px 12px 48px; }
}

/* ============================================================
   RESPONSIVE — VERY SMALL (< 360px)
   ============================================================ */
@media (max-width: 359px) {
  body { font-size: 14px; }
  .card { padding: 12px 10px; }
  .main-content { padding: 12px 10px 48px; }
}
