/* Polymarket Clone - Extracted from true-visual-sync React Design */
/* All styles converted from Tailwind to pure CSS */

/* === Global Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Color Variables (from true-visual-sync) === */
:root {
  /* Main Colors */
  --background: #293642;
  --foreground: #f8fafc;

  /* Card Colors */
  --card: #374151;
  --card-foreground: #f8fafc;

  /* Button Colors */
  --primary: #3b82f6;
  --primary-foreground: #f8fafc;

  --secondary: #313c48;
  --secondary-foreground: #f8fafc;

  /* Status Colors */
  --success: #22c55e;
  --success-foreground: #f8fafc;

  --destructive: #ef4444;
  --destructive-foreground: #f8fafc;

  /* Text Colors */
  --muted: #313c48;
  --muted-foreground: #94a3b8;

  /* Borders */
  --border: #3d4956;
  --input: #3d4956;

  /* Radius */
  --radius: 0.5rem;
}

/* === Base Styles === */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Header Styles === */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
}

.header-container {
  max-width: 1536px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Row 1: Top Bar */
.header-top-bar {
  border-bottom: 1px solid var(--border);
}

.header-top-bar .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.logo-section {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-icon {
  height: 8rem;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.usa-flag {
  display: flex;
  height: 1.25rem;
  width: 1.875rem;
  overflow: hidden;
  border-radius: 0.1875rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Main Search */
.main-search-container {
  flex: 1;
  max-width: 28rem;
  margin: 0 2rem;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

.main-search-input {
  width: 100%;
  height: 2.25rem;
  padding: 0 2.5rem 0 2.5rem;
  background-color: rgba(var(--secondary-rgb, 49, 60, 72), 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.main-search-input:focus {
  border-color: var(--primary);
}

.main-search-input::placeholder {
  color: var(--muted-foreground);
}

.search-kbd {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  background-color: rgba(var(--muted-rgb, 49, 60, 72), 0.5);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--muted-foreground);
  font-family: monospace;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === Button Styles === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  outline: none;
}

.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--foreground);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--background);
}

.btn-primary:hover {
  background-color: rgba(59, 130, 246, 0.9);
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

.btn-icon-sm {
  padding: 0;
  width: 2rem;
  height: 2rem;
  background: transparent;
  color: var(--muted-foreground);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.btn-icon-sm:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--foreground);
}

.btn-icon-left {
  margin-right: 0.375rem;
}

/* Row 2: Categories */
.categories-row {
  border-top: 1px solid var(--border);
}

.categories-row .header-container {
  height: 2.75rem;
}

.categories-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories-list::-webkit-scrollbar {
  display: none;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}

.category-btn:hover {
  color: var(--foreground);
}

.category-btn-active {
  font-weight: 500;
  color: var(--foreground);
}

.category-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Row 3: Search & Topics */
.search-topics-row {
  border-top: 1px solid var(--border);
  background-color: rgba(var(--secondary-rgb, 49, 60, 72), 0.2);
}

.search-topics-row .header-container {
  height: 3rem;
}

.search-topics-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
}

/* Small Search */
.small-search-wrapper {
  position: relative;
  width: 12rem;
}

.search-icon-sm {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

.small-search-input {
  width: 100%;
  height: 2rem;
  padding: 0 0.5rem 0 2rem;
  background-color: rgba(var(--secondary-rgb, 49, 60, 72), 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.small-search-input:focus {
  border-color: var(--primary);
}

.small-search-input::placeholder {
  color: var(--muted-foreground);
}

/* Topic Pills */
.topic-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.topic-pills::-webkit-scrollbar {
  display: none;
}

.topic-pill {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  background-color: var(--secondary);
  color: var(--muted-foreground);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.topic-pill:hover {
  background-color: rgba(var(--secondary-rgb, 49, 60, 72), 0.8);
  color: var(--foreground);
}

.topic-pill-active {
  background-color: var(--primary);
  color: var(--background);
  font-weight: 500;
}

/* Row 4: Filters */
.filters-row {
  border-top: 1px solid var(--border);
  background-color: rgba(var(--secondary-rgb, 49, 60, 72), 0.1);
}

.filters-row .header-container {
  height: 2.75rem;
}

.filters-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters-content::-webkit-scrollbar {
  display: none;
}

.filter-option {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  background: transparent;
  color: var(--muted-foreground);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-option:hover {
  color: var(--foreground);
}

.filter-option-active {
  background-color: rgba(var(--secondary-rgb, 49, 60, 72), 0.5);
}

.filter-option-active:hover {
  background-color: var(--secondary);
}

.filter-value {
  font-weight: 500;
}


/* === Main Content === */
.main-content {
  max-width: 1536px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* === Market Grid === */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  max-width: 1400px;
}

/* === Market Card === */
.market-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.market-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Market badge styling */
.market-badge {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: inline-block;
}

/* Timeframe text styling */
.timeframe-text {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-title-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.market-category {
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
  width: fit-content;
}

.market-image {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  object-fit: cover;
}

.volume-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon-container {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--secondary);
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon {
  font-size: 1.25rem;
}

.card-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--foreground);
}

/* === Market Outcomes === */
.outcomes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.outcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.outcome-name {
  font-size: 0.875rem;
  color: var(--foreground);
}

.outcome-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.outcome-percent {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
  min-width: 3rem;
  text-align: center;
}

.outcome-buttons {
  display: flex;
  gap: 0.25rem;
}

.btn-trade {
  padding: 0.375rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-yes {
  background-color: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.btn-yes:hover {
  background-color: rgba(34, 197, 94, 0.3);
}

.btn-no {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--destructive);
}

.btn-no:hover {
  background-color: rgba(239, 68, 68, 0.3);
}

/* === Card Footer === */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(61, 73, 86, 0.5);
}

.volume-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-gift,
.icon-bookmark {
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.2s;
}

.icon-gift:hover,
.icon-bookmark:hover {
  color: var(--foreground);
}

/* === Footer === */
.footer {
  background-color: var(--secondary);
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1536px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.footer-content a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-content a:hover {
  color: var(--foreground);
}

.footer-divider {
  margin: 0 0.5rem;
}

/* === Responsive Design === */
@media (max-width: 1400px) {
  .market-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1050px) {
  .market-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
    height: auto;
    padding: 1rem;
  }

  .search-container {
    order: 3;
    flex: 1 1 100%;
    margin: 0.75rem 0 0 0;
  }

  .filters-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .market-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* === Utility Classes === */
.hidden {
  display: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  scrollbar-width: none;
}

/* === Modal Styles === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: #2c3540;
  border-radius: 1rem;
  padding: 2rem;
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

/* Login Modal */
.login-modal {
  width: 28rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--foreground);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Google Button */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #5b9cf5;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 1.5rem;
}

.btn-google:hover {
  background-color: #4a8ee6;
}

/* Divider */
.modal-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.modal-divider span {
  padding: 0 1rem;
}

/* Email Login */
.email-login-container {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background-color: rgba(100, 116, 139, 0.3);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.email-login-container:focus-within {
  border-color: var(--primary);
}

.modal-email-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background-color: transparent;
  border: none;
  border-radius: 0;
  color: var(--foreground);
  font-size: 0.9375rem;
  outline: none;
}

.modal-email-input::placeholder {
  color: var(--muted-foreground);
}

.btn-continue {
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  color: var(--foreground);
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.btn-continue:hover {
  background-color: rgba(55, 65, 81, 0.5);
}

/* Wallet Options */
.wallet-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.wallet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background-color: rgba(55, 65, 81, 0.5);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.wallet-btn:hover {
  background-color: rgba(55, 65, 81, 0.8);
  border-color: var(--primary);
}

.wallet-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.wallet-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.375rem;
}

.wallet-name {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.modal-link {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.modal-link:hover {
  color: var(--foreground);
}

.modal-dot {
  color: var(--muted-foreground);
}

/* Wallet Loader Modal */
.wallet-loader-modal {
  width: 20rem;
  text-align: center;
}

.wallet-back-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.wallet-back-btn:hover {
  color: var(--foreground);
}

.wallet-loader-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 2rem;
}

.wallet-loader-icon-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem auto;
}

.loading-spinner {
  position: absolute;
  width: 6rem;
  height: 6rem;
  border: 3px solid rgba(59, 130, 246, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.wallet-loader-icon {
  position: relative;
  z-index: 1;
}

.wallet-loader-status {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.wallet-loader-message {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* === Magic Loader Modal === */
.magic-loader-modal {
  width: 26rem;
  min-height: 28rem;
  text-align: center;
  padding: 2rem 2rem 3rem;
  background-color: #1f2937;
  position: relative;
}

.magic-back-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.magic-back-btn:hover {
  color: #f3f4f6;
}

.magic-loader-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2.5rem;
  margin-top: 0.5rem;
}

.magic-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2.5rem;
  position: relative;
  width: 140px;
  height: 140px;
  margin-left: auto;
  margin-right: auto;
}

.magic-spinner {
  position: absolute;
  top: 0;
  left: 0;
  animation: spin 2s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.magic-logo {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 20px rgba(104, 81, 255, 0.5));
}

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

.magic-status {
  margin-top: 1rem;
}

.magic-status-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.magic-status-subtitle {
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.6;
  max-width: 20rem;
  margin: 0 auto;
}

/* === OTP Modal === */
.otp-modal {
  width: 28rem;
  text-align: center;
}

.otp-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.otp-email-icon {
  width: 4rem;
  height: 4rem;
  color: var(--primary);
  stroke-width: 1.5;
}

.otp-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.otp-email {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 2rem;
}

/* OTP Input Boxes */
.otp-input-container {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.otp-input {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  background-color: rgba(55, 65, 81, 0.5);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  color: var(--foreground);
  outline: none;
  transition: all 0.2s;
}

.otp-input:focus {
  border-color: var(--primary);
  background-color: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.otp-input:not(:placeholder-shown) {
  border-color: var(--primary);
}

/* OTP Warning */
.otp-warning {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.otp-warning p {
  font-size: 0.75rem;
  color: var(--foreground);
  line-height: 1.5;
  margin: 0;
}

.otp-warning strong {
  color: var(--destructive);
  font-weight: 700;
}

/* OTP Footer */
.otp-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.otp-footer-text {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.otp-magic-logo {
  height: 1.25rem;
  width: auto;
}

/* Responsive adjustments for OTP Modal */
@media (max-width: 500px) {
  .otp-modal {
    width: 90vw;
    max-width: 24rem;
  }

  .otp-input-container {
    gap: 0.5rem;
  }

  .otp-input {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}

/* === Connection Failed Modal === */
.connection-failed-modal {
  width: 26rem;
  min-height: 20rem;
  text-align: center;
  padding: 2.5rem 2rem;
  background-color: #1f2937;
}

.failed-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.failed-wallet-icon {
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background-color: rgba(55, 65, 81, 0.5);
  position: relative;
}

.failed-wallet-icon img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.5rem;
}

.error-badge {
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background-color: #1f2937;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #1f2937;
}

.failed-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.failed-message {
  font-size: 0.9375rem;
  color: #9ca3af;
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}

.failed-message span {
  color: #ffffff;
  font-weight: 600;
}

.failed-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-try-again,
.btn-manual-connect {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-try-again {
  background-color: #3b82f6;
  color: #ffffff;
}

.btn-try-again:hover {
  background-color: #2563eb;
}

.btn-manual-connect {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: #ffffff;
}

.btn-manual-connect:hover {
  opacity: 0.9;
}

.btn-back-to-login {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back-to-login:hover {
  background-color: rgba(55, 65, 81, 0.3);
  color: #ffffff;
  border-color: #4b5563;
}

/* === Import Wallet Modal === */
.import-wallet-modal {
  width: 28rem;
  min-height: 30rem;
  padding: 2.5rem 2rem;
  background-color: #1f2937;
  position: relative;
}

.import-back-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 10;
}

.import-back-btn:hover {
  color: #f3f4f6;
}

.import-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.import-wallet-icon {
  width: 4.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background-color: rgba(55, 65, 81, 0.5);
  position: relative;
}

.import-wallet-icon img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  border-radius: 0.5rem;
}

.shield-badge {
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background-color: #1f2937;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #1f2937;
}

.import-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin-bottom: 0.5rem;
}

.import-title span {
  color: #6851FF;
}

.import-subtitle {
  font-size: 0.8125rem;
  color: #9ca3af;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Import Tabs */
.import-tabs {
  display: flex;
  border-bottom: 2px solid #374151;
  margin-bottom: 1.5rem;
  gap: 0.25rem;
}

.import-tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #9ca3af;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.import-tab:hover {
  color: #ffffff;
}

.import-tab.active {
  color: #6851FF;
  border-bottom-color: #6851FF;
}

/* Tab Panels */
.import-tab-content {
  margin-bottom: 1.5rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.import-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f3f4f6;
  margin-bottom: 0.5rem;
}

.import-input {
  width: 100%;
  padding: 0.875rem;
  background-color: #293642;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 0.875rem;
  font-family: monospace;
  resize: vertical;
  outline: none;
  transition: all 0.2s;
}

.import-input:focus {
  border-color: #6851FF;
  box-shadow: 0 0 0 3px rgba(104, 81, 255, 0.1);
}

.import-input::placeholder {
  color: #6b7280;
}

.import-input-single {
  width: 100%;
  padding: 0.875rem;
  background-color: #293642;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
}

.import-input-single:focus {
  border-color: #6851FF;
  box-shadow: 0 0 0 3px rgba(104, 81, 255, 0.1);
}

.import-input-single::placeholder {
  color: #6b7280;
}

.word-count-display {
  margin-top: 0.5rem;
  text-align: right;
  font-size: 0.75rem;
  color: #9ca3af;
}

.import-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 0.5rem;
}

.import-warning span {
  font-size: 0.75rem;
  color: #fbbf24;
  line-height: 1.5;
}

.import-warning svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* Connect Button */
.btn-import-connect {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
}

.btn-import-connect:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-import-connect:active {
  transform: translateY(0);
}

.import-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: rgba(55, 65, 81, 0.3);
  border-radius: 0.5rem;
}

.import-security-note span {
  font-size: 0.6875rem;
  color: #9ca3af;
  line-height: 1.4;
}

.import-security-note svg {
  flex-shrink: 0;
}

/* Responsive adjustments for Connection Failed Modal */
@media (max-width: 500px) {
  .connection-failed-modal {
    width: 90vw;
    max-width: 24rem;
    padding: 2rem 1.5rem;
  }

  .failed-icon-container {
    margin-bottom: 1.25rem;
  }

  .failed-wallet-icon {
    width: 4.5rem;
    height: 4.5rem;
  }

  .failed-wallet-icon img {
    width: 3rem;
    height: 3rem;
  }

  .failed-title {
    font-size: 1.25rem;
  }

  .failed-message {
    font-size: 0.875rem;
  }
}

/* Responsive adjustments for Import Wallet Modal */
@media (max-width: 500px) {
  .import-wallet-modal {
    width: 90vw;
    max-width: 24rem;
    padding: 2rem 1.5rem;
  }

  .import-tab {
    padding: 0.625rem 0.25rem;
    font-size: 0.75rem;
  }

  .import-input {
    font-size: 0.8125rem;
    padding: 0.75rem;
  }

  .import-input-single {
    font-size: 0.8125rem;
    padding: 0.75rem;
  }
}

/* === Enhanced Mobile Responsiveness === */
@media (max-width: 768px) {
  /* Header Adjustments */
  .logo-icon {
    height: 6rem;
  }

  .main-search-container {
    max-width: none;
    margin: 0 1rem;
    flex: 1;
  }

  .header-actions {
    gap: 0.25rem;
  }

  .btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
  }

  /* Hide search kbd on mobile */
  .search-kbd {
    display: none;
  }

  /* Categories - make scrollable */
  .categories-list {
    gap: 1rem;
    padding-right: 1rem;
  }

  .category-btn {
    font-size: 0.8125rem;
  }

  /* Topics */
  .topic-pills {
    gap: 0.375rem;
  }

  .topic-pill {
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
  }

  /* Filters */
  .filters-content {
    gap: 0.5rem;
  }

  .filter-option {
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
  }

  /* Main Content */
  .main-content {
    padding: 1rem 0.75rem;
  }

  /* Market Grid */
  .market-grid {
    gap: 0.75rem;
  }

  /* Market Cards */
  .market-card {
    padding: 0.875rem;
    min-height: 180px;
  }

  .card-header {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .card-icon-container {
    width: 2rem;
    height: 2rem;
  }

  .card-icon {
    font-size: 1rem;
  }

  .card-title {
    font-size: 0.9375rem;
  }

  .market-image {
    width: 35px;
    height: 35px;
  }

  /* Outcomes */
  .outcomes-list {
    gap: 0.625rem;
    margin-bottom: 0.75rem;
  }

  .outcome-name {
    font-size: 0.8125rem;
  }

  .outcome-percent {
    font-size: 0.6875rem;
    min-width: 2.75rem;
  }

  .btn-trade {
    padding: 0.3125rem 0.75rem;
    font-size: 0.6875rem;
  }

  /* Card Footer */
  .card-footer {
    padding-top: 0.375rem;
  }

  .volume-text {
    font-size: 0.8125rem;
  }

  .footer-icons {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  /* Full-screen modals on mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-start;
  }

  .modal-content {
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 1.5rem;
  }

  /* Login Modal */
  .login-modal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .wallet-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .wallet-btn {
    padding: 0.875rem 0.375rem;
  }

  .wallet-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .wallet-name {
    font-size: 0.6875rem;
  }

  /* OTP Modal - Full screen */
  .otp-modal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .otp-input-container {
    gap: 0.375rem;
    justify-content: space-between;
    padding: 0 0.5rem;
  }

  .otp-input {
    width: 2.25rem;
    height: 2.75rem;
    font-size: 1.125rem;
  }

  /* Magic Loader - Full screen */
  .magic-loader-modal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
  }

  /* Connection Failed - Full screen */
  .connection-failed-modal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.5rem;
  }

  /* Import Wallet - Full screen */
  .import-wallet-modal {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    overflow-y: auto;
  }

  /* Touch-friendly inputs */
  .main-search-input,
  .small-search-input {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .modal-email-input,
  .import-input,
  .import-input-single {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }

  .btn-continue,
  .btn-google,
  .btn-try-again,
  .btn-manual-connect,
  .btn-import-connect {
    min-height: 48px;
    padding: 0.75rem 1rem;
  }

  /* Header - Compact */
  .header-top-bar .header-container {
    height: auto;
    padding: 0.75rem 0.5rem;
  }

  .logo-icon {
    height: 5rem;
  }

  .logo-text {
    font-size: 1rem;
  }

  .main-search-container {
    margin: 0 0.5rem;
  }

  .categories-row .header-container {
    height: 2.5rem;
  }

  .search-topics-row .header-container {
    height: 2.75rem;
  }

  .filters-row .header-container {
    height: 2.5rem;
  }

  /* Small search - hide on very small screens */
  .small-search-wrapper {
    display: none;
  }

  /* Content padding */
  .main-content {
    padding: 0.75rem 0.5rem;
  }

  /* Market Grid - Full width cards */
  .market-grid {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }

  /* Market Cards */
  .market-card {
    padding: 0.75rem;
  }

  .card-title {
    font-size: 0.875rem;
    line-height: 1.3;
  }

  /* Footer */
  .footer {
    padding: 1rem 0.5rem;
  }

  .footer-content {
    font-size: 0.6875rem;
  }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .modal-content {
    max-height: 100vh;
    overflow-y: auto;
  }

  .otp-modal,
  .magic-loader-modal,
  .connection-failed-modal,
  .import-wallet-modal {
    height: auto;
    min-height: auto;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .market-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }

  .wallet-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* High DPI / Retina screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .market-image,
  .wallet-icon img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .loading-spinner,
  .magic-spinner {
    animation: none;
  }
}
