/* ============================================
   PolyBet - USDT Prediction Market
   Pure CSS (no Tailwind, no framework)
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --brand-dark: #0B0E14;
  --brand-card: #151921;
  --brand-border: #232936;
  --brand-yes: #10B981;
  --brand-yes-hover: #059669;
  --brand-no: #F43F5E;
  --brand-no-hover: #E11D48;
  --brand-usdt: #26A17B;
  --brand-accent: #6366F1;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-usdt: 0 10px 15px -3px rgba(16, 185, 129, 0.2);

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--brand-dark);
  color: var(--slate-100);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input { font: inherit; }
img, svg { display: block; }

/* --- Utility: Scrollbar Hide --- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --- Utility: Animations --- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* --- Utility: Line Clamp --- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Utility: Gradient Text --- */
.gradient-text {
  background: linear-gradient(to right, var(--emerald-400), var(--indigo-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Layout --- */
.container {
  max-width: 80rem; /* 1280px = max-w-7xl */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .container { padding-left: 2rem; padding-right: 2rem; }
}

/* --- Navigation --- */
.nav {
  border-bottom: 1px solid var(--brand-border);
  background-color: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(to top right, var(--brand-usdt), var(--emerald-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: white;
  font-size: 1.125rem;
}

.nav-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: white;
}

.nav-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  background-color: rgba(38, 161, 123, 0.2);
  color: var(--brand-usdt);
  border: 1px solid rgba(38, 161, 123, 0.3);
  font-family: var(--font-mono);
}

.nav-wallet {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wallet-display {
  background-color: var(--slate-900);
  border: 1px solid var(--brand-border);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.wallet-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--brand-usdt);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.wallet-label { color: var(--slate-400); }
.wallet-balance { color: var(--emerald-400); font-weight: 700; }

/* --- Main Content --- */
.main-content {
  padding-top: 2rem;
  padding-bottom: 2rem;
  width: 100%;
  flex-grow: 1;
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 2rem 0;
  max-width: 48rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .hero { padding: 3rem 0; }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .hero-title { font-size: 3rem; }
}

.hero-title .usdt-highlight { color: var(--brand-usdt); }

.hero-subtitle {
  color: var(--slate-400);
  font-size: 0.875rem;
  max-width: 36rem;
  margin: 0 auto 1.5rem;
}

@media (min-width: 640px) {
  .hero-subtitle { font-size: 1rem; }
}

/* --- Search Box --- */
.search-box {
  position: relative;
  max-width: 28rem;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  background-color: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-xl);
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  font-size: 0.875rem;
  color: var(--slate-200);
  transition: border-color 0.2s;
  outline: none;
}

.search-input::placeholder { color: var(--slate-500); }
.search-input:focus { border-color: var(--brand-accent); }

.search-icon {
  width: 1rem;
  height: 1rem;
  color: var(--slate-500);
  position: absolute;
  left: 0.875rem;
  top: 0.875rem;
}

/* --- Category Tabs --- */
.tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--brand-border);
}

.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  color: var(--slate-400);
}

.tab-btn:hover { background-color: rgba(30, 41, 59, 0.5); }

.tab-btn.active-tab {
  background-color: var(--slate-800);
  color: white;
  border: 1px solid var(--brand-border);
}

