/* GESF Görsel Kütüphanesi modal */
.gesf-ml-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gesf-ml-modal {
  width: min(1180px, 100%);
  max-height: min(88vh, 900px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #0f172a;
}

.gesf-ml-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
}

.gesf-ml-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.gesf-ml-close {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.4rem;
  cursor: pointer;
}

.gesf-ml-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.gesf-ml-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 10px 12px;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.gesf-ml-tab {
  padding: 9px 14px;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.gesf-ml-tab.active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.gesf-ml-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 2px solid #059669;
  background: #ecfdf5;
  color: #047857;
  font-weight: 800;
  cursor: pointer;
}

.gesf-ml-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 20px;
}

.gesf-ml-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.gesf-ml-item {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.gesf-ml-item.is-fav {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.gesf-ml-thumb-wrap {
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gesf-ml-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gesf-ml-meta {
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gesf-ml-actions {
  display: flex;
  gap: 6px;
  padding: 0 8px 10px;
}

.gesf-ml-actions button {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.gesf-ml-actions .pick {
  background: #2563eb;
  color: #fff;
}

.gesf-ml-actions .fav {
  background: #fef3c7;
  color: #92400e;
}

.gesf-ml-actions .fav.active {
  background: #f59e0b;
  color: #fff;
}

.gesf-ml-empty,
.gesf-ml-loading,
.gesf-ml-error {
  text-align: center;
  padding: 40px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #64748b;
}

.gesf-ml-error { color: #b91c1c; }

.gesf-ml-footer {
  padding: 10px 18px 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #64748b;
}
