/* === משתני צבע ועיצוב גלובליים === */
:root {
  color-scheme: dark;
  --main-bg: #171c30;
  --card-bg: #242b49;
  --header-bg: #1d233b;
  --filter-bg: #242b49;
  --surface-raised: #2c3456;
  --surface-hover: #364061;
  --input-bg: #1b2138;
  --primary: #ff7892;
  --primary-color: #ff7892;
  --primary-hover: #ff8ca3;
  --primary-light: #ffadc0;
  --primary-dark: #ee5f7d;
  --primary-faint: #2b2538;
  --primary-soft: #3b293e;
  --primary-soft-hover: #4a3046;
  --primary-border: #7b465d;
  --filter-active: #ff7892;
  --filter-inactive: #c6cdec;
  --secondary: #c6cdec;
  --text-main: #fbfbff;
  --text-light: #f1f3ff;
  --text-secondary: #c3cae8;
  --text-primary: #1a1a1a;
  --white: #ffffff;
  --light-bg: #f4f6fb;
  --accent-color: #61d7ff;
  --border-color: #4b5578;
  --border-subtle: #3b4567;
  --border-strong: #596486;
  --border-radius: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 14px 38px rgba(4, 7, 18, 0.24);
  --shadow-sm: 0 4px 12px rgba(4, 7, 18, 0.16);
  --shadow-md: 0 12px 28px rgba(4, 7, 18, 0.22);
  --shadow-lg: 0 20px 48px rgba(4, 7, 18, 0.3);
  --focus-ring: 0 0 0 3px rgba(255, 120, 146, 0.28);
  --modal-blur: blur(12px);
  --transition: all 0.2s ease;
}

/* === איפוס בסיסי וסגנונות גלובליים === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Heebo', 'Rubik', Arial, sans-serif;
  background: var(--main-bg) !important;
  color: var(--text-main) !important;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.8rem;
  color: var(--primary-dark);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-color);
}

/* === כותרת עליונה === */
header {
  background: var(--main-bg) !important;
  color: #fff !important;
  box-shadow: none;
  border-bottom: 1.5px solid #232946;
  gap: 0.3rem;
  flex-wrap: nowrap;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0 0.5rem;
}

.nav-item,
.post-ad-btn {
  flex: 0 0 auto;
  margin: 0 !important;
}

/* === עיצוב כפתור 'פרסם מודעה' כמו ה-navbar === */
.post-ad-btn {
  background: none !important;
  color: #e6e6e6 !important;
  font-weight: 400;
  font-size: 1.05rem;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.6rem 1rem;
  margin: 0;
  transition: color 0.18s, font-weight 0.18s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.post-ad-btn:hover,
.post-ad-btn:focus {
  color: #fff !important;
  font-weight: 700;
  text-shadow: 0 1px 8px #23294633;
  background: none !important;
}

.post-ad-btn i {
  font-size: 1rem;
}

.nav-item {
  background: none !important;
  color: #e6e6e6 !important;
  font-weight: 400;
  font-size: 1.05rem;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.6rem 1rem;
  margin: 0;
  transition: color 0.18s, font-weight 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-item:hover,
.nav-item:focus {
  color: #fff !important;
  font-weight: 700;
  text-shadow: 0 1px 8px #23294633;
  background: none !important;
}

.nav-item.active {
  color: #fff !important;
  border-bottom: 2.5px solid var(--primary);
  font-weight: 700;
  background: none !important;
}

.nav-item i {
  font-size: 1.1rem;
}

.search-container {
  position: relative;
  margin-right: auto;
  margin-left: 2rem;
}

.search-input {
  padding: 0.5rem 1rem;
  padding-right: 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 300px;
  font-size: 0.9rem;
}

.search-icon {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* === שדה חיפוש באזור הסינון === */
.search-input-wrapper {
  position: relative;
  min-width: 200px;
}

.search-input-text {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-text:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 95, 126, 0.2);
}

.search-input-text::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.search-icon-input {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

header h1 {
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  color: var(--white);
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header p {
  font-weight: 400;
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.2rem;
}

.auth-links {
  position: absolute;
  top: 20px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.auth-links button {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-links button:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.auth-links button i {
  margin-left: 6px;
}

#userEmail {
  display: none;
  padding: 0.4rem 0.7rem;
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  margin-right: 0.5rem;
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  flex-shrink: 1;
  min-width: 0;
}

#pendingAdsBtn {
  color: #f59e0b !important;
  font-size: 0.95rem;
}
#pendingAdsBtn:hover {
  color: #fbbf24 !important;
}

.pending-section-header {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1rem;
  color: #f59e0b;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-bottom: 2px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 0.5rem;
}

.admin-badge-label {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

.mobile-login-label {
  display: none;
}
.mobile-login-label.hidden {
  display: none !important;
}

/* === מודל תיבות דו-שיח === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.modal.show {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-content {
  background: var(--card-bg) !important;
  padding: 2rem;
  border-radius: var(--border-radius) !important;
  width: 90%;
  max-width: 500px;
  position: relative;
  margin: 40px auto;
  box-shadow: var(--shadow) !important;
  color: var(--text-main) !important;
  border: 1.5px solid var(--secondary) !important;
  backdrop-filter: var(--modal-blur);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary) !important;
  color: #fff !important;
  border: 1.5px solid #fff !important;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-modal:hover {
  color: #333;
}

#adModal .close-modal {
position: absolute !important;
top: 15px;
left: 15px;
right: auto;
z-index: 4000;
background: #fff !important;
border-radius: 50%;
border: 1px solid #e0e0e0;
font-size: 1.6rem;
color: #333;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
transition: all 0.2s ease;
cursor: pointer;
  }
  
#adModal .close-modal:hover {
background: #f8f9fa !important;
color: #000 !important;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
transform: scale(1.05);
  }


/* === סגנון מודל הוספת מודעה === */
#adModal .modal-content {
  position: relative;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 20px auto;
}

#adModal .form-group {
  margin-bottom: 1.5rem;
}

/* === סגנון מודל ביקוש חדש === */
#wantedAdModal .modal-content {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 20px auto;
}

#wantedAdModal .form-group {
  margin-bottom: 1.5rem;
}

#wantedAdModal .form-group input,
#wantedAdModal .form-group select,
#wantedAdModal .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}

#wantedAdModal .form-group textarea {
  min-height: 120px;
  resize: vertical;
}

#adModal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

#adModal .form-group input,
#adModal .form-group select,
#adModal .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

#adModal .form-group textarea {
  min-height: 120px;
  resize: vertical;
}

#adModal .progress-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin: 0;
  overflow: hidden;
  display: none;
}

#adModal .progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0;
  transition: width 0.3s ease;
}

#adModal .ad-submit-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(35, 41, 70, 0.92);
  border-radius: inherit;
  outline: none;
}

@media (max-width: 768px) {
  #adModal .ad-submit-overlay {
    position: fixed;
    inset: 0;
    z-index: 10005;
    border-radius: 0;
  }
}

#adModal .ad-submit-overlay-box {
  text-align: center;
  max-width: 340px;
  color: #fff;
}

#adModal .ad-submit-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.25rem;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ad-submit-spin 0.85s linear infinite;
}

@keyframes ad-submit-spin {
  to { transform: rotate(360deg); }
}

#adModal .ad-submit-overlay-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: #fff;
}

#adModal .ad-submit-overlay-note {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--secondary);
  margin-bottom: 1.25rem;
}

#adModal .ad-submit-progress {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

#adModal .file-input-group {
  border: 2px dashed #ddd;
  padding: 2rem;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#adModal .file-input-group:hover {
  border-color: #2f4f4f;
  background: rgba(47, 79, 79, 0.05);
}

#adModal .file-name {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #666;
}

/* סגנון כפתור התחברות עם גוגל */
.google-signin-btn {
  width: 100%;
  background: #fff !important;
  color: #222 !important;
  border: 1.5px solid #dadce0 !important;
  padding: 10px 0;
  border-radius: 24px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1.05rem;
  margin-top: 1rem;
  box-shadow: none !important;
  transition: background 0.2s, box-shadow 0.2s;
}
.google-signin-btn:hover {
  background: #f7f8fa !important;
  color: #222 !important;
  box-shadow: 0 1px 4px rgba(60,64,67,0.08);
}
.google-signin-btn i {
  color: #4285F4 !important;
  font-size: 22px;
  margin-left: 8px;
  margin-right: 0;
  background: none;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-divider {
  text-align: center;
  margin: 1rem 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: #ddd;
}

.auth-divider::before {
  left: 0;
}

.auth-divider::after {
  right: 0;
}

.auth-divider span {
  background: white;
  padding: 0 10px;
  color: #666;
  font-size: 14px;
}

.auth-toggle-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 14px;
  color: #666;
}

