:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(16, 185, 129, 0.35);

  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;
  --danger: #ef4444;

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --font-family: 'Tajawal', 'Outfit', system-ui, -apple-system, sans-serif;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 1.9rem;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #d1fae5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--accent-emerald);
  display: block;
}

/* Search bar */
.search-bar {
  flex: 1;
  max-width: 540px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar input {
  width: 100%;
  padding: 10px 18px 10px 48px;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: #fff;
  font-size: 0.92rem;
  font-family: inherit;
  transition: var(--transition);
}

.search-bar input:focus {
  outline: none;
  background: rgba(31, 41, 55, 0.95);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.search-bar .btn-icon {
  position: absolute;
  left: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(31, 41, 55, 0.7);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(55, 65, 81, 0.9);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.22);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.btn-outline {
  background: transparent;
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
}

.btn-outline:hover {
  background: rgba(16, 185, 129, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
}

.user-pill .user-name {
  color: #d1fae5;
  font-weight: 600;
}

/* Categories strip */
.categories-bar {
  border-top: 1px solid var(--border-color);
  padding: 8px 24px;
  overflow-x: auto;
}

.categories-list {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-pill {
  background: rgba(31, 41, 55, 0.5);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.cat-pill:hover,
.cat-pill.active {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* Main Feed */
.main-container {
  max-width: 1380px;
  margin: 28px auto 60px;
  padding: 0 24px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.feed-controls {
  display: flex;
  gap: 10px;
}

/* Map Strip */
.map-strip {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 28px;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent-cyan);
}

.map-pins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.map-pin-item {
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.map-pin-item:hover {
  border-color: var(--accent-cyan);
  background: rgba(31, 41, 55, 0.95);
  transform: translateY(-2px);
}

.pin-thumb {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #1f2937;
}

.pin-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
}

.pin-info span {
  font-size: 0.78rem;
  color: var(--accent-emerald);
}

/* Ads Grid */
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.ad-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}

.ad-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.ad-media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #1f2937;
  overflow: hidden;
}

.ad-media-wrapper img,
.ad-media-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid var(--border-color);
}

.ad-media-type {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.65);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #e5e7eb;
}

.ad-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ad-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-emerald);
  margin-bottom: 6px;
}

.ad-price small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.ad-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
  color: #ffffff;
}

.ad-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ad-location {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

/* Modals */
.modal-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  transition: opacity 0.2s ease;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-card.modal-lg {
  max-width: 760px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.92rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-group .hint {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.template-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: rgba(31, 41, 55, 0.45);
  font-size: 0.84rem;
}

.template-status.loading {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.template-status.success,
.template-status.info {
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.template-status.error {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
}

.dynamic-ad-fields {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.template-step {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(31, 41, 55, 0.25);
}

.template-step h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: #fff;
}

.template-step-description {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.template-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.template-field {
  min-width: 0;
  margin-bottom: 0;
}

.template-field:has(textarea),
.template-media-field,
.template-field:has(.template-choice-list) {
  grid-column: 1 / -1;
}

.template-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.template-choice-list label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  margin: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
}

.template-choice-list input,
.template-checkbox {
  width: auto !important;
  accent-color: var(--accent-emerald);
}

.template-media-upload {
  position: relative;
  padding: 18px;
  border: 2px dashed rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-secondary);
  background: rgba(16, 185, 129, 0.04);
  overflow: hidden;
}

.template-media-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 14px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* Coordinates box */
.coords-box {
  background: rgba(31, 41, 55, 0.35);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 18px;
}

.coords-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.coords-header label {
  font-size: 0.84rem;
  font-weight: 700;
}

/* Upload dropzone */
.upload-dropzone {
  border: 2px dashed rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-dropzone:hover {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}

.upload-dropzone.drag-over {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
}

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 6px;
}

.upload-prompt p {
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.upload-prompt small {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Media previews grid */
.media-previews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.preview-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #1f2937;
}

.preview-card img,
.preview-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(239, 68, 68, 0.85);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
}

.preview-tag {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
}

/* Alerts & Toasts */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin-bottom: 14px;
}

.alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #fca5a5;
}

.alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  color: #a7f3d0;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-emerald);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2000;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--accent-emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

/* Modal Large & Chat */
.modal-lg {
  max-width: 820px;
  width: 95%;
}

.modal-chat {
  max-width: 520px;
  width: 95%;
  display: flex;
  flex-direction: column;
  height: 600px;
  max-height: 85vh;
}

.detail-header-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-header-tags .ad-badge {
  position: static;
}

.detail-loc-badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.detail-view-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Detail Modal Body */
.detail-modal-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-media-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-media-main {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #111827;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.detail-media-main img,
.detail-media-main video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.detail-thumbnails-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.detail-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.7;
  transition: var(--transition);
  position: relative;
  background: #1f2937;
}

.detail-thumb.active {
  border-color: var(--accent-emerald);
  opacity: 1;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.detail-thumb:hover {
  opacity: 1;
}

.detail-thumb img,
.detail-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumb .thumb-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.6rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 1px 3px;
  border-radius: 2px;
}

/* Info Section */
.detail-info-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
  min-width: 250px;
}

.detail-price-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 16px;
  border-radius: var(--radius-md);
}

.detail-price-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-emerald);
}

.detail-currency {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.detail-timestamp {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.detail-desc-box {
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.detail-desc-box h4 {
  font-size: 0.95rem;
  color: var(--accent-emerald);
  margin-bottom: 8px;
  font-weight: 700;
}

.detail-desc-text {
  font-size: 0.95rem;
  color: #e5e7eb;
  line-height: 1.7;
  white-space: pre-line;
}

.detail-map-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--accent-cyan);
  flex-wrap: wrap;
  gap: 10px;
}

.owner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.08);
}

