@import url('../pdf-tools-design.css');

/* ===== Extract Images from PDF — tool specific overrides ===== */

.extract-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-dark);
  font-weight: 600;
}

.extract-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.extract-gallery-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  padding: 16px;
}

.extract-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 6px;
}

.extract-gallery-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
}

.extract-gallery-meta {
  font-size: 0.72rem;
  color: var(--dim);
  font-weight: 600;
}

.extract-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding: 2px;
}

.extract-thumb {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-bg);
  aspect-ratio: 1 / 1;
}

.extract-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.extract-thumb-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.60rem;
  font-weight: 600;
  text-align: center;
  padding: 3px 4px;
}

.extract-thumb-dl {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  cursor: pointer;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.15s;
}

.extract-thumb-dl:hover { transform: scale(1.1); }

.extract-gallery-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

@media (max-width: 640px) {
  .extract-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  .extract-gallery-actions .btn {
    width: 100%;
    justify-content: center;
  }
}