
/* ===== Pokémon Theme - Pikachu & Charmander ===== */
/* Colors: Yellow (#FFD700), Blue (#4A90D9), Green (#5CB85C), White */

:root {
  --pixel-font: 'Press Start 2P', monospace;
  /* Pikachu Yellow */
  --pika-gold: #FFD700;
  --pika-orange: #FFA500;
  --pika-light: #FFF8E1;
  --pika-dark: #E6A800;
  /* Blue */
  --blue-sky: #4A90D9;
  --blue-light: #E3F2FD;
  --blue-dark: #357ABD;
  /* Green (Grass) */
  --green-grass: #5CB85C;
  --green-light: #E8F5E9;
  --green-dark: #449D44;
  /* Charmander */
  --char-orange: #FF7043;
  --char-red: #FF5252;
  --char-fire: #FFB300;
  /* Neutrals */
  --bg: #FFFDE7;
  --bg-card: #FFFFFF;
  --text: #3E2723;
  --text-light: #795548;
  --border: #FFE082;
  --shadow: #FFE0B2;
  --pixel-size: 4px;
}

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

body {
  font-family: 'Press Start 2P', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  image-rendering: pixelated;
  font-size: 11px;
  line-height: 1.8;
  background-image:
    radial-gradient(ellipse at 10% 20%, rgba(255,215,0,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 30%, rgba(74,144,217,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(92,184,92,0.06) 0%, transparent 50%);
}

/* ===== Pixel Border ===== */
.pixel-border {
  border: var(--pixel-size) solid var(--border);
  box-shadow:
    inset calc(var(--pixel-size) * -1) calc(var(--pixel-size) * -1) 0 0 var(--shadow),
    inset var(--pixel-size) var(--pixel-size) 0 0 rgba(255,255,255,0.6);
}

/* ===== Buttons ===== */
.pixel-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 12px 24px;
  border: var(--pixel-size) solid;
  cursor: pointer;
  transition: all 0.08s linear;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
}

.pixel-btn:active {
  transform: translate(3px, 3px);
  box-shadow: none !important;
}

.pixel-btn:disabled,
.pixel-btn.is-loading {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

/* Pikachu Yellow Button */
.pixel-btn-primary {
  background: linear-gradient(180deg, var(--pika-gold) 0%, var(--pika-dark) 100%);
  border-color: var(--pika-dark);
  box-shadow: 0 var(--pixel-size) 0 0 var(--pika-dark), 0 6px 20px rgba(255,215,0,0.3);
  color: var(--text);
  text-shadow: none;
}
.pixel-btn-primary:hover {
  background: linear-gradient(180deg, var(--pika-dark) 0%, #CC9600 100%);
}

/* Blue Button */
.pixel-btn-secondary {
  background: linear-gradient(180deg, var(--blue-sky) 0%, var(--blue-dark) 100%);
  border-color: var(--blue-dark);
  box-shadow: 0 var(--pixel-size) 0 0 var(--blue-dark), 0 6px 20px rgba(74,144,217,0.3);
}
.pixel-btn-secondary:hover {
  background: linear-gradient(180deg, var(--blue-dark) 0%, #2A5F8A 100%);
}

/* Green Grass Button */
.pixel-btn-success {
  background: linear-gradient(180deg, var(--green-grass) 0%, var(--green-dark) 100%);
  border-color: var(--green-dark);
  box-shadow: 0 var(--pixel-size) 0 0 var(--green-dark), 0 6px 20px rgba(92,184,92,0.3);
}
.pixel-btn-success:hover {
  background: linear-gradient(180deg, var(--green-dark) 0%, #2D7A2D 100%);
}

/* Charmander Fire Button */
.pixel-btn-danger {
  background: linear-gradient(180deg, var(--char-red) 0%, #D32F2F 100%);
  border-color: #D32F2F;
  box-shadow: 0 var(--pixel-size) 0 0 #D32F2F, 0 6px 20px rgba(255,82,82,0.3);
}

/* Warning / Orange */
.pixel-btn-warning {
  background: linear-gradient(180deg, var(--char-orange) 0%, #E64A19 100%);
  border-color: #E64A19;
  box-shadow: 0 var(--pixel-size) 0 0 #E64A19, 0 6px 20px rgba(255,112,67,0.3);
}

.pixel-btn-sm {
  padding: 8px 14px;
  font-size: 9px;
}

/* ===== Input ===== */
.pixel-input {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 10px 14px;
  background: #fff;
  border: 3px solid var(--border);
  outline: none;
  width: 100%;
  color: var(--text);
  transition: border-color 0.2s;
}

.pixel-input:focus {
  border-color: var(--pika-gold);
  background: #FFFDE7;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.15);
}

.pixel-input::placeholder {
  color: #BCAAA4;
  font-size: 9px;
}

/* ===== Card ===== */
.pixel-card {
  background: var(--bg-card);
  border: var(--pixel-size) solid var(--border);
  padding: 24px;
  box-shadow: 6px 6px 0 0 var(--shadow);
  position: relative;
}

.pixel-card::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  height: 5px;
  background: linear-gradient(90deg, var(--pika-gold), var(--blue-sky), var(--green-grass), var(--char-orange));
  z-index: 1;
}

/* ===== Layout ===== */
.app-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}

/* ===== Header ===== */
.header {
  text-align: center;
  padding: 24px 20px 16px;
  position: relative;
  background: linear-gradient(180deg, rgba(255,215,0,0.06) 0%, transparent 100%);
  border-bottom: 3px solid var(--border);
  margin-bottom: 20px;
}

.pika-ear {
  position: absolute;
  width: 28px;
  height: 28px;
  top: 8px;
  z-index: 0;
}
.pika-ear-left {
  left: 30px;
  border-bottom: 14px solid var(--pika-gold);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  transform: rotate(-20deg);
}
.pika-ear-left::after {
  content: '';
  position: absolute;
  top: 4px;
  left: -3px;
  width: 12px;
  height: 12px;
  background: #3E2723;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  transform: rotate(-20deg);
}
.pika-ear-right {
  right: 30px;
  border-bottom: 14px solid var(--pika-gold);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  transform: rotate(20deg);
}
.pika-ear-right::after {
  content: '';
  position: absolute;
  top: 4px;
  right: -3px;
  width: 12px;
  height: 12px;
  background: #3E2723;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  transform: rotate(20deg);
}

.header h1 {
  font-size: 18px;
  color: var(--text);
  text-shadow: 3px 3px 0 rgba(255,215,0,0.3);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.header .subtitle {
  font-size: 10px;
  color: var(--text-light);
}

/* Pikachu face decoration */
.pika-face {
  display: inline-block;
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(2px 2px 0 rgba(255,215,0,0.3));
  animation: pika-bounce 2s ease-in-out infinite;
}

@keyframes pika-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Sparkle / star decorations */
.sparkle {
  position: absolute;
  font-size: 18px;
  animation: sparkle 2.5s ease-in-out infinite;
  z-index: 1;
}
.sparkle-1 { top: 6px; left: 8%; animation-delay: 0s; }
.sparkle-2 { top: 2px; right: 12%; animation-delay: 0.6s; }
.sparkle-3 { bottom: 2px; left: 15%; animation-delay: 1.2s; }
.sparkle-4 { bottom: 6px; right: 8%; animation-delay: 1.8s; }

/* Charmander flame */
.char-flame {
  position: absolute;
  font-size: 22px;
  animation: flame-dance 1.5s ease-in-out infinite;
  z-index: 1;
  filter: drop-shadow(0 0 4px rgba(255,112,67,0.4));
}
.char-flame-1 { bottom: -4px; right: 12%; animation-delay: 0s; }
.char-flame-2 { top: 4px; left: 20%; animation-delay: 0.8s; }

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.25) rotate(12deg); opacity: 1; }
}

@keyframes flame-dance {
  0%, 100% { transform: scale(1) rotate(-5deg); opacity: 0.8; }
  25% { transform: scale(1.15) rotate(3deg); opacity: 1; }
  50% { transform: scale(0.95) rotate(-8deg); opacity: 0.7; }
  75% { transform: scale(1.1) rotate(5deg); opacity: 0.9; }
}

/* ===== Navigation ===== */
.nav-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-bar .pixel-btn {
  flex: 1;
  max-width: 200px;
  min-width: 100px;
}

/* ===== Form ===== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.form-row {
  display: flex;
  gap: 12px;
}
.form-row > * { flex: 1; }

/* ===== Page ===== */
.page { display: none; }
.page.active {
  display: block;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Auth ===== */
.auth-container {
  max-width: 420px;
  margin: 20px auto;
}
.auth-container .pixel-card { text-align: center; }
.auth-title {
  font-size: 16px;
  margin-bottom: 20px;
  color: var(--text);
}
.auth-switch {
  margin-top: 14px;
  font-size: 10px;
  color: var(--text-light);
}
.auth-switch a {
  color: var(--blue-sky);
  cursor: pointer;
  text-decoration: underline;
  font-weight: bold;
}

/* ===== Dashboard ===== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.dashboard-header h2 { font-size: 14px; }
.dashboard-tools {
  margin-bottom: 12px;
}
.dashboard-tools .pixel-input {
  max-width: 320px;
}

.auto-sync-status {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 2px dashed var(--border);
  font-size: 9px;
  color: var(--text-light);
  background: #fffdf3;
}

/* Account card */
.account-card {
  background: linear-gradient(135deg, #FFFDE7 0%, #FFFFFF 100%);
  border: 3px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 4px 4px 0 var(--shadow);
  flex-wrap: wrap;
  gap: 10px;
  transition: box-shadow 0.2s;
}
.account-card:hover {
  box-shadow: 6px 6px 0 var(--shadow);
}

.account-card .info { flex: 1; min-width: 180px; }
.account-card .phone {
  font-size: 12px;
  margin-bottom: 5px;
  font-weight: bold;
}
.account-card .range {
  font-size: 10px;
  color: var(--text-light);
}
.account-card .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== Badge ===== */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 8px;
  border: 2px solid;
  margin-left: 6px;
}
.badge-success { border-color: var(--green-dark); color: #2E7D32; }
.badge-warning { border-color: var(--pika-gold); color: #8D6E00; }
.badge-danger  { border-color: var(--char-red); color: #C62828; }
.badge-info    { border-color: var(--blue-sky); color: #1565C0; }

/* ===== Admin ===== */
.admin-section { margin-bottom: 24px; }
.admin-section h3 {
  font-size: 13px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 3px dashed var(--border);
}
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 2px solid var(--shadow);
  flex-wrap: wrap;
  gap: 8px;
}
.user-row:last-child { border-bottom: none; }

/* ===== Logs ===== */
.log-item {
  padding: 10px 12px;
  border-bottom: 2px solid var(--shadow);
  font-size: 10px;
}
.log-item:last-child { border-bottom: none; }
.log-item .log-phone { font-size: 11px; margin-bottom: 4px; }
.log-item .log-meta { color: var(--text-light); font-size: 9px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(62,39,35,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}
.modal-content {
  max-width: 520px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-content .pixel-card { position: relative; }
.modal-close {
  position: absolute;
  top: 10px; right: 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-light);
  background: none;
  border: none;
  z-index: 2;
  padding: 4px;
}
.modal-close:hover { color: var(--char-red); }

/* ===== Pokeball ===== */
.pokeball {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid #555;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--char-red) 50%, white 50%);
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
  margin-right: 6px;
}
.pokeball::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  background: white;
  border: 2px solid #555;
  border-radius: 50%;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-light);
}
.empty-state .emoji-big { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 10px; line-height: 2; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 12px 28px;
  border: 3px solid;
  background: var(--bg-card);
  box-shadow: 5px 5px 0 var(--shadow);
  animation: slideDown 0.25s ease;
  max-width: 92%;
  text-align: center;
  line-height: 1.6;
}
.toast-success { border-color: var(--green-grass); }
.toast-error   { border-color: var(--char-red); }
.toast-info    { border-color: var(--blue-sky); }

@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-16px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.stat-box {
  border: 3px solid var(--border);
  padding: 14px;
  text-align: center;
  background: linear-gradient(135deg, #FFFDE7 0%, #fff 100%);
}
.stat-box .stat-label { font-size: 9px; color: var(--text-light); }
.stat-box .stat-value { font-size: 18px; margin-top: 4px; font-weight: bold; }

/* ===== Settings Grid ===== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ===== Range Input ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  background: var(--pika-light);
  border: 2px solid var(--border);
  outline: none;
  border-radius: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  background: var(--pika-gold);
  border: 2px solid var(--pika-dark);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow);
  border-radius: 0;
}

/* ===== Decorative Pikachu ===== */
.pika-decoration {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pika-dark);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--shadow); }
::-webkit-scrollbar-thumb {
  background: var(--pika-gold);
  border: 2px solid var(--pika-dark);
}

/* ===== Pokemon Type Badges ===== */
.type-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 8px;
  border: 2px solid;
  border-radius: 0;
  margin: 2px;
}
.type-electric { border-color: var(--pika-gold); background: #FFF8E1; color: #8D6E00; }
.type-fire     { border-color: var(--char-red); background: #FFEBEE; color: #B71C1C; }
.type-water    { border-color: var(--blue-sky); background: #E3F2FD; color: #1565C0; }
.type-grass    { border-color: var(--green-grass); background: #E8F5E9; color: #2E7D32; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .pixel-card { padding: 14px; }
  .header h1 { font-size: 14px; }
  .form-row { flex-direction: column; }
  .nav-bar .pixel-btn { max-width: none; }
  .account-card { flex-direction: column; align-items: stretch; text-align: center; }
  .settings-grid { grid-template-columns: 1fr; }
  .pika-ear, .char-flame { display: none; }
}