.auth-toggle-link a {
  color: #2f4f4f;
  text-decoration: none;
  font-weight: 500;
}

.auth-toggle-link a:hover {
  text-decoration: underline;
}

/* === הודעות שגיאה והצלחה === */
.error-message,
.success-message {
  display: none;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 14px;
}

.error-message {
  background: #ff4444 !important;
  color: #fff !important;
  border: none !important;
}

.success-message {
  background: #1ed760 !important;
  color: #fff !important;
  border: none !important;
}

/* === שדות טופס === */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.form-group input:focus {
  outline: none;
  border-color: #2f4f4f;
  box-shadow: 0 0 0 2px rgba(47, 79, 79, 0.1);
}

.forgot-password {
  text-align: left;
  margin-bottom: 1rem;
}

.forgot-password a {
  color: #2f4f4f;
  font-size: 14px;
  text-decoration: none;
}

.forgot-password a:hover {
  text-decoration: underline;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 1.5rem;
}

.button-group button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #2f4f4f;
  color: white;
}

.btn-primary:hover {
  background: #3e6363;
}

.btn-secondary {
  background: #f8f9fa;
  border: 1px solid #ddd;
  color: #333;
}

.btn-secondary:hover {
  background: #e9ecef;
}

/* === כפתורים === */
.button-group {
  display: flex;
  justify-content: space-between;
  margin-top: 1.8rem;
  gap: 12px;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--light-bg);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background-color: var(--primary-color);
  color: var(--white);
  box-shadow: 0 3px 6px rgba(47, 79, 79, 0.2);
}

.btn-accent:hover {
  background-color: var(--primary-light);
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(47, 79, 79, 0.3);
}

/* === בחירת קובץ === */
.file-input-group {
  position: relative;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.file-input-label:hover {
  border-color: var(--primary-color);
  background: rgba(74, 144, 226, 0.05);
}

.file-input-label i {
  font-size: 1.5rem;
  margin-left: 10px;
  color: var(--primary-color);
}

input[type="file"] {
  opacity: 0;
  position: absolute;
  z-index: -1;
}

.file-name {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-color);
  word-break: break-all;
}

/* === פרוגרס בר === */
.progress-container {
  background: var(--light-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1rem 0;
  height: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--primary-color), var(--primary-light));
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* === כפתור הוספת מודעה === */
.add-btn-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-color);
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.add-btn-container:hover {
  transform: translateY(-5px);
  background: var(--primary-light);
}

.add-btn {
  background: transparent;
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--white);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  padding: 0;
}

.add-btn-text {
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

/* === אזור סינון === */
.filter-section {
  background: var(--card-bg) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border: 1.5px solid var(--secondary);
  padding: 1rem 1.5rem;
  margin: 1rem 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 220px;
  min-width: 0;
}

.filter-label {
  color: var(--secondary) !important;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* === קבוצת כפתורי הפעולה (סנן/נקה) === */
.filter-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-inline-start: auto;
}

/* === עיצוב כפתורי סינון שטוחים === */
.filter-button {
  background: none !important;
  color: #ff5f7e !important;
  border: none !important;
  border-radius: 20px !important;
  font-size: 1.05rem;
  font-weight: 500;
  box-shadow: none !important;
  padding: 0.4rem 1.2rem;
  margin: 0;
  transition: color 0.18s, background 0.18s, font-weight 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.filter-button:hover,
.filter-button:focus {
  color: #fff !important;
  background: #ff5f7e !important;
  font-weight: 700;
}

/* === מודעות === */
.ads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.ad {
  background: var(--card-bg) !important;
  color: var(--text-main) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: 0 4px 24px 0 #ff5f7e22, 0 1.5px 8px 0 #23294655 !important;
  border: 2px solid var(--secondary) !important;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.ad:hover {
  box-shadow: 0 12px 36px 0 #00c6ff33, 0 2px 12px 0 #e5091433;
}

.ad-img-container {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  overflow: hidden;
  background-color: #121629 !important;
}

.ad-img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ad-content {
  padding: 1.2rem;
  padding-bottom: 2.5rem; /* הגדלת padding-bottom למניעת חיתוך */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: visible; /* הבטחת תצוגה מלאה של התוכן */
}

.ad h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main) !important;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

/* סגנון לתיאור במודעות */
.ad-content p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.ad-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main) !important;
  font-size: 0.9rem;
  margin-top: auto;
}

.ad-location i {
  color: var(--primary-color);
  font-size: 1rem;
}

.ad-price {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--primary) !important;
  margin-top: 0.8rem;
  margin-bottom: 0.5rem; /* הגדלת margin-bottom למניעת חיתוך */
  display: flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.6; /* הגדלת line-height למניעת חיתוך */
  min-height: 2em; /* הגדלת גובה מינימלי */
  padding-bottom: 0.2rem; /* הוספת padding-bottom נוסף */
}

.ad-price::after {
  content: '₪';
  font-size: 0.9em;
}

.ad-timestamp {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.ad-subcat {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-main);
}

.ad-subcat span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.ad-subcat i {
  color: var(--primary-color);
  font-size: 0.85rem;
}

.ad-tag {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.4rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-color);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* === תחתית האתר === */
footer {
  background: var(--main-bg) !important;
  color: #fff !important;
  padding: 0.8rem;
  text-align: center;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  min-height: 40px;
  border-top: none !important;
}

footer p {
  opacity: 0.9;
  margin: 0;
  line-height: 1.4;
  color: white;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.3rem;
}

.footer-links a {
  color: var(--white);
  opacity: 0.8;
  transition: var(--transition);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* === עדכון סגנון הפוטר === */
footer {
  background: #25273c !important;
  color: #fff !important;
  padding: 0.8rem;
  text-align: center;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  min-height: 40px;
}

footer p {
  opacity: 0.9;
  margin: 0;
  line-height: 1.4;
  color: white;
  font-size: 0.9rem;
}

/* === עדכון סגנון כפתור התחברות === */
#loginBtn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: var(--text-primary);
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#loginBtn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#loginBtn i {
  font-size: 1.1rem;
}

/* === סגנון מודל קטגוריות === */
.categories-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.categories-modal.show {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.categories-content {
  background: var(--card-bg) !important;
  padding: 2rem;
  border-radius: var(--border-radius) !important;
  width: 90%;
  max-width: 800px;
  position: relative;
  margin: 40px auto;
  box-shadow: var(--shadow) !important;
  color: var(--text-main) !important;
  border: 1.5px solid var(--secondary) !important;
  backdrop-filter: var(--modal-blur);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-height: 70vh;
  overflow-y: auto;
}

.category-item {
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(47, 79, 79, 0.12);
  background: #fff;
  border-color: var(--primary-color, #2f4f4f);
}

.category-item:active {
  transform: translateY(0);
}

.category-icon {
  font-size: 1.85rem;
  color: var(--primary-color, #2f4f4f);
  margin-bottom: 0.65rem;
}

.category-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.3;
}

#categorySpecificFilters {
  display: none;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  margin: 0.5rem 0 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(184, 193, 236, 0.2);
  border-radius: 10px;
}

#categorySpecificFilters .filter-group {
  margin: 0;
}

.nav-category-link {
  font-weight: 600;
}

.close-categories {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary) !important;
  color: #fff !important;
  border: 1.5px solid #fff !important;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-categories:hover {
  color: #333;
}

.categories-title {
  text-align: center;
  margin-bottom: 2rem;
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 600;
}

