/* ─── PK Lookup — Premium Dark Theme ─── */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f35;
  --bg-card-hover: #1f2642;
  --bg-input: #0f1425;
  --border: #2a3150;
  --border-focus: #10b981;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.15);
  --accent-hover: #34d399;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-accent {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.usage-pill {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 60px 24px 30px;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(16, 185, 129, 0.08), transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
  line-height: 1.15;
}

.gradient-text {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto 32px;
}

/* ─── Search Card ─── */
.search-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: border-color var(--transition);
}

.search-card:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-glow);
}

/* ─── Tabs ─── */
.search-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.tab.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Search Input ─── */
.search-input-wrap {
  display: flex;
  gap: 10px;
}

.search-input-wrap input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}

.search-input-wrap input::placeholder {
  color: var(--text-muted);
}

.search-input-wrap input:focus {
  border-color: var(--accent);
}

#searchBtn {
  padding: 14px 28px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

#searchBtn:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

#searchBtn:active {
  transform: translateY(0);
}

#searchBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.search-hints {
  margin-top: 10px;
  text-align: left;
}

#hintText {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ─── Results ─── */
.results-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.results-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* ─── Table ─── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(42, 49, 80, 0.5);
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(16, 185, 129, 0.03);
}

td:nth-child(1) {
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 40px;
}

td:nth-child(2) {
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td:nth-child(5) {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.page-btn {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── No Results ─── */
.no-results {
  text-align: center;
  padding: 50px 20px;
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.no-results h3 {
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.no-results p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Error Toast ─── */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
  z-index: 200;
  animation: slideUp 0.3s ease;
}

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

.error-toast button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.8;
}

/* ─── Limit Modal ─── */
.limit-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.limit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.limit-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.limit-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.limit-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.limit-sub {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 20px !important;
}

.limit-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

.limit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

/* ─── Footer ─── */
footer {
  margin-top: auto;
  text-align: center;
  padding: 30px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-small {
  font-size: 0.75rem;
  margin-top: 4px;
  opacity: 0.6;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    gap: 10px;
  }

  .header-stats {
    flex-wrap: wrap;
    justify-content: center;
  }

  .search-tabs {
    flex-wrap: wrap;
  }

  .tab {
    flex: 1 1 45%;
  }

  .search-input-wrap {
    flex-direction: column;
  }

  #searchBtn {
    justify-content: center;
  }

  th, td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  td:nth-child(5) {
    font-size: 0.75rem;
  }
}
