/* ============================================================
   TRADESALA TOOLSPOT — PDF TO JPG SPECIFIC STYLES
   ============================================================ */

.tool-header {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 900px;
  margin: 0 auto 40px auto;
}

.tool-layout {
  display: flex;
  justify-content: center;
  margin: 0 auto !important;
  max-width: 900px;
  width: 100%;
}

.p2w-panel {
  width: 100%;
  padding: 40px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.workbench-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  width: 100%;
}

.p2w-dropzone, .loading-view, .jpg-editor, .success-panel {
  grid-area: 1 / 1 / 2 / 2;
  transition: opacity 0.3s ease;
  width: 100%;
}

@media (max-width: 768px) {
  .p2w-panel {
    padding: 25px;
  }
}

/* ── DROPZONE ── */
.p2w-dropzone {
  width: 100% !important;
  box-sizing: border-box;
  border: 2px dashed var(--glass-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  padding: 60px 20px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.p2w-dropzone:hover,
.p2w-dropzone.drag-over {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--red);
  transform: translateY(-2px);
}

.drop-icon {
  font-size: 64px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 20px rgba(249, 115, 22, 0.2));
  transition: transform 0.3s ease;
}

.p2w-dropzone h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.p2w-dropzone p {
  color: var(--text-3);
  margin-bottom: 30px;
}

.privacy-badge {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: inline-block;
}

/* ── ELITE LOADER ── */
.loading-view {
  padding: 80px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loader-percentage {
  font-family: 'Outfit', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.loading-view h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 25px;
  font-weight: 600;
}

.elite-progress-container {
  width: 100%;
  max-width: 400px;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

.elite-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), #f97316);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
  width: 0%;
  transition: width 0.3s ease;
}

.loader-hint {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
}

/* ── GLASS BUTTONS ── */
.rb-btn {
  background: rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text) !important;
  padding: 14px 36px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  text-decoration: none;
}

.rb-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.rb-btn-primary {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: var(--red) !important;
}

.rb-btn-primary:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: var(--red) !important;
}

/* ── EDITOR HEADER ── */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  gap: 15px;
}

.file-info {
  display: flex;
  flex-direction: column;
}

.file-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.file-meta {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

.editor-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ── MODE SELECTOR (Quality/Format Switcher) ── */
.mode-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 12px;
  position: relative;
  border: 1px solid var(--glass-border);
  min-width: 140px; /* Standardize width */
}

.mode-btn {
  flex: 1; /* Equal widths for symmetry */
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  letter-spacing: 0.3px;
  font-family: 'Outfit', sans-serif;
  text-align: center;
}

.mode-btn.active {
  color: #fff;
}

.mode-glider {
  position: absolute;
  height: calc(100% - 8px);
  background: var(--red);
  border-radius: 8px;
  top: 4px;
  left: 4px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ── IMAGE PREVIEW GRID ── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  max-height: 520px;
  overflow-y: auto;
  padding: 10px;
  margin-bottom: 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.image-grid::-webkit-scrollbar {
  width: 6px;
}

.image-grid::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

.image-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
}

.image-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.image-card.selected {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.05);
}

.selection-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
}

.check-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.check-box.checked {
  background: var(--red);
  border-color: var(--red);
}

.check-box.checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.text-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-btn:hover {
  color: #f97316;
}

.image-preview-container {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #1e1e2e;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.image-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.page-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
}

.dl-single-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Outfit', sans-serif;
}

.dl-single-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

/* ── FOOTER CONTROLS ── */
.editor-footer-controls {
  margin-top: 10px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── SUCCESS PANEL ── */
.success-panel {
  text-align: center;
  padding: 40px 0;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 30px rgba(249, 115, 22, 0.3));
}

.success-panel h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.success-panel p {
  color: var(--text-2);
  margin-bottom: 20px;
}

.success-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px auto 30px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 120px;
}

.stat-pill .stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
}

.stat-pill .stat-lbl {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
}

/* ── TOOL DETAILS (GEO OPTIMIZATION) ── */
.tool-details {
  margin-top: 60px;
  text-align: left;
}

.tool-details h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 30px;
  color: var(--text);
  letter-spacing: -0.5px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}

.detail-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.detail-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.detail-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 12px;
  font-family: 'Outfit', sans-serif;
}

.detail-card p {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .tool-details h2 {
    font-size: 24px;
  }
  
  .editor-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .editor-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .editor-footer-controls {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .footer-left, .footer-right {
    width: 100%;
  }

  .footer-right .rb-btn {
    width: 100%;
  }

  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .action-buttons .rb-btn {
    width: 100%;
  }

  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