/* === סגנונות בסיסיים === */
@media (max-width: 768px) {
  html {
    overflow-x: hidden;
  }
  
  body {
overflow-x: hidden;
  }
  header {
padding: 0.3rem 0.5rem;
height: auto;
min-height: 0;
border: none;
  }
  .nav-item {
font-size: 0.85rem;
padding: 6px 8px;
min-width: unset;
flex: 1 1 40%;
justify-content: center;
  }
  .post-ad-btn {
width: auto !important;
margin: 0 !important;
justify-content: flex-start;
display: flex !important;
  }
  .add-btn-container {
position: fixed;
bottom: 16px;
right: 16px;
z-index: 9999;
background: var(--primary-color);
border-radius: 50px;
box-shadow: var(--shadow-lg);
padding: 0 18px 0 10px;
min-width: 0;
height: 48px;
gap: 8px;
display: flex !important;
align-items: center;
  }
  .add-btn {
width: 38px;
height: 38px;
font-size: 22px;
  border-radius: 50%;
border: 2px solid var(--white);
background: var(--primary-color);
color: var(--white);
margin: 0;
padding: 0;
  }
  .add-btn-text {
display: none;
  }
  .ads {
grid-template-columns: 1fr;
gap: 0.7rem;
padding: 0.5rem 0.2rem 1.5rem 0.2rem;
  }
  .ad {
margin-bottom: 0.5rem;
border-radius: 10px;
min-width: 0;
box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  }
  .ad-img-container {
padding-top: 60%;
background: #f5f5f5;
  }
  .ad-img-container img {
border-radius: 0;
  }
  .ad-content {
padding: 0.7rem 0.5rem 1.5rem 0.5rem; /* הגדלת padding-bottom למניעת חיתוך */
overflow: visible; /* הבטחת תצוגה מלאה של התוכן */
  }
  .ad h3 {
font-size: 1rem;
margin-bottom: 0.3rem;
line-height: 1.2;
  }
  .ad-price {
font-size: 1rem;
margin-top: 0.4rem;
margin-bottom: 0.3rem; /* הגדלת margin-bottom למניעת חיתוך */
line-height: 1.6; /* הגדלת line-height למניעת חיתוך */
min-height: 1.8em; /* הגדלת גובה מינימלי */
padding-bottom: 0.15rem; /* הוספת padding-bottom נוסף */
  }
  .ad-location {
font-size: 0.9rem;
margin-top: 0.2rem;
  }
  .ad-timestamp {
font-size: 0.8rem;
margin-top: 0.2rem;
  }
  .status-badge {
top: 6px;
right: 6px;
font-size: 0.75rem;
padding: 4px 8px;
border-radius: 14px;
  }
  .modal-content {
width: 99%;
margin: 8px auto;
padding: 0.7rem 0.5rem;
max-width: 98vw;
max-height: 95vh;
border-radius: 10px;
  }
  #adModal .modal-content,
  #wantedAdModal .modal-content {
max-width: 99vw;
padding: 0.7rem 0.5rem;
overflow-x: hidden;
width: 100%;
box-sizing: border-box;
  }
  .form-group label {
font-size: 0.95rem;
margin-bottom: 3px;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
font-size: 15px;
padding: 7px 8px;
border-radius: 4px;
  }
  
  /* שיפור datalist במובייל - וידוא שהרשימה מופיעה מתחת לשדה */
  .form-group {
    position: relative;
    z-index: 1;
  }
  
  .form-group input[list] {
    position: relative;
    z-index: 2;
  }
  
  .form-group datalist {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--secondary);
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
  }
  .button-group {
flex-direction: column;
gap: 6px;
margin-top: 1rem;
  }
  .button-group button {
width: 100%;
font-size: 1rem;
margin: 0;
padding: 10px 0;
  }
  .google-signin-btn {
width: 100%;
font-size: 0.95rem;
padding: 8px 0;
  }
  .categories-content {
width: 99vw;
padding: 0.7rem 0.5rem;
max-width: 99vw;
  }
  .categories-grid {
grid-template-columns: repeat(2, 1fr);
gap: 0.5rem;
  }
  .category-item {
padding: 0.7rem;
  }
  .category-icon {
font-size: 1.1rem;
  }
  .category-name {
font-size: 0.9rem;
  }
  .pending-ads-container {
padding: 0.5rem;
margin: 0.5rem 0.2rem;
  }
  .pending-ads-title {
font-size: 1.1rem;
margin: 0.7rem 0;
  }
  .admin-actions {
flex-direction: column;
gap: 6px;
margin-top: 0.5rem;
padding: 0.3rem;
  }
  .admin-actions button {
width: 100%;
font-size: 0.95rem;
padding: 8px 0;
  }
  .no-ads-message {
font-size: 1rem;
padding: 1rem 0.2rem;
margin: 0.5rem 0.2rem;
  }
  footer {
font-size: 0.85rem;
padding: 0.5rem 0.2rem;
min-height: 30px;
  }
}

/* === תיקון סגנון מודעות ממתינות === */
.pending-ads-container {
  padding: 1rem;
}

.pending-ads-title {
  text-align: center;
  margin: 1rem 0;
  font-size: 1.5rem;
  color: #2f4f4f;
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .admin-actions {
flex-direction: column;
  }

  .admin-actions button {
width: 100%;
  }
}

.status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-badge.pending {
  color: #e67e22;
  border: 1px solid #e67e22;
}

.status-badge.rejected {
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

.status-badge.approved {
  color: #2ecc71;
  border: 1px solid #2ecc71;
}

/* === סגנון כפתורי משתמש === */
.user-actions {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.8);
  border-radius: 8px;
}

.user-actions button {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.edit-ad-btn {
  background: #3498db;
  color: white;
}

.delete-ad-btn {
  background: #e74c3c;
  color: white;
}

.user-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.user-actions button i {
  font-size: 1.1rem;
}

/* === התאמות למובייל === */
@media (max-width: 768px) {
  header {
padding: 0.5rem;
height: auto;
flex-wrap: wrap;
justify-content: center;
gap: 8px;
  }

  .nav-item {
font-size: 0.85rem;
padding: 8px;
  }

  .post-ad-btn {
width: 100%;
margin: 8px 0;
justify-content: center;
  }

  .search-container {
width: 100%;
margin: 8px 0;
  }

  .search-input {
width: 100%;
  }
  
  .filter-section {
margin: 0.5rem;
padding: 0.8rem;
  }
  
  .filter-group {
width: 100%;
  }
  
  .filter-select {
width: 100%;
font-size: 14px;
  }

  .ads {
grid-template-columns: 1fr;
gap: 1rem;
padding: 0.8rem;
  }

  .ad {
margin-bottom: 1rem;
  }

  .ad-content {
padding: 0.8rem;
padding-bottom: 1.5rem; /* הגדלת padding-bottom למניעת חיתוך */
overflow: visible; /* הבטחת תצוגה מלאה של התוכן */
  }

  .ad h3 {
font-size: 1rem;
margin-bottom: 0.4rem;
  }
  
  .modal-content {
width: 95%;
margin: 10px auto;
padding: 1rem;
max-height: 90vh;
overflow-y: auto;
  }
  
  .button-group {
flex-direction: column;
gap: 8px;
  }
  
  .button-group button {
width: 100%;
  }

  .admin-actions {
flex-direction: column;
gap: 8px;
margin-top: 0.8rem;
  }

  .admin-actions button {
width: 100%;
padding: 8px;
font-size: 0.9rem;
  }

  .categories-content {
width: 95%;
padding: 1rem;
  }

  .categories-grid {
grid-template-columns: repeat(2, 1fr);
gap: 0.8rem;
  }

  .category-item {
padding: 0.8rem;
  }

  .category-icon {
font-size: 1.2rem;
  }

  .category-name {
font-size: 0.9rem;
  }

  #adModal .form-group input,
  #adModal .form-group select,
  #adModal .form-group textarea {
font-size: 16px;
padding: 10px;
  }

  .file-input-group {
padding: 1rem;
  }
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.8);
  border-radius: 8px;
}

.admin-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.admin-actions button.approve-btn {
  background: #4caf50;
  color: white;
}

.admin-actions button.reject-btn {
  background: #f44336;
  color: white;
}

.admin-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.admin-actions button i {
  font-size: 1.1rem;
}

.no-ads-message {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 1rem;
}

