/* ===================================================
   listings.css — VicSky Listings App Styles
   =================================================== */

/* ----- Search Bar ----- */
.listing-search {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
}

.listing-search form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 8px;
  width: auto !important;
  box-sizing: border-box;
  min-width: 0;
}

.search-input:focus {
  border-color: #007acc;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,122,204,0.15);
}

.search-btn {
  padding: 10px 16px;
  background: #007acc;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-btn:hover { background: #005fa3; }

.clear-link {
  font-size: 13px;
  color: #888;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 4px;
  flex-shrink: 0;
}

.clear-link:hover { color: #333; }

/* ----- Sort Bar ----- */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 2px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 12px;
  color: #888;
  flex-shrink: 0;
}

.sort-btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #dde4ed;
  background: #f8f9fa;
  color: #555;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sort-btn:hover {
  background: #e8f0ff;
  color: #007acc;
  border-color: #b8cef0;
}

.sort-btn.active {
  background: #007acc;
  color: #fff;
  border-color: #007acc;
  font-weight: 600;
}

/* ----- Pagination ----- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.page-btn {
  padding: 7px 18px;
  background: #007acc;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.page-btn:hover { background: #005fa3; }

.page-info {
  font-size: 13px;
  color: #666;
}

/* ----- Listing Grid ----- */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .listing-grid { grid-template-columns: 1fr; }
}

/* ----- Listing Card ----- */
.listing-card {
  display: block;
  border: 1px solid #dde4ed;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.1s;
}

.listing-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

