/* ============================================================
   PokéHologram — Design System v4.0
   Glassmorphism + Neon + Mobile-First para crianças
   ============================================================ */

/* --- Variáveis --- */
:root {
  --pk-blue: #4FC3F7;
  --pk-blue-rgb: 79,195,247;
  --pk-purple: #CE93D8;
  --pk-purple-rgb: 206,147,216;
  --pk-green: #81C784;
  --pk-green-rgb: 129,199,132;
  --pk-yellow: #FFD54F;
  --pk-yellow-rgb: 255,213,79;
  --pk-red: #EF5350;
  --pk-red-rgb: 239,83,80;
  --pk-orange: #FF8A65;
  --bg-1: #0a0e1a;
  --bg-2: #0d1225;
  --bg-3: #111827;
  --glass: rgba(255,255,255,0.06);
  --glass-hover: rgba(255,255,255,0.10);
  --glass-border: rgba(255,255,255,0.12);
  --text-1: #F0F4FF;
  --text-2: #9BA8C0;
  --text-3: #5A6580;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-neon: 0 0 20px rgba(79,195,247,0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --fs-xs: 10px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 28px; --s8: 32px;
  --navbar-h: 60px;
  --bottom-nav-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Lexend', 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg-1);
  color: var(--text-1);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Fundo animado --- */
.bg-particles {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(79,195,247,0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(206,147,216,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(129,199,132,0.04) 0%, transparent 70%);
}
.particle {
  position: absolute; border-radius: 50%;
  background: rgba(79,195,247,0.15);
  animation: float 8s ease-in-out infinite;
}
.particle:nth-child(1) { width:200px;height:200px;top:-50px;left:-50px;animation-delay:0s; }
.particle:nth-child(2) { width:150px;height:150px;top:30%;right:-30px;animation-delay:2s;background:rgba(206,147,216,0.1); }
.particle:nth-child(3) { width:100px;height:100px;bottom:20%;left:20%;animation-delay:4s;background:rgba(255,213,79,0.08); }
.particle:nth-child(4) { width:80px;height:80px;top:60%;right:10%;animation-delay:1s;background:rgba(129,199,132,0.1); }
.particle:nth-child(5) { width:120px;height:120px;bottom:-30px;right:30%;animation-delay:3s; }
@keyframes float {
  0%,100% { transform: translateY(0) scale(1); opacity:0.5; }
  50% { transform: translateY(-20px) scale(1.05); opacity:0.8; }
}

/* --- Layout --- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--navbar-h);
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 var(--s4);
  max-width: 480px; margin: 0 auto;
}
.navbar-brand {
  display: flex; align-items: center; gap: var(--s2);
  text-decoration: none; color: var(--text-1);
}
.brand-icon { font-size: 22px; }
.brand-name { font-family: 'Lexend', sans-serif; font-weight: 700; font-size: var(--fs-md); color: var(--pk-blue); }
.navbar-actions { display: flex; align-items: center; gap: var(--s2); }
.navbar-notif { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--pk-red); color: #fff;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bg-1);
}
.avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--pk-blue); }
.avatar-ph {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pk-blue), var(--pk-purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-sm); color: #fff;
}

.main-content {
  position: relative; z-index: 1;
  padding-top: calc(var(--navbar-h) + var(--s4));
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--s4));
  min-height: 100dvh;
}
.main-auth {
  padding-top: 0;
  padding-bottom: 0;
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh;
}

.container {
  max-width: 480px; margin: 0 auto;
  padding: 0 var(--s4) var(--s4);
}

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10,14,26,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  display: flex; align-items: flex-start; justify-content: space-around;
  padding-top: var(--s2);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--text-3);
  padding: var(--s2) var(--s3); border-radius: var(--radius-sm);
  transition: all 0.2s ease; min-width: 56px;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item .material-icons-round { font-size: 24px; transition: all 0.2s; }
.bottom-nav-label { font-size: 9px; font-weight: 500; }
.bottom-nav-item.active,
.bottom-nav-item:active {
  color: var(--pk-blue);
}
.bottom-nav-item.active .material-icons-round {
  filter: drop-shadow(0 0 8px var(--pk-blue));
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: var(--s4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}
.glass-card:hover { background: var(--glass-hover); }

/* --- Botões --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--s3) var(--s5); border-radius: var(--radius-sm);
  font-family: 'Lexend', sans-serif; font-weight: 600; font-size: var(--fs-base);
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.2s ease; -webkit-tap-highlight-color: transparent;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--pk-blue), #2196F3);
  color: #fff; box-shadow: 0 4px 16px rgba(79,195,247,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(79,195,247,0.5); }
.btn-success {
  background: linear-gradient(135deg, var(--pk-green), #4CAF50);
  color: #fff; box-shadow: 0 4px 16px rgba(129,199,132,0.35);
}
.btn-danger {
  background: linear-gradient(135deg, var(--pk-red), #E53935);
  color: #fff; box-shadow: 0 4px 16px rgba(239,83,80,0.35);
}
.btn-ghost {
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-1);
}
.btn-ghost:hover { background: var(--glass-hover); }
.btn-full { width: 100%; }
.btn-sm { padding: var(--s2) var(--s3); font-size: var(--fs-sm); border-radius: 8px; }
.btn-icon { padding: var(--s2); border-radius: 50%; width: 40px; height: 40px; }
.btn .material-icons-round { font-size: 18px; }
.btn-sm .material-icons-round { font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Formulários --- */
.form-group { margin-bottom: var(--s4); }
.form-label {
  display: block; font-size: var(--fs-sm); font-weight: 600;
  color: var(--text-2); margin-bottom: var(--s2); letter-spacing: 0.5px;
}
.req { color: var(--pk-red); }
.form-control {
  width: 100%; padding: var(--s3) var(--s4);
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--text-1);
  font-family: 'Lexend', sans-serif; font-size: var(--fs-base);
  transition: all 0.2s ease; outline: none;
  -webkit-appearance: none; appearance: none;
}
.form-control:focus {
  border-color: var(--pk-blue);
  background: rgba(79,195,247,0.06);
  box-shadow: 0 0 0 3px rgba(79,195,247,0.15);
}
.form-control::placeholder { color: var(--text-3); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-error { font-size: var(--fs-xs); color: var(--pk-red); margin-top: var(--s1); }
.form-help { font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--s1); }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 20px;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.3px;
}
.badge-blue { background: rgba(79,195,247,0.2); color: var(--pk-blue); }
.badge-green { background: rgba(129,199,132,0.2); color: var(--pk-green); }
.badge-yellow { background: rgba(255,213,79,0.2); color: var(--pk-yellow); }
.badge-red { background: rgba(239,83,80,0.2); color: var(--pk-red); }
.badge-purple { background: rgba(206,147,216,0.2); color: var(--pk-purple); }
.badge-gray { background: rgba(255,255,255,0.1); color: var(--text-2); }
.badge-orange { background: rgba(255,138,101,0.2); color: var(--pk-orange); }