/* === Skeleton Loaders === */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.1) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--border-radius);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-ad {
  height: 350px;
  margin-bottom: 1.5rem;
  border: 1.5px solid var(--secondary);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.medium {
  width: 80%;
}

.skeleton-text.long {
  width: 100%;
}

/* === Toast Notifications === */
.alert {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 500px;
  animation: slideInToast 0.3s ease-out;
  font-weight: 500;
}

@keyframes slideInToast {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.alert.success {
  background: #1ed760;
  color: #fff;
  border: none;
}

.alert.error {
  background: var(--primary);
  color: #fff;
  border: none;
}

.alert i {
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .alert {
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
  }
}

/* === אייקון המבורגר ותפריט צד למובייל === */
@media (max-width: 768px) {
  /* הסתרת כפתורי header במובייל */
  header .nav-item,
  header .post-ad-btn,
  #logoutBtn,
  #pendingAdsBtn,
  #loginBtn {
display: none !important;
  }
  /* שורה עליונה קבועה במובייל */
  header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: 52px !important;
    min-height: 52px !important;
    z-index: 998;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    padding: 0 60px 0 12px !important;
    background: var(--main-bg) !important;
    border-bottom: 1px solid rgba(255,255,255,0.15) !important;
    overflow: visible !important;
  }
  /* המייל מוצג בשורה העליונה */
  #userEmail {
    display: none;
    position: static !important;
    font-size: 0.85rem;
    color: #fff;
    background: none;
    padding: 0;
    margin: 0;
    max-width: calc(100vw - 130px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* טקסט "כניסה / הרשמה" כשלא מחובר */
  .mobile-login-label {
    display: inline;
    font-size: 0.85rem;
    color: #fff;
    cursor: pointer;
    padding: 4px 0;
  }
  .mobile-login-label.hidden {
    display: none !important;
  }
  /* מרווח עליון לתוכן מתחת לשורה הקבועה */
  .view-tabs {
    margin-top: 60px !important;
  }
  .filter-section {
    margin-top: 0 !important;
  }
  /* הצגת כפתור המבורגר */
  .mobile-menu-btn {
display: inline-flex !important;
position: fixed !important;
right: 8px;
/* top: 8px;*/
background: var(--main-bg) !important;
border: 2px solid #fff !important;
border-radius: 50%;
font-size: 1.3rem;
color: #fff !important;
z-index: 999;
align-items: center;
justify-content: center;
cursor: pointer;
width: 36px;
height: 36px;
box-sizing: border-box;
  }
  /* תפריט צד */
  .mobile-side-menu {
position: fixed;
top: 0;
right: 0;
width: 80vw;
max-width: 320px;
height: 100vh;
background: var(--header-bg) !important;
color: #fff !important;
border-left: 2px solid var(--primary) !important;
box-shadow: var(--shadow);
z-index: 1202;
transform: translateX(100%);
transition: transform 0.3s cubic-bezier(.4,0,.2,1);
display: flex;
flex-direction: column;
padding: 0;
overflow: hidden;
  }
  .mobile-side-menu.open {
transform: translateX(0);
  }
  .mobile-menu-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.25);
z-index: 1200;
  }
  .mobile-menu-overlay.show {
display: block;
  }
  .close-mobile-menu {
background: none !important;
border: none !important;
font-size: 2.2rem;
color: white !important;
position: absolute !important;
top: 12px !important;
left: 16px !important;
right: auto !important;
cursor: pointer;
z-index: 100;
padding: 8px;
line-height: 1;
width: auto;
height: auto;
margin: 0 !important;
flex: none !important;
order: 0 !important;
  }
  #mobileMenuContent {
display: flex;
flex-direction: column;
gap: 0.7rem;
padding: 3.5rem 1.5rem 4rem 1.5rem;
font-size: 1.1rem;
overflow-y: auto;
color: #fff;
  }
  #mobileMenuContent .menu-link {
display: flex;
align-items: center;
gap: 10px;

color: var(--primary-color);
font-weight: 500;
font-size: 1.1rem;
border-bottom: 1px solid #f0f0f0;
background: none;
border-radius: 0;
text-align: right;
cursor: pointer;
transition: background 0.15s;
padding-right: 12.5rem;
padding-bottom: 0.8rem;
  }
  #mobileMenuContent .menu-link:last-child {
margin-bottom: 1rem;
  }
  #mobileMenuContent .menu-link:hover {
background: #f8f9fa;
  }
  #mobileMenuContent .menu-user {
color: #fff !important;
font-size: 0.98rem;
margin-bottom: 0.5rem;
margin-top: 0.2rem;
text-align: right;
direction: rtl;
  }
  #mobileMenuContent .menu-admin {
color: #fff !important;
font-size: 0.95rem;
margin-bottom: 0.5rem;
text-align: right;
opacity: 0.9;
  }
}

@media (min-width: 769px) {
  .post-ad-btn {
width: auto !important;
display: flex !important;
margin-top: 0 !important;
  }
  .close-mobile-menu {
display: none !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  header {
    gap: 0.2rem;
  }
  .nav-item {
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
  }
  .post-ad-btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
  }
  #userEmail {
    max-width: 160px;
    font-size: 0.78rem;
  }
  .filter-section {
    gap: 0.75rem 1rem;
    padding: 0.9rem 1.2rem;
    margin: 1rem 1rem;
  }
  
  .filter-group {
    flex: 1 1 200px;
  }
  
  .search-input-wrapper {
    flex: 1 1 auto;
    width: 100%;
  }
  
  .filter-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
    margin-inline-start: 0;
  }
  
  .filter-button {
    min-width: 110px;
  }
}

@media (max-width: 768px) {
  /* 1. תיקון שדה קטגוריות וסינון */
  .filter-section {
flex-direction: column;
align-items: stretch;
gap: 0.5rem;
padding: 0.7rem 0.3rem 0.7rem 0.3rem;
margin: 0.5rem 0.2rem 0.5rem 0.2rem;
overflow-x: unset;
  }
  .filter-group {
width: 100%;
min-width: 0;
flex: 1 1 100%;
gap: 0.3rem;
  }
  .filter-label {
min-width: 70px;
font-size: 1rem;
margin-left: 0.5rem;
white-space: nowrap;
  }
  .filter-select {
width: 100%;
min-width: 0;
font-size: 1rem;
padding: 8px 10px;
border-radius: 6px;
direction: rtl;
text-align: right;
background: #fff;
box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .search-input-wrapper {
width: 100%;
  }
  .search-input-text {
width: 100%;
font-size: 1rem;
padding: 8px 2.5rem 8px 10px;
  }
  
  /* שדות תתי-קטגוריות במובייל */
  #categorySpecificFields,
  #categorySpecificFilters {
    width: 100%;
  }
  
  #categorySpecificFilters {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  #categorySpecificFilters .filter-group {
    width: 100%;
    min-width: 0;
  }
  
  #categorySpecificFilters input[type="number"],
  #categorySpecificFilters input[type="text"] {
    width: 100%;
    font-size: 1rem;
    padding: 8px 10px;
    direction: rtl;
    text-align: right;
  }
  
  /* Mobile car plate number field styling */
  #carPlateNumberGroup {
    width: 100% !important;
    margin-bottom: 1rem !important;
  }
  
  #carPlateNumberGroup label {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
  }
  
  #carPlateNumberGroup > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }
  
  #carPlateNumber {
    width: 100% !important;
    font-size: 1rem !important;
    padding: 12px !important;
    min-height: 44px !important;
    border-radius: 8px !important;
  }
  
  #lookupCarBtn {
    width: 100% !important;
    padding: 12px !important;
    font-size: 1rem !important;
    min-height: 44px !important;
    border-radius: 8px !important;
    white-space: normal !important;
  }
  
  #carPlateNumberGroup > div:last-child {
    font-size: 0.9rem !important;
    margin-top: 0.5rem !important;
    padding: 0.5rem !important;
  }
  
  /* כפתורי סינון במובייל */
  .filter-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.3rem 0 0;
  }
  .filter-section .filter-button {
width: 100% !important;
font-size: 1rem !important;
padding: 10px !important;
margin: 0 !important;
border-radius: 8px !important;
text-align: center !important;
display: block !important;
  }
  /* 2. עיצוב כפתורי תפריט צד */
  #mobileMenuContent .menu-link {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 0 14px 0;
color: var(--primary-color);
font-weight: 500;
font-size: 1.13rem;
border-bottom: 1px solid #f0f0f0;
background: none;
border-radius: 8px;
text-align: right;
cursor: pointer;
transition: background 0.15s, color 0.15s;
margin-bottom: 4px;
  }
  #mobileMenuContent .menu-link:last-child {
margin-bottom: 1rem;
  }
  #mobileMenuContent .menu-link:hover,
  #mobileMenuContent .menu-link:active {
background: #eaf3f3;
color: #1a2c2c;
  }
  #mobileMenuContent .menu-link i {
font-size: 1.25em;
color: var(--primary-color);
margin-left: 6px;
  }
  /* עיצוב מייל ושם משתמש בתפריט */
  #mobileMenuContent .menu-user {
color: #fff !important;
font-size: 0.98rem;
margin-bottom: 0.5rem;
margin-top: 0.2rem;
text-align: right;
direction: rtl;
  }
  #mobileMenuContent .menu-admin {
color: #fff !important;
font-size: 0.95rem;
margin-bottom: 0.5rem;
text-align: right;
opacity: 0.9;
  }
  /* הסתרת כפתור המבורגר כשמודל כלשהו פתוח */
  .mobile-menu-btn.hide-for-modal {
    display: none !important;
  }
  /* 3. כפתור המבורגר תמיד מוצג */
  .mobile-menu-btn {
display: inline-flex !important;
position: fixed !important;
right: 8px;
/*top: 8px;*/
background: var(--main-bg) !important;
border: 2px solid #fff !important;
border-radius: 50%;
font-size: 1.3rem;
color: #fff !important;
z-index: 999;
align-items: center;
justify-content: center;
cursor: pointer;
width: 36px;
height: 36px;
box-sizing: border-box;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
transition: background 0.15s, box-shadow 0.15s;
  }
  .mobile-menu-btn:active,
  .mobile-menu-btn:hover {
background: rgba(255,255,255,0.15) !important;
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  }
  /* 4. כפתור X במודל הוספת מודעה תמיד מוצג */
  #adModal .close-modal {
