/* ==============================
   Jewelry Directory Styles
   ============================== */

/* Filter Bar */
.filter-bar {
  background: #fff8e1;
  border-bottom: 2px solid #f5d26b;
  padding: 16px 0;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a5c20;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-group select {
  padding: 8px 12px;
  border: 1px solid #d4aa57;
  border-radius: 6px;
  background: #fff;
  font-size: 0.9rem;
  color: #333;
  min-width: 140px;
  cursor: pointer;
}

.btn-filter {
  background: #bfa059;
  color: white;
  border: none;
  padding: 9px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
  align-self: flex-end;
}

.btn-filter:hover { background: #a08040; }

.btn-add {
  background: #28a745;
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
  align-self: flex-end;
}

.btn-add:hover { background: #218838; }

/* Results info */
.results-info {
  padding: 12px 0 4px;
  color: #666;
  font-size: 0.88rem;
}

/* Load More */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 28px 0 8px;
}

.btn-load-more {
  background: #bfa059;
  color: white;
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn-load-more:hover { background: #a08040; }
.btn-load-more:disabled { opacity: 0.6; cursor: default; }

/* ==============================
   Jeweler Cards Grid
   ============================== */
#jewelerGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  padding: 24px 0 48px;
}

.jeweler-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.09);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #ede0b8;
  transition: box-shadow 0.2s;
}

.jeweler-card:hover {
  box-shadow: 0 6px 20px rgba(191,160,89,0.25);
}

.card-header {
  background: linear-gradient(135deg, #bfa059, #d4aa57);
  padding: 14px 16px 10px;
  color: white;
  position: relative;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
  padding-right: 90px;
  overflow-wrap: break-word;
}

.card-city {
  font-size: 0.82rem;
  opacity: 0.9;
}

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-verified {
  background: #28a745;
  color: white;
}

.badge-flagged {
  background: #dc3545;
  color: white;
}

.badge-unverified {
  background: #fd7e14;
  color: white;
}

.my-listing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.my-listing-row:last-child {
  border-bottom: none;
}

.my-listing-info .my-listing-name {
  font-weight: 600;
}

.my-listing-info .my-listing-meta {
  font-size: 0.8rem;
  color: #777;
  margin-top: 2px;
}

.my-listing-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ==============================
   Manage Designs Modal
   ============================== */
.design-category-group {
  margin-bottom: 18px;
}

.design-category-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7a5c20;
  border-bottom: 1px solid #f0e6cc;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.design-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.design-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #444;
  font-weight: normal;
  cursor: pointer;
}

/* ==============================
   Submit Design Modal
   ============================== */
.modal-box-lg {
  width: 640px;
}

.modal-note-inline {
  font-weight: normal;
  color: #999;
  font-size: 0.8rem;
}

.submit-design-form-title {
  font-size: 1rem;
  color: #7a5c20;
  border-top: 1px solid #f0e6cc;
  padding-top: 16px;
  margin: 8px 0 12px;
}

.repeat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.repeat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.repeat-row input[type="text"] {
  flex: 1;
  padding: 7px 9px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'Montserrat', sans-serif;
}

.repeat-row .thumb-preview {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e8d9a0;
  flex-shrink: 0;
}

.btn-remove-row {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 8px;
  color: white;
}

.status-pill.verified { background: #28a745; }
.status-pill.flagged { background: #dc3545; }
.status-pill.unverified { background: #fd7e14; }
.status-pill.published { background: #28a745; }
.status-pill.pending { background: #fd7e14; }
.status-pill.rejected { background: #dc3545; }
.status-pill.approved { background: #28a745; }

.card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: #444;
}

.card-detail .icon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  color: #bfa059;
}

.card-detail a {
  color: #17a2b8;
  text-decoration: none;
  word-break: break-all;
}

.card-detail a:hover { text-decoration: underline; }

.specializations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.spec-tag {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}

.trust-badge {
  background: #eaf7ee;
  color: #1a7c3a;
  border: 1px solid #b8e5c8;
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 0.74rem;
  font-weight: 700;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.stars {
  color: #ffc107;
  font-size: 1rem;
  letter-spacing: 1px;
}

.stars .empty { color: #ddd; }

.rating-num {
  font-weight: 700;
  color: #333;
  font-size: 0.95rem;
}

.review-count {
  color: #888;
  font-size: 0.8rem;
}

/* Reviews Section */
.card-footer {
  border-top: 1px solid #f0e6cc;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-reviews-btn,
.toggle-review-form-btn {
  background: none;
  border: none;
  color: #bfa059;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
  text-decoration: underline;
}

.reviews-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.review-item {
  background: #fffdf5;
  border-left: 3px solid #ffd700;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.83rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.review-author {
  font-weight: 700;
  color: #333;
}

.review-date {
  color: #999;
  font-size: 0.75rem;
}

.btn-delete-review {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 2px;
  margin-left: auto;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-delete-review:hover { opacity: 1; }

.review-stars { color: #ffc107; font-size: 0.85rem; }

.review-comment { color: #555; margin-top: 3px; }

.no-reviews { color: #aaa; font-size: 0.82rem; font-style: italic; }

.review-already { color: #888; font-size: 0.8rem; font-style: italic; margin: 8px 16px 0; }

/* Write Review Form */
.review-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #fffdf5;
  border-radius: 6px;
  border: 1px solid #f0e6cc;
  font-size: 0.85rem;
}

.review-form label {
  font-weight: 600;
  color: #555;
  margin-bottom: 2px;
  display: block;
}

.review-form input[type="text"],
.review-form textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'Montserrat', sans-serif;
  box-sizing: border-box;
}

.review-form textarea {
  resize: vertical;
  min-height: 60px;
}

.star-rating-input {
  display: flex;
  gap: 6px;
}

.star-rating-input span {
  cursor: pointer;
  font-size: 1.4rem;
  color: #ddd;
  transition: color 0.15s;
}

.star-rating-input span.active { color: #ffc107; }

.btn-submit-review {
  background: #bfa059;
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  align-self: flex-start;
  transition: background 0.2s;
}

.btn-submit-review:hover { background: #a08040; }

.form-success { color: #28a745; font-size: 0.82rem; font-weight: 600; }
.form-error-inline { color: #dc3545; font-size: 0.82rem; }

/* ==============================
   Add Listing Modal
   ============================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  z-index: 1000;
  overflow-y: auto;
}

.modal.hidden { display: none; }

.modal-box {
  background: white;
  border-radius: 10px;
  padding: 30px;
  width: 540px;
  max-width: 95vw;
  min-width: 320px;
  max-height: 90vh;
  min-height: 220px;
  overflow: auto;
  resize: both;
  position: relative;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.modal-box h2 {
  color: #bfa059;
  border-bottom: 2px solid #bfa059;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.modal-note {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 0;
}

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

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-row label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #555;
}

.form-row input[type="text"],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
  box-sizing: border-box;
  text-align: left;
  max-width: 100%;
}

.form-row textarea {
  resize: vertical;
}

.spec-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-checkboxes label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: #444;
  cursor: pointer;
  font-weight: normal;
}

.form-error {
  color: #dc3545;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.form-error.hidden { display: none; }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.btn-submit {
  background: #bfa059;
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn-submit:hover { background: #a08040; }

.btn-secondary {
  background-color: #fff;
  color: #7a5c20;
  border: 1px solid #e8d9a0;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover { background-color: #fffaf0; }

/* Misc */
.loading-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: #aaa;
  padding: 40px 0;
  font-size: 1.05rem;
}

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }

  #jewelerGrid {
    grid-template-columns: 1fr;
  }
}
