/* ═══════════════════════════════════════════════════════════════════
   BIDPOTS FOOTER & ACCESSIBILITY UPGRADE v3.0
   Rich footer with navigation + WCAG 2.1 AA compliance
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   OVERRIDE OLD FOOTER STYLES
   Ensures new .bp-footer takes precedence over old footer rules
   ═══════════════════════════════════════════════════════════════════ */

/* Kill old footer styles */
footer.bp-footer {
  background-color: transparent;
  margin-left: 0;
  margin-right: 0;
  color: inherit;
  padding: 0;
}

footer.bp-footer .f_menu,
footer.bp-footer .copyright {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   MODERN FOOTER — Multi-column with full navigation
   ═══════════════════════════════════════════════════════════════════ */

.bp-footer {
  background: linear-gradient(135deg, #0f172a 0%, #1a1a2e 40%, #16213e 100%);
  color: #e2e8f0;
  padding: 0;
  margin-top: 48px;
  border-radius: 24px 24px 0 0;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative gradient overlay */
.bp-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #e94560, #f59e0b, #059669, #2563eb);
  background-size: 200% 100%;
  animation: bp-footer-shimmer 8s ease infinite;
  pointer-events: none;
}

@keyframes bp-footer-shimmer {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 200% 0%; }
}

.bp-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 32px 24px;
}

/* ─── Footer Grid Layout ─────────────────────────────────────────── */
.bp-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Brand Column ───────────────────────────────────────────────── */
.bp-footer-brand {
  max-width: 320px;
}

.bp-footer-logo {
  display: inline-block;
  margin-bottom: 16px;
  transition: opacity 0.2s;
}

.bp-footer-logo:hover {
  opacity: 0.8;
}

