/* =============================================================
   SPOTREALTY — BUYER HOME & BOARD VIEW STYLES (Redesign V1)
   Scoped to .buyer-home to guarantee zero leakage into other views.
   ============================================================= */

.buyer-home {
  margin: -24px -24px 0 -24px;
  width: calc(100% + 48px);
  min-height: calc(100vh - 24px);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* =============================================================
   TOP NAVIGATION BAR (Stitch Match)
   ============================================================= */
.buyer-home-topbar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.buyer-home-topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-sizing: border-box;
}

/* Brand & Platform Context */
.buyer-home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.buyer-home-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #4f46e5;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 2px 0 rgba(79, 70, 229, 0.25);
}

.buyer-home-brand-text {
  display: flex;
  flex-direction: column;
}

.buyer-home-brand-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.buyer-home-brand-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

/* Center Search Container */
.buyer-home-search-wrap {
  flex: 1;
  max-width: 576px;
}

.buyer-home-search-box {
  position: relative;
  width: 100%;
}

.buyer-home-search-box input {
  width: 100%;
  height: 40px;
  padding-left: 40px;
  padding-right: 36px;
  font-size: 13px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1e293b;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
}

.buyer-home-search-box input::placeholder {
  color: #94a3b8;
}

.buyer-home-search-box input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.buyer-home-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buyer-home-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buyer-home-search-clear:hover {
  color: #334155;
}

/* Right Action Items & Profile Indicator */
.buyer-home-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.buyer-home-actions #btnOpenDuplicateReviews {
  height: 36px !important;
  border-radius: 8px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
  white-space: nowrap;
}

.buyer-home-btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.buyer-home-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  white-space: nowrap;
}

.buyer-home-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.buyer-home-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: #4f46e5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px 0 rgba(79, 70, 229, 0.2);
  white-space: nowrap;
}

.buyer-home-btn-primary:hover {
  background: #4338ca;
}

.buyer-home-user-avatar {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  background: #1e293b;
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  margin-left: 4px;
  flex-shrink: 0;
  user-select: none;
}

/* =============================================================
   MAIN WORKSPACE CONTENT & CONTEXT HEADER
   ============================================================= */
.buyer-home-content {
  flex: 1;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 48px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.buyer-home-context-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.buyer-home-context-header .buyer-home-title {
  font-size: 24px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.25;
}

.buyer-home-context-header .buyer-home-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 1080px) {
  .buyer-home-btn-secondary .btn-text {
    display: none;
  }
}

@media (max-width: 768px) {
  .buyer-home-topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
  }
  .buyer-home-search-wrap {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
}

/* Sections */
.buyer-home-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.buyer-home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.buyer-home-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: -0.01em;
  margin: 0;
}

.buyer-home-section-title .count-badge {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  margin-left: 2px;
}

/* Segmented Filter Pills */
.buyer-home-filter-pills {
  display: inline-flex;
  padding: 3px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  gap: 2px;
}

.buyer-home-filter-pills .filter-pill {
  border: none;
  background: transparent;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: capitalize;
}

.buyer-home-filter-pills .filter-pill:hover {
  color: #0f172a;
}

.buyer-home-filter-pills .filter-pill.active {
  background: #ffffff;
  color: #4f46e5;
  font-weight: 600;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* 4-Column Board Grid */
.buyer-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1280px) {
  .buyer-home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .buyer-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .buyer-home-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* Board Card */
.buyer-board-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  height: 148px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  text-decoration: none;
  box-sizing: border-box;
}

.buyer-board-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
}

