/* ============================================================
   Classified Ads by Faruq — main.css
   Supplemental styles: animations, hover effects, components
   Matches the new Indigo/Amber design system in style.css
   ============================================================ */

/* ---- Lazy image fade-in ---- */
img[data-src]  { opacity: 0; transition: opacity .3s; }
img.loaded     { opacity: 1; }

/* ---- Listing card hover glow ---- */
.listing-card {
  transition: transform .3s cubic-bezier(.22,1,.36,1),
              box-shadow .3s cubic-bezier(.22,1,.36,1),
              border-color .2s ease;
}
.listing-card:hover { transform: translateY(-6px); }
.listing-card .listing-card-image img { transition: transform .5s cubic-bezier(.22,1,.36,1); }
.listing-card:hover .listing-card-image img { transform: scale(1.09); }

/* ---- Favorite button ---- */
.listing-fav-btn { transition: transform .2s, color .2s, box-shadow .2s; }
.listing-fav-btn:hover { transform: scale(1.22); box-shadow: 0 4px 16px rgba(244,63,94,.25); }
.listing-fav-btn.active { color: #F43F5E !important; }

/* ---- Category card hover ---- */
.category-card { transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s, border-color .2s; }
.category-card:hover { transform: translateY(-6px); }

/* ---- Back to top ---- */
#back-to-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 6px 20px rgba(79,70,229,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
#back-to-top.visible { opacity: 1; pointer-events: all; transform: translateY(0); }
#back-to-top:hover { box-shadow: 0 10px 28px rgba(79,70,229,.5); transform: translateY(-3px); }

/* ---- Search bar focus glow ---- */
.search-form-header:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

/* ---- Price in listing card ---- */
.listing-price { font-weight: 900; color: var(--primary); font-size: 1.0625rem; }
.listing-price.negotiable::after {
  content: ' · Neg.';
  font-size: .7rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* ---- Badge pills ---- */
.badge-urgent   { background: #FFE4E6; color: #9F1239; }
.badge-featured { background: #FEF3C7; color: #92400E; }
.badge-new      { background: var(--primary-light); color: var(--primary-dark); }
.badge-used     { background: var(--gray-100); color: var(--gray-500); }
.badge-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ---- Auth / Login Modal ---- */
#auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,14,36,.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#auth-modal.open { display: flex; }
#auth-modal .modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  padding: 36px;
  position: relative;
  animation: modalSlideIn .28s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 24px 80px rgba(15,14,36,.25);
}
@keyframes modalSlideIn {
  from { opacity:0; transform: translateY(28px) scale(.96); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--gray-100);
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--gray-400);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }
.auth-tabs { display: flex; border-bottom: 2px solid var(--gray-100); margin-bottom: 26px; }
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 11px;
  cursor: pointer;
  font-weight: 700;
  color: var(--gray-400);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
  font-size: 14px;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-pane { display: none; }
.auth-pane.active { display: block; }
.auth-form-group { margin-bottom: 18px; }
.auth-form-group label { display: block; font-weight: 700; font-size: .875rem; color: var(--gray-700); margin-bottom: 7px; }
.auth-form-group input {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
  font-family: var(--font-primary);
}
.auth-form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.auth-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  margin-top: 4px;
  font-family: var(--font-primary);
  box-shadow: 0 4px 14px rgba(79,70,229,.30);
}
.auth-submit:hover { opacity: .92; transform: translateY(-1px); }
.auth-divider { text-align: center; color: var(--gray-400); font-size: .8125rem; margin: 18px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: calc(50% - 24px); height: 1px; background: var(--gray-200); }
.auth-divider::before { left: 0; } .auth-divider::after { right: 0; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: #fff; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s;
  margin-bottom: 10px; text-decoration: none; color: var(--gray-800); font-family: var(--font-primary);
}
.social-btn:hover { background: var(--gray-50); border-color: var(--gray-300); }
.auth-msg { padding: 11px 16px; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: 16px; display: none; }
.auth-msg.error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; display: block; }
.auth-msg.success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; display: block; }

