/*
 * Guest Post Buddy – main.css
 * Component styles: header, footer, hero, directory layout, cards, single listing, auth pages, submit wizard
 */

/* =============================================
   1. HEADER
   ============================================= */
.gpb-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--clr-header-bg);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  z-index: 1000;
  transition: background-color var(--transition-base), backdrop-filter var(--transition-base);
  border-bottom: 1px solid transparent;
  box-shadow: none;
}

.gpb-header.scrolled {
  background: var(--clr-header-bg-2);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid transparent;
  box-shadow: none;
}

/*
 * Dashboard / app pages: paint the same dark band behind the glass header
 * so header coloring matches the homepage (frosted white over dark gradient).
 */
body.gpb-header-over-app::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 999;
  pointer-events: none;
  background: linear-gradient(140deg, #090B12 0%, #121633 48%, #1A1A3A 100%);
}

.gpb-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

/* Logo */
.gpb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
}

.logo-icon svg {
  display: block;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--clr-dark);
  letter-spacing: -0.02em;
}

.logo-text strong {
  font-weight: 800;
  color: var(--clr-primary);
}

.gpb-footer .gpb-logo .logo-text {
  color: #6b62fe;
}

.gpb-footer .gpb-logo .logo-text strong {
  color: var(--clr-primary-light);
}

/* Nav Links */
.gpb-nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.gpb-nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--clr-text);
  padding: 0.5rem 0;
  position: relative;
}

.gpb-nav-links a:hover,
.gpb-nav-links a.active {
  color: var(--clr-primary);
}

.gpb-nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--clr-primary);
  transition: width var(--transition-fast);
}

.gpb-nav-links a:hover::after,
.gpb-nav-links a.active::after {
  width: 100%;
}

/* Auth / Actions */
.gpb-nav-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* User Dropdown */
.gpb-user-menu {
  position: relative;
}

.gpb-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--clr-text);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.gpb-user-trigger:hover {
  background: var(--clr-bg);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.gpb-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--clr-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--clr-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  padding: 8px 0;
  z-index: 1001;
}

.gpb-user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gpb-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--clr-text);
  text-decoration: none;
}

.gpb-user-dropdown a:hover {
  background: var(--clr-bg);
  color: var(--clr-primary);
}

.gpb-user-dropdown svg {
  color: var(--clr-text-light);
  transition: color var(--transition-fast);
}

.gpb-user-dropdown a:hover svg {
  color: var(--clr-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--clr-border);
  margin: 6px 0;
}

.dropdown-logout {
  color: var(--clr-danger) !important;
}

.dropdown-logout:hover {
  background: color-mix(in srgb, var(--clr-danger) 14%, transparent) !important;
  color: var(--clr-danger) !important;
}

.dropdown-logout svg {
  color: var(--clr-danger);
}

/* Hamburger */
.gpb-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 5px;
  width: 30px;
  height: 24px;
  position: relative;
}

.gpb-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--clr-dark);
  transition: all 0.3s ease;
}

.gpb-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.gpb-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.gpb-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Header Mobile */
@media (max-width: 992px) {
  .gpb-nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--clr-elevated);
    flex-direction: column;
    gap: 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--clr-border);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .gpb-nav-links.mobile-open {
    max-height: 400px;
  }

  .gpb-nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--clr-border);
  }

  .gpb-nav-links a {
    display: block;
    padding: 1rem var(--space-md);
  }

  .gpb-nav-links a::after {
    display: none;
  }

  .gpb-hamburger {
    display: flex;
  }

  .gpb-nav-auth .btn-ghost {
    display: none;
  }

  /* Logged-out: swap hamburger for a compact "List Your Site" CTA */
  body:not(.logged-in) .gpb-hamburger { display: none !important; }
  body:not(.logged-in) .gpb-nav-auth .btn-primary {
    display: inline-flex;
    padding: 7px 14px;
    font-size: 0.78rem;
    gap: 0;
  }
  body:not(.logged-in) .gpb-nav-auth .btn-primary svg { display: none; }
}

/* =============================================
   4. WEBSITE CARDS
   Card styles moved to assets/css/both-cards.css
   (loaded after main.css — see inc/enqueue.php).
   ============================================= */

/* =============================================
   9. FOOTER
   ============================================= */
