/* ============================================
   AdFinder Premium Marketplace Theme
   Enhanced UI/UX for Marketplace
   ============================================ */

/* ---------- 1. MARKETPLACE COLOR PALETTE ---------- */
:root {
  /* Marketplace Emerald + Amber palette */
  --market-emerald: #10b981;
  --market-emerald-light: #34d399;
  --market-emerald-dark: #059669;
  --market-amber: #f59e0b;
  --market-amber-light: #fbbf24;
  --market-navy: #0f172a;
  --market-navy-light: #1e293b;
  --market-coral: #f97316;
  
  /* Enhanced neutrals */
  --market-ink: #0f172a;
  --market-ink-muted: #64748b;
  --market-surface: #ffffff;
  --market-surface-elevated: #f8fafc;
  --market-border: #e2e8f0;
  
  /* Shadows */
  --market-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --market-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
  --market-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08);
  --market-shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1);
  
  /* Transitions */
  --market-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 2. HERO SECTION FOR MARKETPLACE ---------- */
.af-market-hero {
  position: relative;
  background: linear-gradient(135deg, 
    rgba(16, 185, 129, 0.08) 0%, 
    rgba(248, 250, 252, 0.95) 50%,
    rgba(245, 158, 11, 0.06) 100%);
  border-radius: 24px;
  padding: 40px 32px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.12);
  box-shadow: var(--market-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.af-market-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.af-market-hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.af-market-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--market-emerald-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.af-market-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--market-navy);
  margin-bottom: 16px;
}

.af-market-hero__title span {
  background: linear-gradient(135deg, var(--market-emerald) 0%, var(--market-emerald-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.af-market-hero__subtitle {
  font-size: 1.125rem;
  color: var(--market-ink-muted);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

/* Compact hero variant */
.af-market-hero--compact {
  padding: 28px 32px;
}

.af-market-hero--compact .af-market-hero__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.af-market-hero--compact .af-market-hero__subtitle {
  font-size: 1rem;
  margin-bottom: 0;
}

/* ---------- 3. CATEGORY CARDS ---------- */
.af-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

@media (min-width: 992px) {
  .af-category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1200px) {
  .af-category-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.af-category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--market-surface);
  border: 1px solid var(--market-border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--market-navy);
  transition: var(--market-transition);
}

.af-category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--market-shadow-lg);
  text-decoration: none;
  color: var(--market-navy);
}

.af-category-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: var(--market-emerald);
  flex-shrink: 0;
}

.af-category-card__label {
  font-weight: 700;
  font-size: 0.9375rem;
}

/* ---------- 4. LISTING CARDS ---------- */
.af-listing-card {
  display: flex;
  flex-direction: column;
  background: var(--market-surface);
  border: 1px solid var(--market-border);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: var(--market-navy);
  transition: var(--market-transition);
  height: 100%;
}

.af-listing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--market-shadow-xl);
  text-decoration: none;
  color: var(--market-navy);
}

.af-listing-card__image {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.af-listing-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.af-listing-card:hover .af-listing-card__image img {
  transform: scale(1.05);
}

.af-listing-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.af-listing-card__badge--premium {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
}

.af-listing-card__badge--featured {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: white;
}

.af-listing-card__badge--urgent {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: white;
}

.af-listing-card__content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.af-listing-card__price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--market-navy);
  margin-bottom: 8px;
}

.af-listing-card__price span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--market-ink-muted);
}

.af-listing-card__title {
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.af-listing-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--market-border);
  font-size: 0.8125rem;
  color: var(--market-ink-muted);
}

.af-listing-card__meta i {
  color: var(--market-emerald);
}

/* ---------- 5. SELLER CARD ---------- */
.af-seller-card {
  background: var(--market-surface);
  border: 1px solid var(--market-border);
  border-radius: 20px;
  padding: 24px;
}

.af-seller-card__avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--market-emerald) 0%, var(--market-emerald-light) 100%);
  color: white;
  margin: 0 auto 16px;
  overflow: hidden;
}

.af-seller-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.af-seller-card__name {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--market-navy);
  text-align: center;
  margin-bottom: 4px;
}

.af-seller-card__username {
  font-size: 0.875rem;
  color: var(--market-ink-muted);
  text-align: center;
  margin-bottom: 16px;
}

.af-seller-card__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--market-border);
  border-bottom: 1px solid var(--market-border);
  margin-bottom: 16px;
}

.af-seller-card__stat {
  text-align: center;
}

.af-seller-card__stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--market-navy);
}

.af-seller-card__stat-label {
  font-size: 0.75rem;
  color: var(--market-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- 6. TRUST ROW ---------- */
.af-trust-row {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
}

@media (min-width: 576px) {
  .af-trust-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.af-trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--market-surface);
  border: 1px solid var(--market-border);
  border-radius: 16px;
  transition: var(--market-transition);
}

.af-trust-item:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--market-shadow);
  transform: translateY(-2px);
}

.af-trust-item__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.af-trust-item:nth-child(1) .af-trust-item__icon {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.af-trust-item:nth-child(2) .af-trust-item__icon {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.af-trust-item:nth-child(3) .af-trust-item__icon {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}

.af-trust-item__title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--market-navy);
}

