/* ==========================================================================
   IMAGE ⇄ PDF TWO-WAY STUDIO - COMPONENT STYLES
   Matches the unified studio layout of pdf-tools.html (.pdf-studio-theme)
   ========================================================================== */

/* Mode Card Toggle State */
.pdf-tool-item-card.active .pdf-tool-item-open-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Sidebar Settings Form Groups */
.studio-form-group {
  margin-bottom: 10px;
}

.studio-form-group label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: #1f2d48;
  margin-bottom: 4px;
}

[data-theme="dark"] .studio-form-group label {
  color: #e2e8f0;
}

.studio-form-input, .studio-form-select {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

[data-theme="dark"] .studio-form-input, [data-theme="dark"] .studio-form-select {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.studio-form-input:focus, .studio-form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.studio-status-box {
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
}

[data-theme="dark"] .studio-status-box {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

.studio-status-box.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.studio-status-box.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Active Workspaces Inside Right Studio Card */
.studio-work-area {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-sizing: border-box;
  background: #e2e5e9;
}

[data-theme="dark"] .studio-work-area {
  background: #0b1120;
}

/* Images Grid */
.images-toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #cbd5e1;
}

[data-theme="dark"] .images-toolbar-strip {
  border-bottom-color: #334155;
}

.images-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  min-height: 200px;
}

.image-card-item {
  background: #ffffff;
  border: 1.5px solid #d9dde2;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: grab;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .image-card-item {
  background: #1e293b;
  border-color: #334155;
}

.image-card-item:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

.image-card-item.dragging {
  opacity: 0.35;
  cursor: grabbing;
  border-style: dashed;
  border-color: #2563eb;
}

.image-card-item.drag-over {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.35);
  transform: scale(1.03);
}

.image-thumb-frame {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  margin-bottom: 6px;
  padding: 4px;
}

[data-theme="dark"] .image-thumb-frame {
  background: #0f172a;
  border-color: #334155;
}

.image-thumb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
  border-radius: 2px;
}

.image-item-meta {
  width: 100%;
  margin-bottom: 6px;
}

.image-item-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .image-item-title {
  color: #f8fafc;
}

.image-item-sub {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 600;
}

.image-item-actions {
  width: 100%;
  display: flex;
  gap: 3px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

[data-theme="dark"] .image-item-actions {
  background: #0f172a;
  border-color: #334155;
}

.image-item-btn {
  height: 24px;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #ffffff;
  border-radius: 3px;
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .image-item-btn {
  background: #1e293b;
  color: #cbd5e1;
}

.image-item-btn:hover {
  background: #0f172a;
  color: #ffffff;
}

.image-item-btn.btn-del:hover {
  background: #dc2626;
  color: #ffffff;
}

/* PDF Live Preview Stage (Matching pdf-tools stage) */
.pdf-preview-stage-box {
  background: #0f172a;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-height: 480px;
}

.pdf-preview-toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.76rem;
  flex-wrap: wrap;
  gap: 6px;
}

.pdf-preview-canvas-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: calc(100vh - 250px);
  min-height: 420px;
  padding: 14px;
  background: #1e293b;
  border-radius: 4px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

#pdfJpgPreview {
  max-width: 100%;
  height: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  background: #ffffff;
}
