/* css/find_technician_artist.css */

/* ── Page layout ──────────────────────────────────────── */
html, body {
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > header,
body > footer {
  flex: 0 0 auto;
}

.main-content {
  /* Height is set by JS to exactly fill the remaining viewport,
     pushing the footer just below the visible area. */
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  overflow: hidden;
}

.page-container {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ── Intro banner ─────────────────────────────────────── */
.find-intro {
  background: #fff;
  border-bottom: 1px solid #dde1e7;
  padding: 14px 20px;
}

.find-intro-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.find-intro-text h1 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 3px;
}

.find-intro-text p {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.find-intro-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.find-intro-feature {
  background: #f0f4e8;
  color: #3d5020;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #d0dfa8;
  white-space: nowrap;
}

/* ── CTA banner ───────────────────────────────────────── */
.subscription-cta-banner {
  background: linear-gradient(90deg, #2e3d16, #556B2F);
  color: #fff;
  text-align: center;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 3px solid #a8c840;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
.subscription-cta-banner p {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.subscription-cta-banner p::before {
  content: "🔧";
  font-size: 1.1rem;
  flex-shrink: 0;
}
.subscription-cta-banner a {
  color: #d4edaa;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.subscription-cta-banner a:hover { color: #fff; }

/* ── Sidebar ──────────────────────────────────────────── */
.middle-column.find-sidebar {
  flex: 0 0 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f5f6f7;
  border-right: 1px solid #dde1e7;
  overflow: hidden;
}

/* ── Sidebar header ───────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.result-count {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 500;
}

/* ── Search toolbar ───────────────────────────────────── */
.search-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
}

.search-toolbar input,
.search-toolbar select {
  padding: 0.48rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.84rem;
  font-family: inherit;
  background: #fafafa;
  color: #333;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-toolbar input { width: 100%; box-sizing: border-box; }

.toolbar-row {
  display: flex;
  gap: 8px;
}

.toolbar-row select {
  flex: 1;
  cursor: pointer;
}

.search-toolbar input:focus,
.search-toolbar select:focus {
  outline: none;
  border-color: #556B2F;
  box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.12);
  background: #fff;
}

/* ── Card list ────────────────────────────────────────── */
#technicianList {
  list-style: none;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #c5c9d0 transparent;
}

#technicianList::-webkit-scrollbar { width: 5px; }
#technicianList::-webkit-scrollbar-thumb {
  background: #c5c9d0;
  border-radius: 3px;
}

/* ── No results / error state ─────────────────────────── */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: #6b7280;
  gap: 6px;
  list-style: none;
}

.no-results-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 4px;
}

.no-results strong {
  font-size: 0.95rem;
  color: #374151;
  display: block;
}

.no-results p {
  font-size: 0.82rem;
  margin: 0;
  color: #9ca3af;
}

/* ── Skeleton loader ──────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1; }
}

.artist-card--skeleton {
  pointer-events: none;
  cursor: default;
  border-color: transparent !important;
  box-shadow: none !important;
  gap: 0;
  flex-direction: column;
}

.artist-card--skeleton .card-main {
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e5e7eb;
  flex-shrink: 0;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.skeleton-line {
  height: 11px;
  border-radius: 6px;
  background: #e5e7eb;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

/* ── Artist card ──────────────────────────────────────── */
.artist-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  list-style: none;
}

.artist-card:hover {
  border-color: #556B2F;
  box-shadow: 0 3px 12px rgba(85, 107, 47, 0.14);
}

.artist-card.active {
  border-color: #556B2F;
  background: #f6f9f0;
  box-shadow: 0 3px 14px rgba(85, 107, 47, 0.2);
}

/* Card main row: avatar + name/meta */
.card-main {
  display: flex;
  gap: 13px;
  align-items: center;
}

.card-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  flex-shrink: 0;
  background: #f3f4f6;
  display: block;
  transition: border-color 0.18s;
}

