/* ============================================================
   Image Manager v0.4.1 — CSS
   ============================================================ */

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  animation: fadeIn 0.15s ease-out;
}

.imgmgr-modal {
  width: 90vw;
  max-width: 720px;
  max-height: 85vh;
  background: var(--bg-card, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-weight: 600;
  font-size: 1rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: var(--bg-surface, #f5f5f5);
}

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

/* ── Sections ── */
.imgmgr-section {
  margin-bottom: 24px;
}

.imgmgr-section-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.imgmgr-size-badge {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-mono, monospace);
}

.hero-badge {
  background: #DBEAFE;
  color: #1E40AF;
}

.content-badge {
  background: #D1FAE5;
  color: #065F46;
}

/* ── Image card ── */
.imgmgr-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--bg-card, #fff);
}

.imgmgr-card-preview {
  width: 140px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-surface, #f5f5f5);
}

.imgmgr-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imgmgr-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.imgmgr-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.imgmgr-card-desc {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.imgmgr-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.imgmgr-type-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-type {
  background: #DBEAFE;
  color: #1E40AF;
}

.inline-type {
  background: #D1FAE5;
  color: #065F46;
}

.imgmgr-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* ── Search results grid ── */
.imgmgr-search-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 600px) {
  .imgmgr-search-grid { grid-template-columns: repeat(2, 1fr); }
}

.imgmgr-search-item {
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
  position: relative;
}

.imgmgr-search-item:hover {
  border-color: var(--accent, #3B82F6);
  transform: scale(1.02);
}

.imgmgr-search-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.imgmgr-search-item-info {
  padding: 4px 6px;
  background: var(--bg-surface, #f5f5f5);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