.gpb-footer {
  position: relative;
  z-index: 2;
  background: var(--clr-dark);
  color: #94A3B8;
  padding: var(--space-3xl) 0 0;
  margin-top: 0;
  clear: both;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: var(--space-3xl);
}

.footer-heading {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.footer-links {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a {
  color: #94A3B8;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

.footer-brand .footer-tagline {
  margin-top: 16px;
  color: #94A3B8;
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

.section-header {
  margin-bottom: var(--space-3xl);
}

.section-label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}


/* =============================================
   11. MOBILE UX ENHANCEMENTS
   ============================================= */

/* Improved touch targets for mobile */
@media (max-width: 768px) {

  /* Ensure minimum touch target size */
  button,
  .btn,
  a.btn,
  input[type="submit"],
  input[type="button"],
  .nav-link,
  .dropdown-item,
  .filter-chip,
  .chip-remove {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improve form inputs for mobile */
  .form-control,
  .form-select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px;
    /* Prevents iOS zoom */
    padding: 14px 12px;
    min-height: 52px;
  }

  /* Better spacing for mobile filters */
  .active-filters {
    margin-bottom: 20px;
  }

  .filter-chip {
    padding: 10px 16px;
    margin: 4px;
    font-size: 0.9rem;
  }

  /* Improve mobile tables */
  .dash-table-wrap {
    margin: 0 -16px;
    padding: 0 16px;
  }

  /* Better mobile modals */
  .modal-content {
    margin: 10px;
    border-radius: 12px;
  }

  /* Mobile-specific spacing improvements */
  .gpb-directory,
  .gpb-dashboard {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Improve mobile navigation */
  .gpb-nav-links.mobile-open {
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .gpb-nav-links li {
    border-bottom: 1px solid var(--clr-border);
  }

  .gpb-nav-links a {
    padding: 18px 20px;
    font-size: 1rem;
  }

  /* Mobile footer improvements */
  .footer-grid {
    gap: 2rem;
  }

  .footer-links a {
    padding: 8px 0;
    display: block;
  }

  /* Mobile contact modal */
  .cd-item {
    padding: 16px;
    margin-bottom: 12px;
  }

  .cd-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* Mobile filter drawer – bottom sheet */
  .directory-sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .directory-sidebar.mobile-visible {
    transform: translateY(0);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 100%;
  }

  .sidebar-bottom-panel {
    display: none;
  }

  .sidebar-header {
    padding: 16px;
    position: sticky;
    top: 0;
    background: var(--clr-surface);
    z-index: 10;
    border-radius: 20px 20px 0 0;
  }

  .filter-body {
    padding: 16px;
    padding-bottom: 40px;
  }

  /* Mobile menu open state */
  body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }

  /* Touch feedback */
  .touch-active {
    opacity: 0.8;
    transform: scale(0.98);
    transition: opacity 0.1s, transform 0.1s;
  }

}


/* Small mobile devices */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  /* Mobile stats — column order: Live Listings+Publishers left, Niches+To Browse right */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    gap: 14px 24px;
    justify-items: center;
  }

  .h-stat-divider {
    display: none;
  }

  /* Mobile buttons stack */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
    border-radius: var(--radius-md);
    margin: 4px 0;
  }
}

/* Tablet improvements */
@media (min-width: 769px) and (max-width: 1024px) {
  .why-grid              { grid-template-columns: repeat(2, 1fr); }
  .niches-grid           { grid-template-columns: repeat(4, 1fr); }
  .trust-system-grid     { grid-template-columns: repeat(2, 1fr); }
  .analytics-preview-grid { grid-template-columns: repeat(2, 1fr); }
  .seo-content-grid      { grid-template-columns: 1fr; }
  .seo-content-aside     { position: static; }
  .directory-layout {
    gap: 24px;
  }

  .single-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .single-sidebar {
    position: static;
    margin-top: 30px;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }

  .form-control {
    border: 2px solid #000;
  }
}

/* Dark mode improvements */
/* (Dark mode removed) */

/* ════════════════════════════════════════
   COMPREHENSIVE MOBILE RESPONSIVENESS FIXES
   ════════════════════════════════════════ */

/* Global: prevent horizontal scroll & ensure images scale */
html, body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

/* iOS: prevent auto-zoom on input focus (font-size < 16px triggers zoom) */
.hero-search-input { font-size: max(1rem, 16px); }

/* ── 992px: Tighten nav auth area on tablet ── */
@media (max-width: 992px) {
  .gpb-nav-auth { gap: 0.5rem; }
}

/* ── 640px: Tighten nav button + single listing hero stacking ── */
@media (max-width: 640px) {
  /* Shrink 'List Your Site' CTA in header */
  .gpb-nav-auth .btn-primary {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  .gpb-nav-auth .btn-primary svg { display: none; }

}

/* ── 480px: Small mobile fixes ── */
@media (max-width: 480px) {
  /* Modal: compact padding, scrollable if tall */
  .modal-box {
    padding: 20px 16px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
  }
  .modal-header h3 { font-size: 1rem; }

  /* Completeness bar */
  .completeness-wrap { padding: 8px 12px; }

  /* Hero badge */
  .hero-badge { font-size: 0.75rem; padding: 5px 12px; }

  /* Directory section toolbar: stack */
  .directory-toolbar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .sort-controls { justify-content: space-between; }
}

/* ── 380px: Very narrow phones (Galaxy A, iPhone SE) ── */
@media (max-width: 380px) {
  /* Truncate long site names */
  .site-name { font-size: 0.95rem; }
  .site-url  { font-size: 0.78rem; }

  /* Logo text shrink */
  .logo-text { font-size: 1rem; }

  /* Hero stats: keep 2-column grid on very narrow screens */
  .hero-stats { gap: 12px 16px; }
  .h-stat { text-align: center; }

  /* Contact detail items: stack icon + text */
  .cd-item { flex-direction: column; align-items: flex-start; gap: 8px; }

}

/* Print styles */
@media print {

  .gpb-header,
  .gpb-footer,
  .gpb-nav-auth,
  .btn,
  .wizard-actions,
  .modal,
  .contact-modal {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    font-weight: normal;
  }
}
/* ══════════════════════════════════════
   BACK TO TOP BUTTON
   ══════════════════════════════════════ */
.gpb-back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6C63FF 0%, #5048E5 100%);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.42), 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.88);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
  outline: none;
}
.gpb-back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.gpb-back-to-top:hover {
  background: linear-gradient(135deg, #7B74FF 0%, #6058F0 100%);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.58), 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px) scale(1.07);
}
.gpb-back-to-top:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 3px 12px rgba(108, 99, 255, 0.35);
}
.gpb-back-to-top:focus-visible {
  outline: 3px solid rgba(108, 99, 255, 0.55);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .gpb-back-to-top {
    width: 44px;
    height: 44px;
    bottom: 20px;
    right: 18px;
  }
  .gpb-back-to-top svg {
    width: 18px;
    height: 18px;
  }
}

/* ══════════════════════════════════════
   MOBILE HEADER — logged-in improvements
   ══════════════════════════════════════ */
@media (max-width: 768px) {
  /* Logged-in: avatar icon replaces the hamburger entirely */
  body.logged-in .gpb-hamburger { display: none !important; }

  /* Logged-out: keep CTA pill compact at narrower widths */
  body:not(.logged-in) .gpb-nav-auth .btn-primary {
    padding: 6px 12px;
    font-size: 0.76rem;
    letter-spacing: 0;
    border-radius: 5px;
  }

  /* Icon-only user trigger: hide username text + chevron arrow */
  .gpb-user-trigger span,
  .gpb-user-trigger > svg:last-child {
    display: none;
  }
  .gpb-user-trigger {
    padding: 3px;
    gap: 0;
    border-radius: 50%;
    background: transparent !important;
    box-shadow: none !important;
  }
  .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* Logo breathing room when controls are reduced */
  .gpb-logo .logo-text { font-size: 1rem; }
}

/* ══════════════════════════════════════════════════
   REDUCED MOTION — respect OS accessibility settings
   ══════════════════════════════════════════════════ */
@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;
  }
  .skeleton-loader,
  .skeleton-line,
  .skeleton-card {
    animation: none !important;
  }
}

/* =============================================
   FOOTER LEGAL LINKS (global - used on all pages)
   ============================================= */
.footer-legal-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-legal-links a {
  font-size: 0.8rem;
  color: #94A3B8;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-legal-links a:hover { color: #fff; }
.footer-legal-links span { color: #475569; font-size: 0.8rem; }

.footer-social-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 600px) {
  .footer-bottom      { flex-direction: column; gap: var(--space-sm); text-align: center; }
  .footer-legal-links { justify-content: center; }
}

