﻿:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #f8fafc;
  --card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
  --input-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --bg: #0f172a;
    --card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg:
      0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -2px rgb(0 0 0 / 0.2);
    --input-bg: #020617;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Navbar */
.navbar {
  width: 100%;
  max-width: 1200px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  background: transparent;
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  max-width: 800px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 20px;
  line-height: 1.1;
  letter-spacing: -1px;
}

.hero h1 span {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.project-sponsor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 12px 8px 14px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(20, 184, 166, 0.06)),
    var(--card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.project-sponsor-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex: 0 0 auto;
}

.project-sponsor img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  padding: 3px;
  flex: 0 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.btn-outline {
  background: var(--card);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg);
}

.btn-sm {
  padding: 10px 20px;
}

.nav-docs-link {
  margin-left: 10px;
}

/* Live Price Section */
.price-container {
  width: 100%;
  max-width: 1100px;
  padding: 0 20px 80px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  /* border: 1px solid rgba(226, 232, 240, 0.6); */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.price-board {
  gap: 24px;
}

.price-summary {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 4px;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.price-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.08), transparent 42%),
    var(--input-bg);
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.price-card.silver {
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.1), transparent 44%),
    var(--input-bg);
}

.metal-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.metal-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.metal-name strong {
  color: var(--text-main);
  font-size: 16px;
}

.metal-name span {
  color: var(--text-muted);
  font-size: 13px;
}

.metal-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #1f2937;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.metal-icon.gold {
  background: linear-gradient(135deg, #facc15, #f59e0b);
}

.metal-icon.silver {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
}

.price-value {
  color: var(--text-main);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.price-value.loading {
  color: var(--text-muted);
  font-size: 24px;
}

.price-meta {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.price-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.price-refresh {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.refresh-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.price-error {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  display: none;
}

.section-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text-main);
  transition: all 0.2s;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family:
    "ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
  line-height: 1.5;
}

.row {
  display: flex;
  gap: 16px;
}

.col {
  flex: 1;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* Response Area */
.response-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.response-area {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  font-family:
    "ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
  flex: 1;
  min-height: 200px;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.response-area::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.response-area::-webkit-scrollbar-thumb {
  background-color: #334155;
  border-radius: 4px;
}

.status-badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  width: 100%;
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--card);
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
  .price-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 36px;
  }
}

.online-users {
  width: 100%;
  max-width: 1100px;
  padding: 0 20px 32px;
}

.online-card {
  background: var(--card);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  position: relative;
}

.online-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(99, 102, 241, 0.07), transparent 42%);
  pointer-events: none;
}

.online-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
  width: 100%;
}

.online-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.online-title-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.online-title-text strong {
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.2;
}

.online-title-text span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.live-count-badge {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.online-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.online-scroll-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
}

.online-scroll-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.25;
}

.online-scroll-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .online-scroll-btn {
    background: rgba(15, 23, 42, 0.48);
  }
}

.pulse {
  width: 11px;
  height: 11px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse 2s infinite;
  flex: 0 0 auto;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.user-list {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 14px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.user-list::-webkit-scrollbar {
  display: none;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  flex: 0 0 260px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  transition: all 0.2s ease;
  scroll-snap-align: start;
}

@media (prefers-color-scheme: dark) {
  .user-item {
    background: rgba(15, 23, 42, 0.42);
    border-color: rgba(51, 65, 85, 0.8);
  }
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #0f766e, var(--primary));
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
  text-transform: uppercase;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.user-location {
  color: var(--text-main);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  min-width: 0;
}

.user-meta img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.user-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.city-tag {
  color: var(--primary);
  font-weight: 600;
  font-size: 12px;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.online-state {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  min-width: 100%;
  flex: 0 0 100%;
}

@media (max-width: 640px) {
  .project-sponsor {
    border-radius: 12px;
    padding: 10px 12px;
  }

  .project-sponsor span {
    text-align: left;
  }

  .price-card {
    padding: 18px;
  }

  .price-value {
    font-size: 28px;
  }

  .online-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .online-actions {
    width: 100%;
    justify-content: space-between;
  }

  .online-card {
    padding: 18px;
  }

  .user-item {
    min-width: 245px;
    flex-basis: 245px;
  }
}
