/* =========================================================
   TopBD - Bangladesh's Live Ranking & Outbid Marketplace
   Main Stylesheet (Vanilla CSS3 with CSS Variables)
   ========================================================= */

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --secondary: #0f172a;
  --secondary-light: #1e293b;
  
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.2);
  
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  --border-subtle: #e2e8f0;
  --border-focus: #cbd5e1;
  
  --card-radius: 16px;
  --btn-radius: 12px;
  --pill-radius: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-rank1: 0 12px 30px -5px rgba(99, 102, 241, 0.22);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------- HEADER ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.logo-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.brand-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--secondary);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--pill-radius);
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--secondary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--border-focus);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-outbid {
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.15s ease;
}

.btn-outbid:hover {
  background: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: translateY(-1px);
}

/* ---------------- HERO SECTION ---------------- */
.hero-section {
  padding: 56px 0 40px 0;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1e40af;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--pill-radius);
  margin-bottom: 20px;
}

.hero-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1.2px;
  color: var(--secondary);
  margin-bottom: 16px;
  line-height: 1.15;
}

.hero-highlight {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 32px auto;
  line-height: 1.6;
}

.hero-cta-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 580px;
  margin: 0 auto;
}

.hero-quick-input-group {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  padding: 4px;
  box-shadow: var(--shadow-md);
  width: 100%;
}

.hero-quick-input-group input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text-main);
  background: transparent;
}

.hero-quick-input-group select {
  border: none;
  outline: none;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
}

/* ---------------- LIVE STATUS BAR ---------------- */
.status-bar-wrapper {
  margin: 24px 0 36px 0;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  padding: 14px 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.status-item-value {
  color: var(--secondary);
  font-weight: 800;
}

/* ---------------- CONTROLS (SEARCH & CATEGORIES) ---------------- */
.controls-section {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  font-size: 15px;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
}

.category-scroll-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-scroll-container::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--pill-radius);
  font-size: 13px;
  font-weight: 700;
  background: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  background: #f1f5f9;
  color: var(--secondary);
}

.cat-pill.active {
  background: var(--secondary);
  color: #ffffff;
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

/* ---------------- LEADERBOARD CARDS ---------------- */
.leaderboard-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 60px;
}

.rank-card {
  display: grid;
  grid-template-columns: 64px 54px 1fr auto auto;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

.rank-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* Rank #1 High Treatment */
.rank-card.rank-1 {
  background: linear-gradient(to right, #ffffff, #faf5ff);
  border: 2px solid #a855f7;
  box-shadow: var(--shadow-rank1);
}

.rank-card.rank-1 .rank-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.rank-badge {
  font-size: 16px;
  font-weight: 900;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--secondary);
}

.rank-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
}

.listing-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.listing-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.listing-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-category-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--pill-radius);
  background: #f1f5f9;
  color: var(--text-muted);
}

.listing-url-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.listing-url-link {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.listing-url-link:hover {
  text-decoration: underline;
}

.listing-stats-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-heart {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #ef4444;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.btn-heart:hover {
  background: #fef2f2;
}

.bid-display-group {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bid-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
}

.bid-amount {
  font-size: 20px;
  font-weight: 900;
  color: var(--secondary);
  letter-spacing: -0.5px;
}

/* ---------------- MODALS ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  transition: all 0.2s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--secondary);
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  font-size: 14px;
  color: var(--text-main);
  background: #ffffff;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------------- HOW IT WORKS & FAQ ---------------- */
.section-wrapper {
  padding: 60px 0;
  border-top: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  color: var(--secondary);
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.step-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  padding: 18px 22px;
}

.faq-question {
  font-size: 16px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 6px;
}

.faq-answer {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------------- FOOTER ---------------- */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 24px 0;
  margin-top: 40px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-bottom {
  text-align: center;
  font-size: 12px;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}