.artist-card.active .card-avatar,
.artist-card:hover .card-avatar {
  border-color: #a8c060;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Role badges ──────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 0.67rem;
  font-weight: 700;
  color: #fff;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.role-artist     { background: #8B4513; }
.role-technician { background: #556B2F; }

.card-location {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Bio ──────────────────────────────────────────────── */
.card-bio {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Service tags ─────────────────────────────────────── */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.service-tag {
  background: #f0f4e8;
  color: #3d5020;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #d0dfa8;
  white-space: nowrap;
}

/* ── Card footer: actions + status ───────────────────── */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Contact buttons ──────────────────────────────────── */
.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  flex-shrink: 0;
  font-size: 1rem;
}

.card-btn:hover {
  opacity: 0.85;
  transform: scale(1.1);
}

.card-btn.email-btn {
  background: #556B2F;
  color: #fff;
}

.card-btn.whatsapp-btn {
  background: #25D366;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-btn.phone-btn {
  background: #556B2F;
  color: #fff;
}

.card-btn.fb-btn {
  background: #3b5998;
  overflow: hidden;
}

.fb-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Status badge ─────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.67rem;
  font-weight: 600;
  color: #fff;
  border-radius: 4px;
  white-space: nowrap;
}
.status-badge.pending-cancellation { background: #e65100; }

/* ── Map ──────────────────────────────────────────────── */
.right-column.map-container {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

#technicianMap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Leaflet popup ────────────────────────────────────── */
.leaflet-popup-profile {
  width: 260px;
  font-family: 'Open Sans', sans-serif;
}

/* Header row: avatar left, name/role/rating right */
.popup-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.popup-profile-pic {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  flex-shrink: 0;
  display: block;
}

.popup-header-info {
  flex: 1;
  min-width: 0;
}

.popup-username {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1a1a1a;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popup-rating {
  margin-top: 5px;
  font-size: 0.75rem;
}

.popup-no-rating {
  font-size: 0.72rem;
  color: #9ca3af;
}

.popup-location {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 7px;
}

.popup-bio {
  font-size: 0.8rem;
  color: #444;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popup-tags {
  margin-bottom: 10px;
}

.popup-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.popup-profile-link {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #556B2F;
  text-decoration: none;
  padding: 6px 0 2px;
  border-top: 1px solid #e8eaed;
  transition: color 0.15s;
}

.popup-profile-link:hover { color: #3d5020; }

.popup-contact,
.popup-facebook {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  text-decoration: none;
  transition: opacity 0.15s;
  overflow: hidden;
  font-size: 1rem;
}

.popup-contact              { background: #556B2F; color: #fff !important; }
.popup-contact.popup-whatsapp { background: #25D366; }
.popup-facebook             { background: #3b5998; }

.popup-contact:hover,
.popup-facebook:hover       { opacity: 0.85; }

/* ── Card rating display ──────────────────────────────── */
.card-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.card-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.78rem;
  color: #374151;
}

.card-rating .star--on  { color: #f59e0b; }
.card-rating .star--off { color: #d1d5db; }

.card-rating-count {
  color: #6b7280;
  margin-left: 2px;
}

.review-open-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 0.75rem;
  color: #374151;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.review-open-btn:hover {
  border-color: #556B2F;
  background: #f6f9f0;
}

.review-open-btn__none { color: #9ca3af; font-size: 0.75rem; }

/* ── Review modal ─────────────────────────────────────── */
.review-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.review-modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.review-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.review-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px;
}

.review-modal-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}

.review-modal-meta .star--on  { color: #f59e0b; font-size: 1rem; }
.review-modal-meta .star--off { color: #d1d5db; font-size: 1rem; }
.review-modal-meta .card-rating-count { color: #6b7280; }
.review-modal-no-rating { font-size: 0.82rem; color: #9ca3af; }

.review-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0 0 0 12px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.review-modal-close:hover { color: #1a1a1a; }

.review-modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1 1 auto;
}

.review-loading {
  text-align: center;
  color: #9ca3af;
  padding: 2rem 0;
  font-size: 0.9rem;
}

/* ── Review list ──────────────────────────────────────── */
.review-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
}

.review-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.review-card-stars .star--on  { color: #f59e0b; }
.review-card-stars .star--off { color: #d1d5db; }

.review-card-meta {
  font-size: 0.78rem;
  color: #6b7280;
}

.review-card-body {
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
}

.review-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* ── Leave a review section ───────────────────────────── */
.review-leave-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 18px;
}

.review-leave-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
}

.review-leave-hint {
  font-size: 0.83rem;
  color: #6b7280;
  margin: 0 0 14px;
}

.review-leave-hint a { color: #556B2F; }

.review-form-group { margin-bottom: 12px; }

.review-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.88rem;
  font-family: inherit;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.review-input:focus {
  outline: none;
  border-color: #556B2F;
  box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.12);
}

/* ── Interactive star picker ──────────────────────────── */
.star-picker {
  display: flex;
  gap: 4px;
  cursor: pointer;
  margin-bottom: 4px;
}

.star-pick {
  font-size: 1.8rem;
  color: #d1d5db;
  transition: color 0.1s, transform 0.1s;
  user-select: none;
  line-height: 1;
}

.star-pick:hover,
.star-pick--on { color: #f59e0b; }

.star-pick:hover { transform: scale(1.15); }

/* ── Review textarea ──────────────────────────────────── */
.review-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.review-textarea:focus {
  outline: none;
  border-color: #556B2F;
  box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.12);
}

.review-field-error {
  font-size: 0.78rem;
  color: #dc2626;
  margin: 4px 0 0;
  min-height: 1em;
}

.review-submit-btn {
  display: inline-block;
  padding: 9px 22px;
  background: #556B2F;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.review-submit-btn:hover:not(:disabled) { background: #3d5020; }
.review-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.review-success {
  color: #556B2F;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 0;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .find-intro-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .page-container {
    flex-direction: column;
  }

  .middle-column.find-sidebar {
    flex: 0 0 auto;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid #dde1e7;
  }

  .right-column.map-container {
    flex: 1 1 300px;
    position: relative;
    min-height: 300px;
  }

  #technicianMap {
    position: relative;
    height: 100%;
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .middle-column.find-sidebar { flex: 0 0 380px; max-height: 45vh; }
}