/* --- Cards Grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Market Card --- */
.market-card {
  background-color: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.market-card:hover { border-color: var(--slate-600); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-category {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
}

.card-category--ai {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--indigo-400);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.card-category--crypto {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.card-category--macro {
  background-color: rgba(14, 165, 233, 0.1);
  color: var(--sky-400);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.card-category--pop {
  background-color: rgba(236, 72, 153, 0.1);
  color: var(--pink-400);
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.card-pool {
  font-size: 0.75rem;
  color: var(--slate-500);
  font-family: var(--font-mono);
}

.card-title {
  font-weight: 700;
  color: var(--slate-100);
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* --- Probability Bar --- */
.prob-section { margin-bottom: 1rem; }

.prob-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 0.375rem;
}

.prob-yes { color: var(--brand-yes); }
.prob-no { color: var(--brand-no); }

.prob-bar {
  width: 100%;
  background-color: var(--slate-800);
  border-radius: var(--radius-full);
  height: 0.5rem;
  display: flex;
  overflow: hidden;
}

.prob-bar-yes {
  background-color: var(--brand-yes);
  height: 100%;
}

.prob-bar-no {
  background-color: var(--brand-no);
  height: 100%;
}

/* --- Bet Buttons --- */
.bet-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.bet-btn {
  width: 100%;
  padding: 0.625rem 0;
  border-radius: var(--radius-xl);
  font-weight: 700;
  font-size: 0.75rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.bet-btn--yes {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--brand-yes);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bet-btn--yes:hover {
  background-color: var(--brand-yes);
  color: white;
}

.bet-btn--no {
  background-color: rgba(244, 63, 94, 0.1);
  color: var(--brand-no);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.bet-btn--no:hover {
  background-color: var(--brand-no);
  color: white;
}

/* --- How It Works Section --- */
.how-it-works {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--brand-border);
}

.how-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: white;
  margin-bottom: 2rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
}

.step-card {
  background-color: rgba(21, 25, 33, 0.5);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-border);
}

.step-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 0.75rem;
}

.step-number--1 {
  background-color: rgba(38, 161, 123, 0.1);
  color: var(--brand-usdt);
  border: 1px solid rgba(38, 161, 123, 0.2);
}

.step-number--2 {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--indigo-400);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.step-number--3 {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.step-title {
  font-weight: 700;
  color: var(--slate-200);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.step-desc {
  font-size: 0.75rem;
  color: var(--slate-400);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--brand-border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--slate-500);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background-color: var(--brand-card);
  border: 1px solid var(--brand-border);
  width: 100%;
  max-width: 28rem;
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  box-shadow: var(--shadow-2xl);
}

.modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  color: var(--slate-400);
  font-size: 1.125rem;
  transition: color 0.2s;
}

.modal-close:hover { color: white; }

.modal-section { margin-bottom: 1rem; }

.modal-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.modal-badge--yes {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.modal-badge--no {
  background-color: rgba(244, 63, 94, 0.2);
  color: var(--rose-400);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.modal-title {
  font-weight: 700;
  color: var(--slate-100);
  font-size: 1rem;
  line-height: 1.375;
}

/* --- USDT Amount Panel --- */
.usdt-panel {
  background-color: rgba(15, 23, 42, 0.8);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--brand-border);
}

.usdt-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--slate-400);
  margin-bottom: 0.75rem;
}

.usdt-panel-price {
  font-family: var(--font-mono);
  color: var(--slate-200);
}

.usdt-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.usdt-preset-btn {
  padding: 0.375rem 0;
  border-radius: var(--radius-sm);
  background-color: var(--slate-800);
  color: var(--slate-300);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background-color 0.2s;
  border: 1px solid var(--slate-700);
}

.usdt-preset-btn:hover { background-color: var(--slate-700); }

.usdt-input-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.usdt-input {
  width: 100%;
  background-color: var(--brand-dark);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-xl);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--slate-100);
  font-family: var(--font-mono);
  outline: none;
}

.usdt-input:focus { border-color: var(--brand-usdt); }

.usdt-input-suffix {
  position: absolute;
  right: 0.75rem;
  top: 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-usdt);
}

.usdt-stats {
  padding-top: 0.5rem;
  border-top: 1px solid var(--slate-800);
}

.usdt-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.usdt-stat-row + .usdt-stat-row { margin-top: 0.25rem; }

.usdt-stat-label { color: var(--slate-400); }
.usdt-stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--slate-200);
}
.usdt-stat-value--highlight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--emerald-400);
  font-size: 0.875rem;
}

/* --- Form --- */
.lead-form { display: flex; flex-direction: column; gap: 0.75rem; }

.form-group { display: flex; flex-direction: column; }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-300);
  margin-bottom: 0.25rem;
}

.form-input {
  width: 100%;
  background-color: var(--slate-900);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-xl);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--slate-100);
  outline: none;
}

.form-input::placeholder { color: var(--slate-500); }
.form-input:focus { border-color: var(--brand-usdt); }

.form-submit {
  width: 100%;
  padding: 0.75rem 0;
  border-radius: var(--radius-xl);
  background-color: var(--brand-usdt);
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-usdt);
}

.form-submit:hover { background-color: var(--brand-yes-hover); }

/* --- Success State --- */
.success-container { text-align: center; padding: 1.5rem 0; }
.success-container.hidden { display: none; }

.success-icon {
  width: 3rem;
  height: 3rem;
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 0.75rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.success-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.25rem;
}

.success-desc {
  font-size: 0.75rem;
  color: var(--slate-400);
  margin-bottom: 1.5rem;
}

.success-close-btn {
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-xl);
  background-color: var(--slate-800);
  color: var(--slate-200);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background-color 0.2s;
}

.success-close-btn:hover { background-color: var(--slate-700); }