.bp-footer-logo img {
  height: 40px;
  width: auto;
  filter: brightness(1.1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.bp-footer-tagline {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 20px;
}

/* ─── Social Links ───────────────────────────────────────────────── */
.bp-footer-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bp-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bp-social-link:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.bp-social-link:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* ─── Navigation Columns ─────────────────────────────────────────── */
.bp-footer-nav {
  min-width: 0;
}

.bp-footer-heading {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.bp-footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bp-footer-nav ul li {
  margin-bottom: 8px;
}

.bp-footer-nav ul li a {
  color: #94a3b8;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-radius: 4px;
}

.bp-footer-nav ul li a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.bp-footer-nav ul li a:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
  border-radius: 4px;
}

.bp-footer-nav ul li a i {
  font-size: 10px;
  color: #475569;
  transition: color 0.2s;
}

.bp-footer-nav ul li a:hover i {
  color: #60a5fa;
}

/* ─── Footer Bottom Bar ──────────────────────────────────────────── */
.bp-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
}

.bp-footer-apps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bp-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.bp-app-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.bp-app-badge:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.bp-app-badge i {
  font-size: 16px;
}

.bp-copyright {
  color: #64748b;
  font-size: 12px;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE FOOTER
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .bp-footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
  }

  .bp-footer-brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .bp-footer {
    border-radius: 16px 16px 0 0;
    margin-top: 32px;
  }

  .bp-footer-inner {
    padding: 36px 20px 20px;
  }

  .bp-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .bp-footer-brand {
    grid-column: 1 / -1;
  }

  .bp-footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .bp-footer-apps {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .bp-footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .bp-footer-inner {
    padding: 28px 16px 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   WCAG 2.1 AA — ACCESSIBILITY ENHANCEMENTS
   Focus management, color contrast, screen reader, motion
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Skip to Content Link ───────────────────────────────────────── */
.bp-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: #1e40af;
  color: #ffffff;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: top 0.2s ease;
}

.bp-skip-link:focus {
  top: 0;
  outline: none;
}

/* ─── Enhanced Focus Indicators (WCAG 2.4.7) ────────────────────── */
*:focus-visible {
  outline: 3px solid #2563eb !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* Dark background focus ring */
.navbar-top *:focus-visible,
.bp-footer *:focus-visible,
[style*="background"]:not([style*="background:#fff"]):not([style*="background:white"]) *:focus-visible {
  outline-color: #60a5fa !important;
}

/* Remove outline on mouse click but keep for keyboard */
:focus:not(:focus-visible) {
  outline: none !important;
}

/* ─── Minimum Touch Target (WCAG 2.5.5 — Level AAA for best UX) ── */
/* Only apply to specific interactive elements, not all links globally */
.bp-main-nav > li > a,
.bp-mobile-nav ul li a,
.bp-footer-nav ul li a,
.btn,
.bp-btn,
input[type="submit"],
input[type="button"],
.bp-sell-btn,
.bp-nav-icon-btn,
.bp-mobile-post-btn,
.navbar-toggle {
  min-height: 44px;
}

/* Exceptions for inline links within text — no size enforcement */
p a, li a, span a, td a, .bp-footer-nav a,
.dropdown-menu a, .f_menu a, .ad-cont a,
.ads a, .ad-list a {
  min-height: auto;
  min-width: auto;
}

/* ─── Color Contrast Fixes (WCAG 1.4.3 — 4.5:1 minimum) ────────── */
/* Fix low-contrast placeholder text */
::placeholder {
  color: #6b7280 !important; /* 4.6:1 contrast on white */
  opacity: 1;
}

/* Fix muted text that might be too light */
.text-muted, .small, small {
  color: #6b7280 !important; /* was #9ca3af (3.1:1) → now 4.6:1 */
}

/* Fix gold/yellow on white (was #f2b530 — 2.1:1 FAIL) */
.f_menu a, .bid li strong, .top-ttls h4 {
  color: #b45309 !important; /* 4.5:1 on white */
}

/* Status colors with sufficient contrast */
.link_green, .status.online {
  color: #047857 !important; /* 5.6:1 on white */
}

.link_red {
  color: #b91c1c !important; /* 5.7:1 on white */
}

/* ─── Reduced Motion (WCAG 2.3.3) ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ads:hover,
  .peoples-item:hover,
  .bp-social-link:hover,
  .bp-app-badge:hover {
    transform: none !important;
  }

  .bp-footer::before {
    animation: none !important;
  }
}

/* ─── High Contrast Mode Support ─────────────────────────────────── */
@media (forced-colors: active) {
  .bp-footer {
    border: 1px solid CanvasText;
  }

  .bp-social-link,
  .bp-app-badge {
    border: 1px solid CanvasText;
  }

  .ads, .ad-list, .form-bg {
    border: 1px solid CanvasText;
  }

  .btn, .bp-btn {
    border: 1px solid ButtonText;
  }
}

@media (prefers-contrast: high) {
  body {
    --bp-text-secondary: #374151;
    --bp-text-muted: #4b5563;
  }

  .text-muted, small, .small {
    color: #374151 !important;
  }

  .form-control {
    border-width: 2px !important;
  }
}

/* ─── Screen Reader Only Utility ─────────────────────────────────── */
.sr-only, .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ─── Live Region for Dynamic Content ────────────────────────────── */
[aria-live="polite"],
[aria-live="assertive"] {
  position: relative;
}

/* ─── Form Accessibility ─────────────────────────────────────────── */
/* Required field indicator */
label[for]::after,
.form-group > label:first-child::after {
  content: '';
}

/* Error state improvements */
.form-control[aria-invalid="true"],
.form-control.input-validation-error {
  border-color: #dc2626 !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Success state */
.form-control[aria-invalid="false"],
.form-control.valid {
  border-color: #059669 !important;
}

/* Error message styling */
[role="alert"],
.field-validation-error,
.validation-summary-errors {
  color: #b91c1c !important;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  background: #fef2f2;
  border-radius: 6px;
  border-left: 3px solid #dc2626;
  margin-top: 4px;
}

/* ─── Link Accessibility ─────────────────────────────────────────── */
/* Ensure links are distinguishable from text (WCAG 1.4.1) */
.page-content a:not(.btn):not(.ads):not(.ad-list a):not([class*="bp-"]) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-content a:not(.btn):not(.ads):not(.ad-list a):not([class*="bp-"]):hover {
  text-decoration-thickness: 2px;
}

/* ─── Image Accessibility ────────────────────────────────────────── */
img:not([alt]) {
  outline: 3px solid #dc2626 !important; /* Dev aid: highlight missing alt */
}

/* ─── Table Accessibility ────────────────────────────────────────── */
table {
  border-collapse: collapse;
}

table th {
  text-align: left;
  font-weight: 600;
}

/* ─── Semantic Structure Indicators ──────────────────────────────── */
[role="navigation"],
[role="main"],
[role="contentinfo"],
[role="banner"] {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   ENHANCED HYPERLINK STYLES
   Clear, accessible, stylish links throughout the application
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Breadcrumb Navigation ──────────────────────────────────────── */
.bp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  margin-bottom: 16px;
  font-size: 13px;
  list-style: none;
}

.bp-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bp-breadcrumb li + li::before {
  content: '/';
  color: #9ca3af;
  margin: 0 4px;
}

.bp-breadcrumb a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.bp-breadcrumb a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.bp-breadcrumb .active {
  color: #6b7280;
  font-weight: 400;
}

/* ─── Navigation Link Improvements ───────────────────────────────── */
.bp-main-nav > li > a:focus-visible {
  outline: 2px solid #60a5fa !important;
  outline-offset: -2px !important;
  border-radius: 4px;
}

/* Active state indicator */
.bp-main-nav > li > a.active,
.bp-main-nav > li.active > a {
  color: #ffffff !important;
  border-bottom-color: #e94560 !important;
  font-weight: 700;
}

/* ─── Call-to-Action Links ───────────────────────────────────────── */
.bp-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.bp-cta-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.bp-cta-link:hover {
  color: #1d4ed8;
  gap: 10px;
}

.bp-cta-link:hover::after {
  transform: translateX(3px);
}

.bp-cta-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   PRINT OPTIMIZATION
   ═══════════════════════════════════════════════════════════════════ */
@media print {
  .bp-footer {
    background: #fff !important;
    color: #000 !important;
    border-top: 2px solid #000;
    border-radius: 0;
  }

  .bp-footer-social,
  .bp-footer-apps,
  .bp-footer::before {
    display: none !important;
  }

  .bp-footer-heading {
    color: #000 !important;
  }

  .bp-footer-nav ul li a {
    color: #333 !important;
  }

  .bp-skip-link,
  .bp-mobile-nav,
  .bp-fab-post {
    display: none !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   CLICK-BLOCKING PREVENTION
   Ensure modals and hidden elements don't capture clicks
   ═══════════════════════════════════════════════════════════════════ */

/* ─── GLOBAL: Pseudo-elements must never block clicks ────────────── */
*::before,
*::after {
  pointer-events: none !important;
}

/* ─── GLOBAL: Re-enable pointer-events on interactive elements ───── */
a, button, input, select, textarea,
[role="button"], label, .btn, .bp-btn,
.form-control, .dropdown-menu,
.nav > li > a, .bp-main-nav > li > a,
.bp-mobile-nav a, .bp-footer-nav a,
.bp-social-link, .bp-app-badge,
.ads, .ad-list a, .home-cats a,
[data-ref="AdItem"], [data-filterads-anchr],
.bp-login-btn, .bp-register-btn,
.bp-sell-btn, .bp-nav-icon-btn,
.bp-mobile-post-btn, .dropdown-toggle,
.navbar-toggle, .bp-auth-btns a {
  pointer-events: auto !important;
}

/* Popup overlays — hidden by default, no click blocking */
#loginModel,
#logout,
#loginModel_background,
#logout_background,
.popup_background {
  pointer-events: none;
}

/* When popup is shown by plugin, allow interaction */
#loginModel[style*="display: block"],
#loginModel[style*="display:block"],
#loginModel.popup_visible,
#loginModel.popup_content_visible,
#logout[style*="display: block"],
#logout[style*="display:block"],
#logout.popup_visible,
#logout.popup_content_visible {
  display: block;
  pointer-events: auto;
}

/* When popup background is VISIBLE (opacity > 0), allow interaction to close it */
#loginModel_background[style*="visibility: visible"],
#logout_background[style*="visibility: visible"],
.popup_background[style*="visibility: visible"] {
  pointer-events: auto;
}

/* When popup background is HIDDEN, block all interaction */
#loginModel_background[style*="visibility: hidden"],
#logout_background[style*="visibility: hidden"],
#loginModel_background:not([style*="visibility: visible"]),
#logout_background:not([style*="visibility: visible"]),
.popup_background:not([style*="visibility: visible"]) {
  pointer-events: none !important;
}

/* Hidden sidebar must never capture clicks */
.navbar-side,
.navbar-side * {
  pointer-events: none !important;
}

/* Chat panel - only interactive when active */
div#messages:not(.active) {
  pointer-events: none;
}

div#messages.active {
  pointer-events: auto;
}

/* Ensure all pseudo-elements never block clicks */
.ads::before,
.ads::after,
.form-bg::before,
.form-bg::after,
.bp-footer::before,
.bp-footer::after,
.profile-details > figure::before,
.profile-details > figure::after,
#page-wrapper::before,
#page-wrapper::after {
  pointer-events: none !important;
}

/* Ensure main interactive areas are always clickable */
#page-wrapper,
.page-content,
.bp-main-nav,
.nav-top,
.navbar-header,
.bp-footer,
.bp-mobile-nav,
.bp-mobile-menu.open {
  pointer-events: auto;
}