.buyer-board-card:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Card Cover */
.buyer-board-card-cover {
  height: 64px;
  width: 100%;
  position: relative;
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Cover Palettes */
.cover-architectural-skyline {
  background: linear-gradient(135deg, #1e293b 0%, #334155 40%, #0284c7 100%);
}
.cover-purple-curated {
  background: linear-gradient(135deg, #2e1065 0%, #581c87 50%, #7c3aed 100%);
}
.cover-amber-warm {
  background: linear-gradient(135deg, #78350f 0%, #b45309 45%, #f59e0b 100%);
}
.cover-emerald-district {
  background: linear-gradient(135deg, #064e3b 0%, #047857 55%, #10b981 100%);
}
.cover-corporate-glass {
  background: linear-gradient(135deg, #0f172a 0%, #0369a1 60%, #38bdf8 100%);
}
.cover-slate-structure {
  background: linear-gradient(135deg, #1e293b 0%, #475569 50%, #64748b 100%);
}
.cover-twilight-city {
  background: linear-gradient(135deg, #18181b 0%, #312e81 60%, #6366f1 100%);
}

/* Badges on Covers */
.buyer-board-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  border: 1px solid transparent;
}

.buyer-board-badge.badge-system-master {
  background: rgba(30, 27, 75, 0.6);
  color: #e0e7ff;
  border-color: rgba(165, 180, 252, 0.3);
}

.buyer-board-badge.badge-curated-master {
  background: rgba(58, 15, 101, 0.6);
  color: #f3e8ff;
  border-color: rgba(216, 180, 254, 0.3);
}

.buyer-board-badge.badge-personal {
  background: rgba(69, 26, 3, 0.6);
  color: #fef3c7;
  border-color: rgba(252, 211, 77, 0.3);
}

.buyer-board-badge.badge-company {
  background: rgba(6, 78, 59, 0.6);
  color: #d1fae5;
  border-color: rgba(110, 231, 183, 0.3);
}

.buyer-board-badge.badge-team {
  background: rgba(12, 74, 110, 0.6);
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.3);
}

.buyer-board-badge.badge-category {
  background: rgba(76, 29, 149, 0.6);
  color: #ede9fe;
  border-color: rgba(196, 181, 253, 0.3);
}

.buyer-board-badge.badge-region {
  background: rgba(19, 78, 74, 0.6);
  color: #ccfbf1;
  border-color: rgba(94, 234, 212, 0.3);
}

/* Star Button */
.buyer-board-star-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  transition: transform 0.15s ease, color 0.15s ease;
  padding: 0;
}

.buyer-board-star-btn:hover {
  transform: scale(1.1);
  color: #fbbf24;
}

.buyer-board-star-btn.starred {
  color: #f59e0b;
}

.buyer-board-star-btn .star-svg {
  width: 14px;
  height: 14px;
}

/* Card Body */
.buyer-board-card-body {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  min-height: 0;
}

.buyer-board-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  transition: color 0.15s ease;
}

.buyer-board-card:hover .buyer-board-card-title {
  color: #4f46e5;
}

.buyer-board-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
  margin-top: 6px;
}

.buyer-board-card-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.buyer-board-card-meta .meta-icon {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  flex-shrink: 0;
}

.buyer-board-card-meta .meta-dot {
  color: #cbd5e1;
}

/* Create New Board Tile */
.buyer-create-board-tile {
  height: 148px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.buyer-create-board-tile:hover {
  background: #f1f5f9;
  border-color: #818cf8;
}

.buyer-create-board-tile:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.tile-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  margin-bottom: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.buyer-create-board-tile:hover .tile-icon-circle {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.tile-title {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  transition: color 0.15s ease;
}

.buyer-create-board-tile:hover .tile-title {
  color: #4f46e5;
}

.tile-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Empty / Loading / Error States */
.buyer-home-empty {
  padding: 48px 24px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.buyer-home-empty .empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}
.buyer-home-empty .empty-subtitle {
  font-size: 12px;
  color: #94a3b8;
}

.buyer-home-loading {
  text-align: center;
  padding: 5rem 2rem;
  color: #64748b;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.buyer-home-error {
  text-align: center;
  padding: 4rem 2rem;
  background: #ffffff;
  border: 1px solid #fecaca;
  border-radius: 12px;
  max-width: 480px;
  margin: 2rem auto;
}
.buyer-home-error .error-title {
  color: #dc2626;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}
.buyer-home-error .error-msg {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}
.buyer-home-error .btn-retry {
  background: #4f46e5;
  color: #ffffff;
  font-weight: 600;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

/* =============================================================
   SINGLE BOARD VIEW HEADER & CONTROLS (Preserved for single board)
   ============================================================= */
.buyer-board-header {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.buyer-board-banner-viewonly {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-join-board {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}
.btn-join-board:hover {
  background: #15803d;
}