/* --- Toast / Mensagens --- */
.messages-container {
  position: fixed; top: calc(var(--navbar-h) + var(--s2));
  left: var(--s4); right: var(--s4); z-index: 200;
  display: flex; flex-direction: column; gap: var(--s2);
  max-width: 480px; margin: 0 auto;
}
.toast {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: slideDown 0.3s ease; box-shadow: var(--shadow);
}
.toast-success { background: rgba(129,199,132,0.2); border: 1px solid rgba(129,199,132,0.4); }
.toast-error, .toast-danger { background: rgba(239,83,80,0.2); border: 1px solid rgba(239,83,80,0.4); }
.toast-warning { background: rgba(255,213,79,0.2); border: 1px solid rgba(255,213,79,0.4); }
.toast-info { background: rgba(79,195,247,0.2); border: 1px solid rgba(79,195,247,0.4); }
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--pk-green); }
.toast-error .toast-icon, .toast-danger .toast-icon { color: var(--pk-red); }
.toast-warning .toast-icon { color: var(--pk-yellow); }
.toast-info .toast-icon { color: var(--pk-blue); }
.toast-text { flex: 1; font-size: var(--fs-sm); font-weight: 500; }
.toast-close { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 2px; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- Page Header --- */
.page-header {
  display: flex; align-items: center; gap: var(--s3);
  margin-bottom: var(--s4); padding-top: var(--s2);
}
.page-title {
  display: flex; align-items: center; gap: var(--s2);
  font-family: 'Lexend', sans-serif; font-size: var(--fs-lg); font-weight: 700;
  flex: 1;
}
.page-title .material-icons-round { color: var(--pk-blue); }

/* --- Section Header --- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s3);
}
.section-title {
  font-size: var(--fs-base); font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 1px;
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2);
}
.stat-card {
  text-align: center; padding: var(--s3) var(--s2);
}
.stat-num {
  display: block; font-family: 'Lexend', sans-serif;
  font-size: var(--fs-xl); font-weight: 800; color: var(--pk-blue);
  line-height: 1;
}
.stat-label {
  display: block; font-size: 9px; color: var(--text-3);
  margin-top: 4px; font-weight: 500; text-transform: uppercase;
}

/* --- Pokémon Grid --- */
.pokemon-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3);
}
.pokemon-card {
  padding: 0; overflow: hidden; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pokemon-card:active { transform: scale(0.97); }
.pokemon-card-img {
  width: 100%; height: 110px; object-fit: contain;
  background: linear-gradient(135deg, rgba(79,195,247,0.08), rgba(206,147,216,0.05));
  padding: var(--s3);
}
.pokemon-card-img-ph {
  width: 100%; height: 110px;
  background: linear-gradient(135deg, rgba(79,195,247,0.08), rgba(206,147,216,0.05));
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.pokemon-card-img-ph .material-icons-round { font-size: 40px; }
.pokemon-card-body { padding: var(--s3); }
.pokemon-card-name { font-weight: 700; font-size: var(--fs-sm); color: var(--text-1); text-transform: capitalize; }
.pokemon-card-meta { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }

/* --- User List --- */
.user-list-item {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); margin-bottom: var(--s2);
  transition: all 0.2s;
}
.user-list-item:hover { background: var(--glass-hover); }
.user-list-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--glass-border); flex-shrink: 0; }
.user-list-avatar-ph {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--pk-blue), var(--pk-purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-base); color: #fff;
}
.user-list-info { flex: 1; min-width: 0; }
.user-list-name { font-weight: 600; font-size: var(--fs-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-list-meta { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.user-list-actions { display: flex; gap: var(--s2); flex-shrink: 0; }

/* --- Autocomplete --- */
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: rgba(13,18,37,0.98); border: 1px solid var(--glass-border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  backdrop-filter: blur(20px); max-height: 280px; overflow-y: auto;
}
.autocomplete-item {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); cursor: pointer; transition: background 0.15s;
  font-size: var(--fs-sm); text-transform: capitalize;
}
.autocomplete-item:hover { background: var(--glass-hover); }

/* --- Filter Chips --- */
.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: var(--s2) var(--s3); border-radius: 20px;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-2); font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
  font-family: 'Lexend', sans-serif;
}
.filter-chip.active, .filter-chip:active {
  background: rgba(79,195,247,0.2); border-color: var(--pk-blue); color: var(--pk-blue);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-content {
  width: 100%; max-width: 480px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--s5); max-height: 90dvh; overflow-y: auto;
  animation: slideUp 0.3s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s4); }
