/* ════════════════════════════════════════════════
   Fashion Matches — Two-panel layout CSS
   Base: /static/css/theme.css + components.css
   ════════════════════════════════════════════════ */

/* ── Full-height two-panel layout ── */
.fm-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--background);
}

/* ── Left panel ── */
.fm-left {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--card);
  height: 100vh;
  overflow: hidden;
}
.fm-left-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Product list ── */
.fm-list { flex: 1; overflow-y: auto; }
.fm-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.fm-list-item:hover { background: var(--muted); }
.fm-list-item.active { background: var(--primary-light); border-left: 3px solid var(--primary); }
.fm-list-img {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0;
}
.fm-list-info { flex: 1; min-width: 0; }
.fm-list-name {
  font-size: 12px; font-weight: 600; color: var(--foreground);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fm-list-code { font-size: 11px; color: var(--muted-fg); margin-top: 2px; }
.fm-list-badges { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* ── Pagination ── */
.fm-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-top: 1px solid var(--border); flex-shrink: 0;
}

/* ── Right panel ── */
.fm-right {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--background);
}

/* ── Detail header ── */
.fm-detail-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
}
.prod-thumb {
  width: 66px; height: 66px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0;
}
.fm-detail-info { flex: 1; min-width: 0; }
.fm-prod-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.fm-prod-code { font-size: 12px; color: var(--muted-fg); }

/* ── Detail tabs ── */
.fm-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
  padding: 0 20px;
}
.fm-tab {
  padding: 10px 16px; background: none; border: none;
  font-size: 13px; font-weight: 500; color: var(--muted-fg);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all .15s; margin-bottom: -1px;
}
.fm-tab:hover { color: var(--foreground); }
.fm-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Tab bodies ── */
.fm-tab-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ── Occasion pills ── */
.fm-occ-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
}
.occ-tab {
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent; color: var(--muted-fg);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; gap: 5px;
}
.occ-tab:hover { border-color: var(--primary); color: var(--foreground); }
.occ-tab.active { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.occ-count {
  font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.25); border-radius: 999px;
  padding: 1px 5px;
}

/* ── Match scroll area ── */
.fm-match-scroll { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }

/* ── Role sections ── */
.role-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.role-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}
.role-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.role-body { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; }

/* ── Match cards ── */
.match-card {
  width: 155px; background: var(--background);
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; transition: border-color .15s, transform .15s;
}
.match-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.match-img {
  width: 100%; height: 110px; object-fit: cover; background: var(--muted);
}
.match-img-placeholder {
  width: 100%; height: 110px; background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--muted-fg);
}
.match-info { padding: 8px 9px; }
.match-name { font-size: 11px; font-weight: 600; margin-bottom: 3px; line-height: 1.35; }
.match-code { font-size: 10px; color: var(--muted-fg); margin-bottom: 4px; }
.match-reason {
  font-size: 10px; color: var(--muted-fg); line-height: 1.35;
  margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.match-footer { display: flex; justify-content: space-between; align-items: center; padding: 0 9px 8px; }
.match-score { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px; }
.score-high { background: var(--success-light); color: var(--success); }
.score-mid  { background: var(--warn-light);    color: var(--warn); }
.score-low  { background: var(--error-light);   color: var(--error); }
.btn-remove {
  background: none; border: 1px solid transparent;
  color: var(--muted-fg); font-size: 10px; cursor: pointer;
  padding: 2px 5px; border-radius: 4px; transition: all .12s;
}
.btn-remove:hover { border-color: var(--error); color: var(--error); }

/* ── Add card ── */
.add-card {
  width: 155px; height: 185px;
  background: transparent; border: 1.5px dashed var(--border);
  border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; color: var(--muted-fg); transition: all .15s;
}
.add-card:hover { border-color: var(--primary); color: var(--primary); }
.add-card-icon { font-size: 22px; }
.add-card-label { font-size: 11px; font-weight: 500; }

/* ── Description view ── */
.fm-desc-content { font-size: 13px; line-height: 1.7; color: var(--foreground); }
.fm-desc-section { margin-bottom: 20px; }
.fm-desc-section h4 { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted-fg); margin-bottom: 8px; }
.fm-desc-row { display: flex; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.fm-desc-label { color: var(--muted-fg); min-width: 130px; flex-shrink: 0; }
.fm-desc-value { color: var(--foreground); flex: 1; }

/* ── Progress bar ── */
.progress-bar-wrap { height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }

/* ── Modal ── */
.fm-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4); backdrop-filter: blur(3px);
  z-index: 500; display: flex; align-items: center; justify-content: center;
}
.fm-modal-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; width: 500px; max-height: 78vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.fm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.fm-modal-result {
  display: flex; align-items: center; gap: 12px; padding: 9px 0;
  cursor: pointer; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--foreground); transition: color .12s;
}
.fm-modal-result:last-child { border-bottom: none; }
.fm-modal-result:hover { color: var(--primary); }
.fm-modal-result img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.mr-name { font-size: 13px; font-weight: 500; }
.mr-meta { font-size: 11px; color: var(--muted-fg); margin-top: 2px; }

/* ── Toast ── */
.fm-toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--foreground); padding: 10px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  z-index: 9999; opacity: 0; transform: translateY(6px);
  transition: all .2s; pointer-events: none;
}
.fm-toast.show { opacity: 1; transform: translateY(0); }
.fm-toast.success { border-color: var(--success); }
.fm-toast.error   { border-color: var(--error); }