/* ---- Toast notification ---- */
#jijing-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--gray-900);
  color: #fff;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-size: .875rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  z-index: 9998;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
#jijing-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Gallery thumbnails ---- */
.gallery-thumb { cursor: pointer; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; transition: border-color .2s, opacity .2s; opacity: .65; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--primary); opacity: 1; box-shadow: 0 0 0 2px rgba(79,70,229,.18); }

/* ---- Filter sidebar ---- */
.filter-group { margin-bottom: 22px; }
.filter-group-title { font-weight: 800; font-size: .9375rem; color: var(--gray-800); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-100); }
.filter-option { display: flex; align-items: center; gap: 9px; padding: 7px 0; cursor: pointer; font-size: .9rem; color: var(--gray-700); transition: color .15s; }
.filter-option:hover { color: var(--primary); }
.filter-option input { accent-color: var(--primary); }

/* ---- Post Ad step indicator ---- */
.step-indicator { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 36px; }
.step-dot {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .875rem; background: var(--gray-100);
  color: var(--gray-500); transition: background .3s, color .3s;
  flex-shrink: 0; position: relative; z-index: 1;
}
.step-dot.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.30); }
.step-dot.done   { background: var(--success); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--gray-200); transition: background .3s; }
.step-line.done  { background: var(--success); }

/* ---- Image upload drop zone ---- */
.drop-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.image-preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.image-preview-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-item .remove-img {
  position: absolute; top: 5px; right: 5px;
  background: rgba(0,0,0,.65); color: #fff; border: none; border-radius: 50%;
  width: 24px; height: 24px; cursor: pointer; font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---- Dashboard table ---- */
@media (max-width: 768px) {
  .image-preview-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Mobile nav active highlight ---- */
.mobile-bottom-nav a.active { color: var(--primary) !important; background: var(--primary-light) !important; }

/* ---- Skeleton shimmer ---- */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Stats strip text classes for customizer targeting ---- */
.stat-ads-value   {}
.stat-users-value {}

/* ---- Section accent colors for category cards ---- */
.cat-color-phones-tablets  { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); color: #1E40AF; }
.cat-color-vehicles        { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); color: #065F46; }
.cat-color-electronics     { background: linear-gradient(135deg, #FCE7F3, #FBCFE8); color: #9D174D; }
.cat-color-fashion         { background: linear-gradient(135deg, #EDE9FE, #DDD6FE); color: #5B21B6; }
.cat-color-house-apartment { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #92400E; }
.cat-color-jobs            { background: linear-gradient(135deg, #E0F2FE, #BAE6FD); color: #075985; }
.cat-color-agriculture     { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); color: #064E3B; }
.cat-color-animals-pets    { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); color: #92400E; }
.cat-color-furniture       { background: linear-gradient(135deg, #FDF4FF, #FAE8FF); color: #6B21A8; }
.cat-color-health-beauty   { background: linear-gradient(135deg, #FFF1F2, #FFE4E6); color: #9F1239; }
.cat-color-services        { background: linear-gradient(135deg, #F0FDF4, #DCFCE7); color: #14532D; }
.cat-color-sports          { background: linear-gradient(135deg, #ECFDF5, #A7F3D0); color: #065F46; }
.cat-color-kids-babies     { background: linear-gradient(135deg, #FEFCE8, #FEF9C3); color: #713F12; }
.cat-color-books           { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); color: #1E3A8A; }
.cat-color-others          { background: linear-gradient(135deg, var(--gray-100), var(--gray-50)); color: var(--gray-600); }

/* ---- Print ---- */
@media print {
  .header-topbar, .category-nav, .mobile-bottom-nav,
  #back-to-top, #auth-modal, .site-footer { display: none !important; }
}