position: absolute !important;
top: 15px;
left: 15px;
right: auto;
z-index: 4000;
background: #fff !important;
border-radius: 50%;
border: 1px solid #e0e0e0;
font-size: 1.8rem;
color: #333;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
transition: all 0.2s ease;
cursor: pointer;
  }
  #adModal .close-modal:hover {
background: #f8f9fa !important;
color: #000 !important;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
transform: scale(1.05);
  }
}

  
/* 1. עיצוב כפתור המבורגר */
@media (max-width: 768px) {
  .mobile-menu-btn i {
    color: #fff !important;
  }
}

/* הסתרת תפריט הצד והמבורגר בדסקטופ - הם מיועדים למובייל בלבד.
   ללא זה, ה-nav (שמתמלא תוכן ע"י renderMobileMenuContent) מוצג בזרימה הרגילה בתחתית העמוד. */
@media (min-width: 769px) {
  .mobile-side-menu,
  .mobile-menu-overlay,
  .mobile-menu-btn {
    display: none !important;
  }
}

/* 2. עיצוב כפתור סגירה של כל המודלים */
.close-modal,
.close-categories,
.close-auth-modal {
  position: absolute;
  top: 15px;
  left: 15px;
  right: auto;
  background: #fff !important;
  color: #232946 !important;
  border: 2px solid #fff !important;
  border-radius: 50% !important;
  font-size: 1.4rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.15s, box-shadow 0.15s;
  z-index: 4000;
}
.close-modal:hover,
.close-categories:hover,
.close-auth-modal:hover {
  background: #f8f9fa !important;
  color: #000 !important;
}

/* 3. מסגרת לבנה דקה סביב כפתור התחבר במודל התחברות וסביב כפתורי הסינון */
#loginButton {
  border: 1.5px solid #fff !important;
  border-radius: 24px !important;
  background: none !important;
  color: #fff !important;
  font-weight: 700;
}
#loginButton:hover {
  background: #fff !important;
  color: var(--main-bg) !important;
}
.filter-button {
  border: 1.5px solid #fff !important;
  border-radius: 24px !important;
  background: none !important;
  color: #ff5f7e !important;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-button:hover {
  background: #ff5f7e !important;
  color: #fff !important;
}

/* === שדות תתי-קטגוריות דינמיים === */
#categorySpecificFields,
#categorySpecificFilters {
  display: none;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#categorySpecificFields .form-group {
  margin-bottom: 1rem;
}

#adModal #categorySpecificFields label,
#adModal #categorySpecificFields .category-fields-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

#categorySpecificFields label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.category-fields-section {
  margin: 0.5rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.category-fields-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.category-fields-section-title i {
  color: var(--primary);
}

.category-fields-subgroup {
  margin-bottom: 1rem;
}

.category-fields-subgroup:last-child {
  margin-bottom: 0;
}

.category-fields-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

.required-mark {
  color: #ff6b6b;
}

#streetGroup.category-fields-subgroup label {
  color: rgba(255, 255, 255, 0.88);
}

#categorySpecificFields select,
#categorySpecificFields input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

/* Chips לבחירת סוג נכס / חדרים */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
  line-height: 1.2;
}

.chip-btn i {
  font-size: 0.85rem;
  opacity: 0.85;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
}

.chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip-btn.active i {
  opacity: 1;
}

.chip-btn--all {
  font-weight: 600;
}

#categorySpecificFilters .chip-btn {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--secondary);
}

#categorySpecificFilters .chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

#categorySpecificFilters .filter-group--full {
  flex: 1 1 100%;
  min-width: 100%;
}

@media (min-width: 769px) {
  #categorySpecificFilters .filter-group--full {
    grid-column: 1 / -1;
  }
}

/* Combobox לחיפוש חברת רכב */
.combobox-wrap {
  position: relative;
}

.combobox-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
}

.combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--card-bg, #fff);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.combobox-option {
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  color: #222;
  font-size: 0.95rem;
}

.combobox-option:hover,
.combobox-option:focus {
  background: rgba(0, 0, 0, 0.06);
}

.combobox-option--empty {
  color: #888;
  cursor: default;
}

#adModal .combobox-input,
#adModal #categorySpecificFields select {
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  border-color: rgba(255, 255, 255, 0.3);
}

#categorySpecificFilters {
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Desktop layout for car filters - organized grid */
@media (min-width: 769px) {
  #categorySpecificFilters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: start;
  }
  
  #categorySpecificFilters .filter-group {
    min-width: 180px;
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  #categorySpecificFilters .filter-label {
    font-size: 0.9rem;
    white-space: nowrap;
  }
  
  #categorySpecificFilters .filter-select,
  #categorySpecificFilters input[type="text"],
  #categorySpecificFilters input[type="number"] {
    width: 100%;
    min-width: 0;
  }
}

#categorySpecificFilters .filter-group {
  min-width: 150px;
  flex: 1 1 auto;
}

#categorySpecificFilters input[type="number"],
#categorySpecificFilters input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

#categorySpecificFilters input[type="number"]:focus,
#categorySpecificFilters input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 95, 126, 0.2);
}

#categorySpecificFilters input[type="number"]::placeholder,
#categorySpecificFilters input[type="text"]::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* עדכון צבע טקסט במודל התחברות */
.modal-content {
  color: #fff !important;
}
.modal-content h3 {
  color: #fff !important;
}
.modal-content label {
  color: #fff !important;
}
.modal-content input {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  font-size: 16px !important;
}
.modal-content select,
.modal-content textarea {
  font-size: 16px !important;
}
.modal-content input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}
.auth-toggle-link {
  color: #fff !important;
}
.auth-toggle-link a {
  color: #fff !important;
  text-decoration: underline;
}
.auth-divider span {
  background: var(--main-bg) !important;
  color: #fff !important;
}
.auth-divider::before,
.auth-divider::after {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* Media Queries */
@media (max-width: 768px) {
  /* Modal styles */
  .modal {
padding: 0;
  }

  .modal-content {
width: 100%;
max-width: 100%;
margin: 0;
height: 100vh;
max-height: 100vh;
border-radius: 0;
overflow-y: auto;
overflow-x: hidden;
  }

  /* Ad Modal & Wanted Modal specific styles */
  #adModal .modal-content,
  #wantedAdModal .modal-content {
width: 100%;
max-width: 100%;
margin: 0;
height: 100vh;
max-height: 100vh;
border-radius: 0;
overflow-y: auto;
overflow-x: hidden;
  }

  #adModal .form-group,
  #wantedAdModal .form-group {
margin-bottom: 1rem;
position: relative;
z-index: 1;
  }

  #adModal .form-group input,
  #adModal .form-group select,
  #adModal .form-group textarea {
font-size: 16px;
padding: 10px;
  }
  
  /* שיפור datalist במובייל במודל - וידוא שהרשימה מופיעה מתחת לשדה */
  #adModal .form-group input[list] {
    position: relative;
    z-index: 2;
  }
  
  #adModal .form-group datalist {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--secondary);
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
  }

  #adModal .file-input-group {
padding: 1rem;
  }

  #adModal .progress-container {
margin: 0.5rem 0;
  }

  #adModal .close-modal {
top: 15px;
left: 15px;
right: auto;
width: 36px;
height: 36px;
font-size: 1.6rem;
  }

  /* Header and Navigation */
  header {
padding: 0.5rem;
  }

  .nav-item,
  .post-ad-btn {
padding: 0.5rem 1rem;
font-size: 1rem;
  }

  .search-container {
margin: 0.5rem 0;
  }

  .search-input {
width: 100%;
  }

  /* Card and Grid Layouts */
  .card {
width: 100%;
margin: 0.5rem 0;
  }

  .grid {
grid-template-columns: 1fr;
gap: 1rem;
  }

  /* Form Elements */
  .form-group {
margin-bottom: 1rem;
  }

  input, select, textarea {
font-size: 16px;
padding: 0.5rem;
  }

  /* Buttons */
  button {
width: 100%;
margin: 0.5rem 0;
  }

  /* Images and Media */
  img {
max-width: 100%;
height: auto;
  }

  /* Spacing and Layout */
  .container {
padding: 1rem;
  }

  .section {
margin: 1rem 0;
  }
}