.listing-card-badge {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.listing-card-headline {
  font-size: 14px;
  font-weight: bold;
  color: #1a1a2e;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-card-meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.listing-card-rent {
  font-size: 15px;
  font-weight: bold;
  color: #d9534f;
}

/* ----- No Results ----- */
.no-results {
  color: #d9534f;
  text-align: center;
  padding: 30px;
}

/* ----- Public Submit CTA ----- */
.submit-cta {
  text-align: center;
  margin: 8px 0 4px;
}

.submit-cta-btn {
  display: inline-block;
  padding: 10px 28px;
  background: #28a745;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.submit-cta-btn:hover {
  background: #218838;
}

/* ----- Admin Action Buttons ----- */
.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.admin-btn {
  padding: 8px 16px;
  background: #f0f4ff;
  border: 1px solid #c5d0e8;
  border-radius: 6px;
  font-size: 13px;
  color: #334;
  text-decoration: none;
  transition: background 0.2s;
}

.admin-btn:hover { background: #dce6ff; }

/* ----- Detail Page ----- */
.detail-back {
  margin-bottom: 12px;
  font-size: 14px;
}

.detail-back a {
  color: #007acc;
  text-decoration: none;
}

.listing-detail-title {
  font-size: 22px;
  font-weight: bold;
  color: #1a1a2e;
  margin: 8px 0 4px;
  text-align: left;
}

.listing-detail-subtitle {
  font-size: 16px;
  color: #666;
  margin-bottom: 16px;
}

/* ----- Badge Row ----- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.badge {
  background: #f0f4ff;
  border: 1px solid #c5d0e8;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  color: #334;
}

.badge-label {
  color: #888;
  font-size: 11px;
  margin-right: 2px;
}

.badge-rent {
  background: #fff0f0;
  border-color: #f5c6cb;
  color: #d9534f;
  font-weight: bold;
}

/* ----- Contact Section ----- */
.contact-section {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.contact-section-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.contact-row {
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.5;
}

/* ----- Description ----- */
.listing-description {
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: #444;
}

/* ----- Image Gallery (detail) ----- */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.image-frame img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

/* ----- Submit Form ----- */
.submit-form {
  max-width: 580px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.form-section-title {
  font-size: 15px;
  font-weight: bold;
  color: #333;
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #eef;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

.required-mark {
  color: #d9534f;
  margin-left: 2px;
}

.optional-mark {
  font-weight: normal;
  color: #888;
  font-size: 12px;
  margin-left: 4px;
}

.submit-form input[type="text"],
.submit-form input[type="number"],
.submit-form input[type="email"],
.submit-form input[type="tel"],
.submit-form select,
.submit-form textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.submit-form input:focus,
.submit-form select:focus,
.submit-form textarea:focus {
  border-color: #007acc;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,122,204,0.15);
}

.form-hint {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

.char-counter {
  font-size: 12px;
  color: #888;
  text-align: right;
  margin-top: 3px;
}

.char-counter.near-limit { color: #e07b00; }
.char-counter.at-limit   { color: #d9534f; }

.contact-required-note {
  font-size: 12px;
  color: #d9534f;
  margin: -8px 0 12px;
}

.image-upload-section {
  margin-bottom: 20px;
}

.image-upload-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.image-upload-hint {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

#image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.image-item {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px;
  text-align: center;
  cursor: grab;
}

.image-item img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-bottom: 4px;
}

.submit-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #28a745;
  color: white;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 24px;
  transition: background 0.2s;
}

.submit-btn:hover { background: #218838; }

.save-btn {
  padding: 10px 32px;
  background: #007acc;
  color: white;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 20px;
}

.save-btn:hover { background: #005fa3; }

.approval-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.approve-btn {
  flex: 1;
  padding: 12px;
  background: #28a745;
  color: white;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.reject-btn {
  flex: 1;
  padding: 12px;
  background: #dc3545;
  color: white;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.approval-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-bottom: 8px;
}

.form-errors {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #856404;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 400px) {
  .two-col { grid-template-columns: 1fr; }
  .approval-actions { flex-direction: column; }
}

/* InfoHub extras */
.info-card-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  margin: 8px 0;
}

.listing-card-time {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}

.thanks-box {
  text-align: center;
  padding: 60px 20px;
}

.thanks-icon { font-size: 48px; }
.thanks-title { font-size: 22px; font-weight: bold; margin: 16px 0 8px; color: #333; }
.thanks-text { font-size: 15px; color: #666; margin-bottom: 24px; }
.thanks-link { color: #1890ff; text-decoration: none; font-size: 15px; }

/* ===== Detail Page Redesign (2026-03-13) ===== */

/* Slideshow */
.detail-slideshow {
  position: relative;
  background: #222;
  width: 100%;
  overflow: hidden;
  height: 300px;
  margin-bottom: 12px;
  cursor: pointer;
}
.detail-slideshow .slide-item {
  display: none;
  width: 100%;
  height: 100%;
}
.detail-slideshow .slide-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.detail-slideshow .slide-item.active {
  display: block;
}
.slide-counter-badge {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 12px;
  pointer-events: none;
}
.slide-placeholder {
  width: 100%;
  height: 100%;
  background: #dde4ed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 15px;
}

/* Detail cards */
.detail-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin-bottom: 10px;
}
.detail-card-label {
  font-size: 12px;
  font-weight: 700;
  color: #007acc;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f4ff;
}
.detail-main-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
  line-height: 1.3;
}
.detail-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}
.detail-contact-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-contact-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.detail-contact-icon { font-size: 16px; flex-shrink: 0; }
.detail-contact-meta { min-width: 0; }
.detail-contact-lbl { font-size: 11px; color: #999; }
.detail-contact-val {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-btn {
  background: #007acc;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.copy-btn:hover { background: #005fa3; }
.detail-desc {
  font-size: 14px;
  line-height: 1.8;
  color: #444;
}
.detail-desc p { margin-bottom: 8px; }
.detail-desc ul, .detail-desc ol { padding-left: 20px; margin-bottom: 8px; }
.detail-desc li { margin-bottom: 4px; }
.detail-desc strong { color: #1a1a2e; }
.detail-desc h1, .detail-desc h2, .detail-desc h3 {
  font-size: 15px; font-weight: 700; margin: 12px 0 6px; color: #1a1a2e;
}
.detail-meta {
  font-size: 12px;
  color: #bbb;
  text-align: right;
  padding: 0 2px;
  margin-bottom: 10px;
}
.detail-sticky-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 50;
}
.detail-sticky-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.detail-sticky-btn:hover { opacity: 0.85; }
.detail-sticky-btn.wechat { background: #07c160; color: #fff; }
.detail-sticky-btn.phone  { background: #007acc; color: #fff; }
.detail-sticky-btn.email  { background: #ff6b35; color: #fff; }
