:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100svh;
  min-height: -webkit-fill-available;
  color: #e6eef8;
  padding-top: var(--sat);
  padding-left: var(--sal);
  padding-right: var(--sar);
  background: #0a0e14;
}

/* Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #0a0e14;
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  color: #fff;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
}

.header-right {
  width: 32px;
}

/* Tab Navigation */
.tabs-container {
  display: flex;
  gap: 0.25rem;
  padding: 0 1rem;
  background: #0d0d0d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab-btn.active {
  color: #f7931a;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #f7931a;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: rgba(13, 17, 23, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover,
.filter-chip.active {
  background: rgba(247, 147, 26, 0.15);
  border-color: #f7931a;
  color: #f7931a;
}

/* Advertiser Card */
.advertiser-card {
  margin: 0.5rem 1rem;
  padding: 1rem;
  background: rgba(13, 17, 23, 0.9) !important;
  border: 1px solid rgba(48, 54, 61, 0.6);
  border-radius: 12px;
}

.advertiser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.advertiser-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.advertiser-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7931a 0%, #ff6b00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
}

.advertiser-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.9375rem;
}

.advertiser-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 4px;
  font-size: 0.6875rem;
  color: #10b981;
  margin-top: 0.25rem;
}

.verified-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.advertiser-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.trade-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.trade-detail-item {
  font-size: 0.75rem;
}

.trade-detail-label {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.25rem;
}

.trade-detail-value {
  color: #fff;
  font-weight: 500;
}

.price-value {
  color: #10b981;
  font-size: 1rem;
  font-weight: 600;
}

.trade-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.payment-methods {
  display: flex;
  gap: 0.375rem;
}

.payment-tag {
  padding: 0.25rem 0.5rem;
  background: rgba(13, 17, 23, 0.9) !important;
  border-radius: 4px;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.7);
}

.trade-btn {
  padding: 0.5rem 1.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.buy-btn {
  background: #10b981;
  color: #fff;
}

.buy-btn:hover {
  background: #059669;
}

.sell-btn {
  background: #ef4444;
  color: #fff;
}

.sell-btn:hover {
  background: #dc2626;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: rgba(13, 17, 23, 0.9) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.empty-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  max-width: 280px;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0;
  padding-bottom: max(0.5rem, var(--sab));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.6875rem;
  transition: color 0.2s;
}

.nav-item.active {
  color: #f7931a;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

/* Safe area padding for content */
.content-wrapper {
  padding-bottom: calc(80px + var(--sab));
}