/* ============================================================
   Making Connections — Photo Intelligence Gallery
   EPW-PRO-194: Search/gallery UI for Andrew's photo pipeline
   ============================================================ */

/* ---- Layout ---- */
.mc-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mc-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid #E5E7EB;
  background: #fff;
  flex-wrap: wrap;
}

.mc-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 200px;
  max-width: 480px;
}

.mc-search-input {
  flex: 1;
  padding: 7px 12px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.mc-search-input:focus {
  border-color: #DB2777;
  box-shadow: 0 0 0 3px rgba(219,39,119,0.1);
}

.mc-search-btn,
.mc-analyse-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.mc-search-btn {
  background: #DB2777;
  color: #fff;
}
.mc-analyse-btn {
  background: #F3F4F6;
  color: #374151;
  border: 1px solid #D1D5DB;
}
.mc-search-btn:hover,
.mc-analyse-btn:hover { opacity: 0.85; }

/* ---- Stats Bar ---- */
.mc-stats-bar {
  display: flex;
  gap: 24px;
  padding: 8px 20px;
  font-size: 12px;
  color: #6B7280;
  background: #FAFAFA;
  border-bottom: 1px solid #F3F4F6;
}
.mc-stat { display: flex; gap: 4px; align-items: center; }
.mc-stat-num { font-weight: 700; color: #111827; }

/* ---- Filter Pills ---- */
.mc-filter-row {
  display: flex;
  gap: 6px;
  padding: 8px 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid #F3F4F6;
}

.mc-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #E5E7EB;
  background: #fff;
  color: #374151;
  transition: all 0.15s;
}
.mc-pill:hover { background: #FDF2F8; border-color: #DB2777; }
.mc-pill-active {
  background: #DB2777;
  color: #fff;
  border-color: #DB2777;
}

/* ---- Tag Cloud ---- */
.mc-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 20px;
  max-height: 120px;
  overflow-y: auto;
  border-bottom: 1px solid #F3F4F6;
}

.mc-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid #E5E7EB;
  background: #fff;
  color: #374151;
  transition: all 0.15s;
}
.mc-tag-chip:hover { background: #FDF2F8; border-color: #DB2777; }
.mc-tag-chip .mc-tag-count {
  font-size: 10px;
  color: #9CA3AF;
  font-weight: 600;
}

/* ---- Photo Grid ---- */
.mc-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.mc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.mc-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.mc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.mc-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #E5E7EB;
  display: block;
}
.mc-card-img.mc-loading {
  background: linear-gradient(110deg, #E5E7EB 8%, #F3F4F6 18%, #E5E7EB 33%);
  background-size: 200% 100%;
  animation: mc-shimmer 1.5s linear infinite;
}
@keyframes mc-shimmer {
  to { background-position: -200% 0; }
}

.mc-card-info {
  padding: 8px 10px;
}
.mc-card-name {
  font-size: 11px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-card-meta {
  font-size: 10px;
  color: #9CA3AF;
  margin-top: 2px;
}
.mc-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.mc-card-tag {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #FDF2F8;
  color: #DB2777;
}

/* ---- Photo Detail Overlay ---- */
.mc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mc-fade-in 0.2s ease;
}
@keyframes mc-fade-in { from { opacity: 0; } }

.mc-detail {
  background: #fff;
  border-radius: 14px;
  max-width: 900px;
  width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mc-detail-img-wrap {
  position: relative;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 55vh;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}
.mc-detail-img {
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
}
.mc-detail-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-detail-body {
  padding: 16px 20px 20px;
}
.mc-detail-filename {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}
.mc-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.mc-detail-meta-item {
  font-size: 12px;
}
.mc-detail-meta-label {
  color: #9CA3AF;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mc-detail-meta-val {
  color: #111827;
  font-weight: 500;
}

.mc-detail-desc {
  font-size: 13px;
  color: #4B5563;
  margin-bottom: 12px;
  line-height: 1.5;
  padding: 10px;
  background: #F9FAFB;
  border-radius: 8px;
}

.mc-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.mc-detail-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 14px;
  background: #FDF2F8;
  color: #DB2777;
  cursor: pointer;
}
.mc-detail-tag:hover {
  background: #FCE7F3;
}

/* ---- Tag Editor ---- */
.mc-tag-editor {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.mc-tag-editor input {
  flex: 1;
  padding: 5px 10px;
  border: 1.5px solid #D1D5DB;
  border-radius: 6px;
  font-size: 12px;
}
.mc-tag-editor button {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  background: #DB2777;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

/* ---- Empty / Loading ---- */
.mc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #9CA3AF;
  text-align: center;
}
.mc-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.mc-empty-text {
  font-size: 14px;
  max-width: 400px;
  line-height: 1.6;
}

.mc-loading-spinner {
  text-align: center;
  padding: 40px;
  color: #9CA3AF;
}

/* ---- Pagination ---- */
.mc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #F3F4F6;
}
.mc-page-btn {
  padding: 5px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.mc-page-btn:disabled { opacity: 0.4; cursor: default; }
.mc-page-info { font-size: 12px; color: #6B7280; }

/* ---- End-of-content marker ---- */
.mc-grid-wrap::after {
  content: '';
  display: block;
  height: 2cm;
}