.modal-title { font-size: var(--fs-lg); font-weight: 700; text-transform: capitalize; }
.modal-footer { margin-top: var(--s4); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* --- Chat --- */
.chat-bubble {
  max-width: 75%; padding: var(--s3) var(--s4);
  border-radius: var(--radius); margin-bottom: var(--s2);
  font-size: var(--fs-base); line-height: 1.5;
  word-break: break-word;
}
.chat-bubble-mine {
  background: linear-gradient(135deg, rgba(79,195,247,0.3), rgba(33,150,243,0.2));
  border: 1px solid rgba(79,195,247,0.3);
  margin-left: auto; border-bottom-right-radius: 4px;
}
.chat-bubble-other {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}
.chat-time { font-size: 9px; color: var(--text-3); margin-top: 2px; }
.chat-input-area {
  position: fixed; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
  left: 0; right: 0; z-index: 50;
  background: rgba(10,14,26,0.95); backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: var(--s3) var(--s4);
}

/* --- Auth Pages --- */
.auth-container {
  width: 100%; max-width: 400px; padding: var(--s5) var(--s4);
}
.auth-logo {
  text-align: center; margin-bottom: var(--s6);
}
.auth-logo-icon { font-size: 56px; display: block; margin-bottom: var(--s3); }
.auth-logo-title {
  font-family: 'Lexend', sans-serif; font-size: var(--fs-xl); font-weight: 800;
  background: linear-gradient(135deg, var(--pk-blue), var(--pk-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo-sub { font-size: var(--fs-sm); color: var(--text-3); margin-top: var(--s1); }

/* --- Spinner --- */
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--pk-blue);
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: var(--s8) var(--s4);
}
.empty-icon { font-size: 56px; margin-bottom: var(--s4); }
.empty-state h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--s2); }
.empty-state p { color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--s5); }

/* --- Animações --- */
.slide-up { animation: slideUpAnim 0.4s ease both; }
@keyframes slideUpAnim { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.delay-1 { animation-delay: 0.05s; } .delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; } .delay-4 { animation-delay: 0.20s; }
.delay-5 { animation-delay: 0.25s; }

/* --- Utilitários --- */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s2); } .gap-3 { gap: var(--s3); }
.mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); }
.mb-4 { margin-bottom: var(--s4); } .mb-6 { margin-bottom: var(--s6); }
.text-center { text-align: center; }
.text-muted { color: var(--text-2); }
.fw-bold { font-weight: 700; }
.w-100 { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: var(--s4) 0; }