/* ---------- 7. STATS SECTION ---------- */
.af-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 576px) {
  .af-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.af-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: var(--market-surface);
  border: 1px solid var(--market-border);
  border-radius: 16px;
  text-align: center;
  transition: var(--market-transition);
}

.af-stat-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.af-stat-card__value {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--market-navy) 0%, var(--market-ink-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}

.af-stat-card__label {
  font-size: 0.8125rem;
  color: var(--market-ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- 8. FORM STYLING ---------- */
.af-form-card input[type="text"],
.af-form-card input[type="email"],
.af-form-card input[type="password"],
.af-form-card input[type="number"],
.af-form-card input[type="tel"],
.af-form-card input[type="search"],
.af-form-card textarea,
.af-form-card select {
  border: 1px solid var(--market-border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1rem;
  background: var(--market-surface);
  color: var(--market-navy);
  transition: var(--market-transition);
  width: 100%;
}

.af-form-card input:focus,
.af-form-card textarea:focus,
.af-form-card select:focus {
  outline: none;
  border-color: var(--market-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ---------- 9. BUTTON VARIANTS ---------- */
.btn-market-primary {
  background: linear-gradient(135deg, var(--market-emerald) 0%, var(--market-emerald-light) 100%);
  border: none;
  color: white;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  transition: var(--market-transition);
}

.btn-market-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
  color: white;
}

.btn-market-outline {
  background: var(--market-surface);
  border: 2px solid var(--market-border);
  color: var(--market-navy);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  transition: var(--market-transition);
}

.btn-market-outline:hover {
  border-color: var(--market-emerald);
  color: var(--market-emerald);
}

/* ---------- 10. SECTION HEADERS ---------- */
.af-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.af-section-header__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--market-emerald) 0%, var(--market-emerald-light) 100%);
  color: white;
  font-size: 1rem;
}

.af-section-header__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--market-navy);
  margin: 0;
}

.af-section-header__link {
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--market-emerald);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--market-transition);
}

.af-section-header__link:hover {
  color: var(--market-emerald-dark);
  gap: 10px;
}

/* ---------- 11. EMPTY STATES ---------- */
.af-empty-state {
  text-align: center;
  padding: 60px 20px;
}

.af-empty-state__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.af-empty-state__icon i {
  font-size: 2rem;
  color: var(--market-ink-muted);
}

.af-empty-state__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--market-navy);
  margin-bottom: 8px;
}

.af-empty-state__text {
  color: var(--market-ink-muted);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- 12. FOOTER STYLES ---------- */
.af-footer-v2 {
  background: linear-gradient(180deg, var(--market-navy) 0%, var(--market-navy-light) 100%);
  border-radius: 24px 24px 0 0;
  padding: 48px 32px 24px;
  margin-top: 48px;
  color: white;
}

.af-footer-v2__grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

@media (min-width: 992px) {
  .af-footer-v2__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.af-footer-v2__brand {
  max-width: 300px;
}

.af-footer-v2__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.af-footer-v2__logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--market-emerald) 0%, var(--market-emerald-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
}

.af-footer-v2__logo-text {
  font-size: 1.25rem;
  font-weight: 800;
}

.af-footer-v2__description {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 20px;
}

.af-footer-v2__trust-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.af-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.9);
}

.af-trust-badge i {
  color: var(--market-emerald-light);
}

.af-footer-v2__column-title {
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.9);
}

.af-footer-v2__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.af-footer-v2__links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: var(--market-transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.af-footer-v2__links a:hover {
  color: white;
}

.af-footer-v2__links a i {
  font-size: 0.75rem;
  opacity: 0.5;
}

.af-footer-v2__newsletter {
  margin-top: 8px;
}

.af-footer-v2__newsletter-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
}

.af-newsletter-form {
  display: flex;
  gap: 8px;
}

.af-newsletter-form input[type="email"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9375rem;
  min-width: 0;
}

.af-newsletter-form input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.af-newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--market-emerald);
  background: rgba(255, 255, 255, 0.15);
}

.af-newsletter-form button {
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--market-emerald) 0%, var(--market-emerald-light) 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: var(--market-transition);
  white-space: nowrap;
}

.af-newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.af-footer-v2__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.af-footer-v2__copyright {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

.af-footer-v2__social {
  display: flex;
  gap: 8px;
}

.af-footer-v2__social a {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--market-transition);
}

.af-footer-v2__social a:hover {
  background: var(--market-emerald);
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 767px) {
  .af-footer-v2 {
    padding: 32px 20px 20px;
    border-radius: 20px 20px 0 0;
  }
  
  .af-market-hero {
    padding: 28px 20px;
    border-radius: 20px;
  }
  
  .af-market-hero__title {
    font-size: 1.75rem;
  }
  
  .af-listing-card__image {
    height: 160px;
  }
  
  .af-newsletter-form {
    flex-direction: column;
  }
  
  .af-newsletter-form button {
    width: 100%;
  }
}

/* ---------- 13. ACCESSIBILITY ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