/* === Banner להוספה למסך הבית (PWA Install Prompt) === */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  color: #fff;
  padding: 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.install-banner.show {
  transform: translateY(0);
  display: block !important;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.install-banner-icon {
  font-size: 2rem;
  color: #fff;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.install-banner-text strong {
  font-size: 1.1rem;
  font-weight: 700;
}

.install-banner-text span {
  font-size: 0.9rem;
  opacity: 0.9;
}

.install-banner-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.install-banner-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (min-width: 769px) {
  .install-banner {
    display: none !important;
  }
}

/* === כפתור טען עוד מודעות === */
.load-more-container {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}

.load-more-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.8rem 2rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.load-more-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* === באנר הסכמה לעוגיות === */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #1a1d2e;
  border-top: 1px solid rgba(184, 193, 236, 0.2);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-banner-content {
  max-width: 900px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cookie-banner-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cookie-banner-content p a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-banner-buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: var(--primary);
  color: #fff;
}

.cookie-btn-accept:hover {
  background: var(--primary-hover);
}

.cookie-btn-reject {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cookie-btn-reject:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

@media (max-width: 768px) {
  .cookie-banner {
    padding: 0.8rem;
  }
  .cookie-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
  .cookie-banner-content p {
    font-size: 0.82rem;
  }
  .cookie-banner-buttons {
    width: 100%;
    justify-content: center;
  }
  .cookie-btn {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
  }
  .footer-legal-links {
    gap: 0.8rem;
    margin-top: 0.3rem;
  }
  .footer-legal-links a {
    font-size: 0.72rem;
  }
}

/* === לינקים חוקיים בפוטר === */
.footer-legal-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.footer-legal-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s ease;
}

.footer-legal-links a:hover {
  color: #fff;
  text-decoration: underline;
}

/* === דפים חוקיים (פרטיות, תנאי שימוש, נגישות) === */
.legal-header {
  background: var(--main-bg);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(184, 193, 236, 0.2);
  text-align: center;
}

.legal-header h1 {
  color: #fff;
  font-size: 1.8rem;
  margin: 0.5rem 0 0;
}

.legal-back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease;
}

.legal-back-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.legal-content {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.legal-update-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(184, 193, 236, 0.15);
}

.legal-section h3 {
  color: var(--primary-light, #ff8fa5);
  font-size: 1.05rem;
  margin: 1rem 0 0.5rem;
}

.legal-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 0.6rem;
}

.legal-section ul {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  padding-right: 1.5rem;
  margin-bottom: 0.8rem;
}

.legal-section li {
  margin-bottom: 0.3rem;
}

.legal-section a {
  color: var(--primary);
  text-decoration: underline;
}

.legal-section a:hover {
  color: var(--primary-hover);
}

.legal-section strong {
  color: #fff;
}

@media (max-width: 768px) {
  .legal-header {
    padding: 1rem;
  }
  .legal-header h1 {
    font-size: 1.4rem;
  }
  .legal-content {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }
  .legal-section h2 {
    font-size: 1.15rem;
  }
}

/* === נגישות: קישור דילוג לתוכן === */
.skip-to-content {
  position: absolute;
  right: 8px;
  top: -48px;
  z-index: 10000;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 8px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* === נגישות: Focus Visible === */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* =============================================
   === לוח ביקושים - טאבים ===
   ============================================= */

.view-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 1.2rem auto 0.5rem;
  max-width: 500px;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 5px;
  border: 1.5px solid var(--secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.view-tab {
  flex: 1;
  padding: 0.7rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 11px;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
}

.view-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.view-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(255, 95, 126, 0.4);
}

.view-tab i {
  font-size: 0.9rem;
}

/* =============================================
   === לוח ביקושים - כפתור פרסם ביקוש ===
   ============================================= */

.wanted-header-bar {
  display: flex;
  justify-content: center;
  padding: 1rem 1rem 0.5rem;
}

.post-wanted-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  font-family: inherit;
}

.post-wanted-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* =============================================
   === לוח ביקושים - כרטיסיות ===
   ============================================= */