.owner-actions > div {
  display: flex;
  flex-direction: column;
}

.owner-actions strong {
  color: #fecaca;
}

.owner-actions span {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

@media (max-width: 560px) {
  .owner-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Seller Card */
.seller-card {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.7) 0%, rgba(17, 24, 39, 0.9) 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.seller-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.seller-avatar {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seller-meta {
  flex: 1;
}

.seller-meta h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.seller-meta span {
  font-size: 0.78rem;
  color: var(--accent-emerald);
}

.fav-btn {
  font-size: 0.82rem;
  padding: 6px 12px;
}

.seller-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.btn-call {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: center;
}

.btn-call:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-whatsapp {
  background: #25D366;
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: center;
}

.btn-whatsapp:hover {
  background: #1ebe5d;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

/* Commission Transparency Box */
.commission-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: #fef3c7;
}

.commission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 6px;
}

.commission-calc strong {
  font-size: 1rem;
  color: #fff;
}

/* Chat Modal Styles */
.chat-modal-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.chat-header-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.chat-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.chat-modal-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 16px;
  gap: 12px;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-bubble.sent {
  align-self: flex-start;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-bubble.received {
  align-self: flex-end;
  background: rgba(31, 41, 55, 0.8);
  color: #f3f4f6;
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 2px;
}

.chat-bubble-time {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
  text-align: left;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.chat-input-bar input {
  flex: 1;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.chat-input-bar input:focus {
  border-color: var(--accent-emerald);
  outline: none;
}

/* ==========================================================================
   Hero Showcase Section
   ========================================================================== */
.app-hero {
  max-width: 1380px;
  margin: 20px auto 10px;
  padding: 0 24px;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.92) 0%, rgba(6, 78, 59, 0.38) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.hero-container::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-text-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  width: fit-content;
}

.hero-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-heading {
  font-size: clamp(1.6rem, 2.6vw, 2.35rem);
  font-weight: 800;
  color: #f9fafb;
  line-height: 1.3;
}

.text-gradient {
  background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtext {
  font-size: 0.98rem;
  color: #9ca3af;
  line-height: 1.7;
  max-width: 580px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.hero-pill {
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #d1d5db;
  font-weight: 600;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  padding: 12px 24px;
  font-size: 0.96rem;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.btn-hero-outline {
  padding: 12px 20px;
  font-size: 0.96rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-hero-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
}

.hero-image-side {
  z-index: 2;
  position: relative;
}

.hero-image-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  aspect-ratio: 16 / 10;
  background: #0f172a;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hero-image-card:hover .hero-img {
  transform: scale(1.03);
}

.hero-card-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.92) 0%, rgba(11, 15, 25, 0.45) 70%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-tag-badge {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
}

.hero-tag-sub {
  font-size: 0.74rem;
  color: #34d399;
}

/* ==========================================================================
   Mobile Bottom Navigation Bar
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  z-index: 990;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-width: 54px;
}

.bottom-nav-item .bottom-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--accent-emerald);
}

.bottom-nav-fab-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  top: -14px;
}

.bottom-nav-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  border: 3px solid var(--bg-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  cursor: pointer;
  transition: var(--transition);
}

.bottom-nav-fab:hover,
.bottom-nav-fab:active {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.65);
}

.bottom-nav-fab-wrap .fab-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #34d399;
  margin-top: 2px;
}

/* ==========================================================================
   Responsive Breakpoints & Layout Optimization
   ========================================================================== */
@media (max-width: 960px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
  }
  .hero-image-card {
    aspect-ratio: 16 / 9;
    max-height: 280px;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 84px; /* Clearance for mobile bottom nav */
  }

  .mobile-bottom-nav {
    display: flex;
  }

  /* Simplify top header on mobile: hide desktop action buttons */
  .navbar .nav-actions {
    display: none;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 10px;
  }

  .search-bar {
    max-width: 100%;
  }

  .app-hero {
    margin: 12px auto 8px;
    padding: 0 14px;
  }

  .hero-container {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }

  .hero-heading {
    font-size: 1.35rem;
  }

  .hero-subtext {
    font-size: 0.88rem;
  }

  .hero-image-card {
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }

  .main-container {
    padding: 16px 14px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .feed-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .ads-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .template-fields-grid {
    grid-template-columns: 1fr;
  }

  .categories-bar {
    padding: 8px 14px;
  }

  .categories-list {
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .cat-pill {
    padding: 6px 14px;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  .modal-card {
    max-height: 90vh;
    border-radius: var(--radius-md);
    margin: 8px;
  }

  .modal-body {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .brand-text h1 {
    font-size: 1.1rem;
  }
  .brand-text span {
    display: none;
  }
  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }
  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-hero-primary,
  .btn-hero-outline {
    width: 100%;
    text-align: center;
  }
}

/* Admin UI Components */
.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  font-weight: 700;
  border: 1px solid #f59e0b;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.badge-admin {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.admin-role-info {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* Admin Modal Tab Navigation & Controls */
.admin-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.admin-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
}

.admin-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.admin-tab-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.admin-tab-pane {
  display: none;
}

.admin-tab-pane.active {
  display: block;
}

.admin-section-box {
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.admin-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.admin-form-group {
  margin-bottom: 12px;
}

.admin-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
  outline: none;
  border-color: var(--accent-emerald);
}

.reviewer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--accent-emerald);
  margin: 4px;
}