.wanted-ads-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.wanted-ad {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.wanted-ad:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(102, 126, 234, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.wanted-ad-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 0.25rem 0.7rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.wanted-ad-badge-pending {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.wanted-ad-pending {
  border-color: rgba(245, 158, 11, 0.4);
}

.wanted-ad-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0.5rem 0;
  line-height: 1.5;
}

.wanted-ad-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.6rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wanted-ad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.wanted-ad-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.wanted-ad-meta span i {
  font-size: 0.7rem;
  color: var(--primary);
}

.wanted-ad-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.wanted-ad-comments {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.wanted-ad-comments i { font-size: 0.75rem; }

.wanted-ad-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

/* =============================================
   === לוח ביקושים - מודל טופס ביקוש ===
   ============================================= */

.wanted-modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

.budget-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.budget-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.budget-inputs input {
  flex: 1;
  min-width: 0;
}

.budget-separator {
  color: var(--text-secondary);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.budget-currency {
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
}

/* =============================================
   === רספונסיבי - מובייל ===
   ============================================= */

@media (max-width: 768px) {
  .view-tabs {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    max-width: 100%;
  }

  .view-tab {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .wanted-ads-list {
    grid-template-columns: 1fr;
    padding: 0.8rem;
    gap: 0.8rem;
  }

  .wanted-header-bar {
    padding: 0.8rem 0.8rem 0.3rem;
  }

  .post-wanted-btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem 1.5rem;
  }

  .wanted-ad {
    padding: 1rem;
  }

  .wanted-ad-title {
    font-size: 1rem;
  }

  .wanted-ad-meta {
    gap: 0.4rem;
  }

  .wanted-ad-meta span {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
  }

  .budget-inputs {
    flex-wrap: wrap;
  }

  .budget-inputs input {
    flex: 1 1 40%;
    min-width: 80px;
  }

  .wanted-modal-subtitle {
    font-size: 0.82rem;
  }
}

/* =========================================================
   === עמוד ניהול מודעות (admin-ads.html) ===
   ========================================================= */
.admin-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
  width: 100%;
}

.admin-header {
  text-align: center;
  margin-bottom: 1.8rem;
}
.admin-header h1 {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.admin-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.admin-stat-card {
  background: var(--card-bg);
  border: 1.5px solid var(--secondary);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(255, 95, 126, 0.15);
}
.admin-stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}
.admin-stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}
.admin-stat-approved { border-color: #22c55e88; }
.admin-stat-approved .admin-stat-value { color: #22c55e; }
.admin-stat-pending { border-color: #f59e0b88; }
.admin-stat-pending .admin-stat-value { color: #f59e0b; }
.admin-stat-rejected { border-color: #ef444488; }
.admin-stat-rejected .admin-stat-value { color: #ef4444; }

/* מסך אין-הרשאה / טעינה */
.admin-no-access,
.admin-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 0.8rem;
  color: var(--text-secondary);
}
.admin-no-access i,
.admin-loading i {
  font-size: 3rem;
  color: var(--primary);
}
.admin-no-access h2 {
  color: #fff;
  font-size: 1.4rem;
}
.admin-no-access .btn {
  margin-top: 0.8rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.admin-no-access .btn:hover { background: var(--primary-hover); }

/* סרגל פעולות */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: var(--card-bg);
  border: 1.5px solid var(--secondary);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
}
.admin-search-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
}
.admin-search-input {
  width: 100%;
  padding: 0.6rem 2.4rem 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 0.95rem;
}
.admin-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 95, 126, 0.18);
}
.admin-search-icon {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.admin-filter {
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 0.92rem;
  min-width: 140px;
}
.admin-filter option {
  color: #000;
}

/* סרגל פעולות מרובות */
.admin-bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(255,95,126,0.18), rgba(255,95,126,0.06));
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.8rem;
  position: sticky;
  top: 4px;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.admin-bulk-count {
  font-weight: 700;
  color: #fff;
  margin-inline-end: 0.4rem;
}

/* כפתורים */
.admin-btn {
  padding: 0.5rem 0.95rem;
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.12s, opacity 0.12s, background 0.12s;
  white-space: nowrap;
}
.admin-btn:hover { transform: translateY(-1px); }
.admin-btn:active { transform: translateY(0); }
.admin-btn-primary { background: var(--primary); color: #fff; }
.admin-btn-primary:hover { background: var(--primary-hover); }
.admin-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid var(--secondary);
}
.admin-btn-success { background: #22c55e; color: #fff; }
.admin-btn-success:hover { background: #16a34a; }
.admin-btn-warning { background: #f59e0b; color: #fff; }
.admin-btn-warning:hover { background: #d97706; }
.admin-btn-danger { background: #ef4444; color: #fff; }
.admin-btn-danger:hover { background: #dc2626; }

/* טבלה */
.admin-table-wrap {
  background: var(--card-bg);
  border: 1.5px solid var(--secondary);
  border-radius: 14px;
  overflow: auto;
  max-width: 100%;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  color: #fff;
  font-size: 0.92rem;
  min-width: 900px;
}
.admin-table thead th {
  position: sticky;
  top: 0;
  background: #1a2040;
  z-index: 2;
  text-align: right;
  padding: 0.85rem 0.75rem;
  font-weight: 700;
  border-bottom: 2px solid var(--secondary);
  color: var(--text-secondary);
}
.admin-table tbody td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(184,193,236,0.12);
  vertical-align: middle;
}
.admin-row {
  transition: background 0.1s;
}
.admin-row:hover {
  background: rgba(255, 95, 126, 0.06);
}
.admin-row.selected {
  background: rgba(255, 95, 126, 0.12);
}

.col-check { width: 40px; }
.col-image { width: 80px; }
.col-image img {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  cursor: pointer;
}
.admin-no-image {
  width: 70px;
  height: 50px;
  background: #121629;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
}
.col-title { min-width: 200px; max-width: 300px; cursor: pointer; }
.col-title .admin-title {
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-title .admin-subline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}
.col-cat, .col-loc { color: var(--text-secondary); }
.col-price { color: var(--primary); font-weight: 700; white-space: nowrap; }
.col-owner {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.col-date { color: var(--text-secondary); white-space: nowrap; font-size: 0.85rem; }
.col-actions {
  white-space: nowrap;
  text-align: left;
}

/* תגי סטטוס */
.status-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill.status-approved {
  background: rgba(34,197,94,0.18);
  color: #22c55e;
  border: 1px solid #22c55e55;
}
.status-pill.status-pending {
  background: rgba(245,158,11,0.18);
  color: #f59e0b;
  border: 1px solid #f59e0b55;
}
.status-pill.status-rejected {
  background: rgba(239,68,68,0.18);
  color: #ef4444;
  border: 1px solid #ef444455;
}

/* כפתורי פעולות בשורה */
.admin-icon-btn {
  border: none;
  background: rgba(255,255,255,0.06);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-end: 4px;
  transition: background 0.12s, transform 0.12s;
}
.admin-icon-btn:hover { transform: translateY(-1px); }
.admin-icon-approve { background: #22c55e; }
.admin-icon-approve:hover { background: #16a34a; }
.admin-icon-reject { background: #f59e0b; }
.admin-icon-reject:hover { background: #d97706; }
.admin-icon-view { background: rgba(184,193,236,0.18); }
.admin-icon-view:hover { background: rgba(184,193,236,0.32); }
.admin-icon-delete { background: #ef4444; }
.admin-icon-delete:hover { background: #dc2626; }

/* checkbox מותאם */
.admin-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.admin-loading-row {
  text-align: center !important;
  color: var(--text-secondary);
  padding: 2rem !important;
  font-size: 1rem;
}
.admin-loading-row.admin-error {
  color: #ef4444;
}

.admin-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  gap: 0.6rem;
}
.admin-empty i {
  font-size: 3rem;
  color: var(--secondary);
  opacity: 0.5;
}

.admin-results-info {
  text-align: center;
  margin-top: 0.8rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #3b82f6;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(120%);
  transition: transform 0.25s ease;
}
.admin-toast.show { transform: translateY(0); }

/* רספונסיבי */
@media (max-width: 1024px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-page { padding: 1rem 0.6rem 3rem; }
  .admin-header h1 { font-size: 1.5rem; }
  .admin-stat-value { font-size: 1.4rem; }
  .admin-toolbar { padding: 0.6rem; gap: 0.5rem; }
  .admin-search-wrap { flex: 1 1 100%; }
  .admin-filters { flex: 1 1 100%; }
  .admin-filter { flex: 1 1 calc(50% - 0.25rem); min-width: 0; }
  .admin-bulk-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .admin-bulk-actions .admin-btn { justify-content: center; }
  /* הסתרת עמודות פחות חיוניות במובייל */
  .admin-table .col-cat,
  .admin-table .col-loc,
  .admin-table .col-owner {
    display: none;
  }
}

/* מודרציית תגובות בדף ניהול */
.admin-comments-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--card-bg);
  border: 1.5px solid var(--secondary);
  border-radius: 14px;
}

.admin-comments-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-comments-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #fff;
  flex: 1 1 auto;
}

.admin-comments-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-comments-wrap {
  margin-top: 0.5rem;
}

.admin-comments-table {
  min-width: 600px;
}

.admin-comments-table .col-comment-text {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-comment-vis {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.admin-comments-table a {
  color: var(--primary);
  text-decoration: none;
}

.admin-comments-table a:hover {
  text-decoration: underline;
}

/* =========================================================
   2026 visual refresh
   A cohesive, accessible navy/pink design system.
   This final layer intentionally normalizes legacy overrides.
   ========================================================= */
html {
  background: var(--main-bg);
}

body {
  background: var(--main-bg) !important;
  color: var(--text-main) !important;
  letter-spacing: 0.005em;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-light);
}

/* Header and navigation */
header {
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  box-shadow: 0 8px 30px rgba(4, 7, 18, 0.14);
  min-height: 62px;
  padding-inline: clamp(0.75rem, 2vw, 1.5rem);
}

.nav-item,
.post-ad-btn {
  color: var(--text-secondary) !important;
  border-radius: 10px !important;
  padding: 0.58rem 0.85rem;
}

.nav-item:hover,
.nav-item:focus,
.post-ad-btn:hover,
.post-ad-btn:focus {
  color: var(--text-main) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  text-shadow: none;
}

.nav-item.active {
  color: var(--text-main) !important;
  background: var(--primary-soft) !important;
  border-bottom-color: var(--primary);
}

#loginBtn {
  color: var(--text-main) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--border-strong) !important;
  box-shadow: none;
}

/* Main sale/wanted switch */
.view-tabs {
  width: min(560px, calc(100% - 2rem));
  max-width: 560px;
  margin-top: 1.4rem;
  padding: 5px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.view-tab {
  min-height: 48px;
  border-radius: 12px;
  color: var(--text-secondary);
}

.view-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.view-tab.active {
  background: var(--primary);
  color: #171a2b;
  box-shadow: 0 8px 22px rgba(255, 120, 146, 0.24);
}

/* Filters and form controls */
.filter-section {
  width: min(1280px, calc(100% - 2rem));
  margin: 1.1rem auto;
  padding: 1.1rem 1.25rem;
  background: var(--filter-bg) !important;
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-sm);
}

.filter-label {
  color: var(--text-secondary) !important;
  font-size: 0.92rem;
  font-weight: 650;
}

.filter-select,
.search-input-text,
#categorySpecificFilters input[type="number"],
#categorySpecificFilters input[type="text"],
.combobox-input,
.form-group input,
.form-group select,
.form-group textarea,
.modal-content input,
.modal-content select,
.modal-content textarea {
  min-height: 44px;
  background: var(--input-bg) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 11px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.filter-select:hover,
.search-input-text:hover,
.combobox-input:hover,
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: rgba(193, 200, 231, 0.5) !important;
}

.filter-select:focus,
.search-input-text:focus,
#categorySpecificFilters input:focus,
.combobox-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: var(--focus-ring) !important;
}

.filter-select::placeholder,
.search-input-text::placeholder,
.combobox-input::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder,
.modal-content input::placeholder,
.modal-content textarea::placeholder {
  color: #929bbd !important;
  opacity: 1;
}

select option {
  background: var(--card-bg);
  color: var(--text-main);
}

.filter-actions {
  gap: 0.65rem;
}

.filter-button {
  min-height: 42px;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--border-strong) !important;
  border-radius: 11px !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 0.95rem;
  font-weight: 650;
}

.filter-actions .filter-button:first-child {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #171a2b !important;
  font-weight: 750;
}

.filter-button:hover,
.filter-button:focus {
  transform: translateY(-1px);
  background: var(--surface-hover) !important;
  border-color: var(--primary) !important;
  color: var(--text-main) !important;
}

.filter-actions .filter-button:first-child:hover,
.filter-actions .filter-button:first-child:focus {
  background: var(--primary-hover) !important;
  color: #171a2b !important;
}

#categorySpecificFilters {
  background: rgba(12, 16, 31, 0.3);
  border-color: var(--border-subtle);
  border-radius: 14px;
}

/* Cards */
.ads {
  width: min(1320px, 100%);
  margin-inline: auto;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  gap: clamp(0.9rem, 1.6vw, 1.35rem);
}

.ad {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-sm) !important;
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ad:hover {
  transform: translateY(-4px);
  border-color: var(--primary-border) !important;
  box-shadow: var(--shadow-md) !important;
}

.ad-img-container {
  background: #0f1323 !important;
}

.ad-img-container img {
  transition: transform 0.35s ease;
}

.ad:hover .ad-img-container img {
  transform: scale(1.025);
}

.ad-content {
  padding: 1rem 1.05rem 1.15rem;
}

.ad h3 {
  color: var(--text-main) !important;
  font-size: 1.08rem;
}

.ad-content p {
  color: var(--text-secondary);
}

.ad-location,
.ad-subcat {
  color: var(--text-secondary) !important;
}

.ad-price {
  color: var(--primary-light) !important;
  font-size: 1.15rem;
}

.ad-subcat span,
.wanted-ad-meta span {
  padding: 0.28rem 0.55rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
}

.ad-timestamp,
.wanted-ad-time {
  color: #8f98ba;
}

.status-badge {
  background: rgba(21, 25, 43, 0.9);
  backdrop-filter: blur(8px);
}

.no-ads-message {
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
}

/* Wanted ads use the same visual language */
.post-wanted-btn {
  background: var(--primary);
  color: #171a2b;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(255, 120, 146, 0.2);
}

.post-wanted-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 12px 28px rgba(255, 120, 146, 0.26);
}

.wanted-ad {
  background: var(--card-bg);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.wanted-ad:hover {
  background: var(--surface-raised);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.wanted-ad-badge {
  background: var(--primary-soft);
  color: var(--primary-light);
  border: 1px solid var(--primary-border);
}

/* Chips and dynamic selectors */
.chip-btn,
#categorySpecificFilters .chip-btn {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.chip-btn:hover,
#categorySpecificFilters .chip-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--primary-border);
}

.chip-btn.active,
#categorySpecificFilters .chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #171a2b;
  font-weight: 750;
}

.category-fields-section {
  background: rgba(12, 16, 31, 0.32);
  border-color: var(--border-subtle);
  border-radius: 14px;
}

.combobox-dropdown {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.combobox-option {
  color: var(--text-main);
}

.combobox-option:hover,
.combobox-option:focus {
  background: var(--surface-hover);
}

/* Modal and category picker */
.modal,
.categories-modal {
  background: rgba(5, 8, 18, 0.74);
  backdrop-filter: blur(8px);
}

.modal-content,
.categories-content {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-lg) !important;
}

.modal-content h3,
.categories-title {
  color: var(--text-main) !important;
}

.modal-content label,
#adModal .form-group label,
#adModal #categorySpecificFields label {
  color: var(--text-secondary) !important;
}

.close-modal,
.close-categories,
.close-auth-modal,
#adModal .close-modal {
  background: var(--surface-raised) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-strong) !important;
  box-shadow: var(--shadow-sm);
}

.close-modal:hover,
.close-categories:hover,
.close-auth-modal:hover,
#adModal .close-modal:hover {
  background: var(--surface-hover) !important;
  color: var(--primary-light) !important;
  border-color: var(--primary) !important;
}

.category-item {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

.category-item:hover {
  background: var(--surface-hover);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.category-icon {
  color: var(--primary);
}

.category-name {
  color: var(--text-main);
}

#adModal .file-input-group {
  background: rgba(12, 16, 31, 0.28);
  border-color: var(--border-strong);
  border-radius: 14px;
}

#adModal .file-input-group:hover {
  background: var(--primary-faint);
  border-color: var(--primary);
}

#adModal .file-name {
  color: var(--text-secondary);
}

.btn-primary {
  background: var(--primary);
  color: #171a2b;
  font-weight: 750;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-raised);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

#loginButton {
  background: var(--primary) !important;
  color: #171a2b !important;
  border-color: var(--primary) !important;
}

.auth-divider span {
  background: var(--card-bg) !important;
  color: var(--text-secondary) !important;
}

.auth-toggle-link,
.auth-toggle-link a,
.forgot-password a {
  color: var(--text-secondary) !important;
}

.auth-toggle-link a:hover,
.forgot-password a:hover {
  color: var(--primary-light) !important;
}

/* Footer, legal pages and cookie notice */
footer {
  background: #111525 !important;
  border-top: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  padding: 1rem;
}

.legal-header {
  background: var(--header-bg);
  border-bottom-color: var(--border-subtle);
}

.legal-content {
  width: min(820px, calc(100% - 2rem));
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.cookie-banner {
  background: rgba(17, 21, 37, 0.97);
  border-top-color: var(--border-subtle);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(12px);
}

.cookie-btn-accept {
  background: var(--primary);
  color: #171a2b;
}

.cookie-btn-accept:hover {
  background: var(--primary-hover);
}

.cookie-btn-reject {
  background: var(--surface-raised);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

/* Admin surfaces */
.admin-toolbar,
.admin-stat-card,
.admin-table-wrap,
.admin-comments-section {
  background: var(--card-bg);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.admin-table th {
  background: #191e34;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.045);
}

/* Mobile refinement */
@media (max-width: 768px) {
  header {
    background: var(--header-bg) !important;
    border-bottom-color: var(--border-subtle) !important;
  }

  .view-tabs {
    width: calc(100% - 1rem);
    margin-top: 60px !important;
    margin-bottom: 0.75rem;
  }

  .view-tab {
    min-height: 44px;
    padding: 0.6rem 0.7rem;
  }

  .filter-section {
    width: calc(100% - 1rem);
    margin: 0.5rem auto 0.75rem;
    padding: 0.9rem;
    gap: 0.8rem;
    border-radius: 16px !important;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.38rem;
  }

  .filter-label {
    min-width: 0;
    margin: 0;
    font-size: 0.86rem;
  }

  .chip-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .chip-btn,
  #categorySpecificFilters .chip-btn {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
  }

  .filter-select,
  .search-input-text {
    min-height: 46px;
    padding-block: 0.65rem;
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
    box-shadow: none;
  }

  .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.55rem;
    margin-top: 0.15rem;
  }

  .filter-section .filter-button {
    width: auto !important;
    min-height: 44px;
    padding: 0.6rem !important;
    border-radius: 11px !important;
  }

  .ads {
    padding: 0.25rem 0.5rem 1.25rem;
    gap: 0.85rem;
  }

  .ad {
    margin-bottom: 0;
    border-radius: 16px !important;
  }

  .ad-content {
    padding: 0.85rem 0.9rem 1rem;
  }

  .mobile-menu-btn {
    background: var(--surface-raised) !important;
    border: 1px solid var(--border-strong) !important;
    box-shadow: var(--shadow-sm);
  }

  .mobile-side-menu {
    background: var(--header-bg) !important;
    border-left: 1px solid var(--border-subtle) !important;
    box-shadow: var(--shadow-lg);
  }

  #mobileMenuContent .menu-link {
    color: var(--text-main);
    border-bottom-color: var(--border-subtle);
    border-radius: 10px;
    padding: 0.8rem 0.65rem;
  }

  #mobileMenuContent .menu-link:hover,
  #mobileMenuContent .menu-link:active {
    background: var(--surface-raised);
    color: var(--primary-light);
  }

  #mobileMenuContent .menu-link i {
    color: var(--primary);
  }

  .modal-content,
  #adModal .modal-content,
  #wantedAdModal .modal-content {
    background: var(--card-bg) !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .categories-modal {
    padding: 0.5rem;
  }

  .categories-content {
    width: 100%;
    max-width: 100%;
    margin: 0.5rem auto;
    padding: 1rem 0.7rem;
  }

  .categories-grid {
    gap: 0.65rem;
    padding: 0.5rem;
  }

  .category-item {
    min-height: 92px;
    padding: 0.85rem 0.55rem;
  }

  .category-icon {
    font-size: 1.35rem;
  }

  .cookie-banner {
    padding: 0.55rem 0.7rem;
  }

  .cookie-banner-content {
    gap: 0.55rem;
  }

  .cookie-banner-content p {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .cookie-banner-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.45rem;
  }

  .cookie-btn {
    min-height: 38px;
    padding: 0.4rem 0.75rem;
  }

  .legal-content {
    width: calc(100% - 1rem);
    margin: 0.75rem auto 1.5rem;
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.location-autocomplete-dropdown {
  position: fixed;
  z-index: 10020;
  margin: 0;
  padding: 0.35rem;
  overflow-y: auto;
  direction: rtl;
  list-style: none;
  color: var(--text-main);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overscroll-behavior: contain;
}

.location-autocomplete-dropdown[hidden] {
  display: none;
}

.location-autocomplete-option {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.35;
  text-align: right;
}

.location-autocomplete-option:hover,
.location-autocomplete-option.active {
  color: var(--text-main);
  background: var(--surface-hover);
}

