/* ==========================================================================
   Vendora PDF Converter & Editor Toolkit - Stylesheet
   Extends and refines /tools/tool-system.css with high-end dark glassmorphism
   ========================================================================== */

/* --- Tool Categories & Layout --- */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 24px;
  justify-content: center;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-chip.active {
  background: rgba(0, 208, 132, 0.12);
  color: var(--brand);
  border-color: rgba(0, 208, 132, 0.45);
  box-shadow: 0 4px 15px rgba(0, 208, 132, 0.08);
}

/* --- Search & Bar --- */
.search-container {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-bar {
  width: 100%;
  padding: 14px 16px 14px 46px !important;
  border-radius: 99px !important;
  font-size: 1.02rem;
  background: rgba(12, 27, 49, 0.6) !important;
  backdrop-filter: blur(8px);
  transition: all 0.22s ease !important;
}

.search-bar:focus {
  background: rgba(12, 27, 49, 0.8) !important;
}

/* --- Dynamic Hub Grid --- */
.tools-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
  transition: opacity 0.25s ease;
}

.tool-card {
  margin: 0 !important;
  padding: 24px !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--brand);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 208, 132, 0.35);
  background: rgba(14, 32, 56, 0.95);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  display: inline-block;
  line-height: 1;
}

.tool-card-title {
  margin: 0 0 10px 0;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.tool-card-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

/* Status Indicators inside catalog */
.tool-status-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: auto;
}

.status-badge-basic {
  background: rgba(91, 140, 255, 0.1);
  color: var(--blue-accent);
  border: 1px solid rgba(91, 140, 255, 0.25);
}

.status-badge-future {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* --- Dynamic Workspace Container --- */
.tool-workspace {
  margin-top: 32px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.workspace-title-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.workspace-icon {
  font-size: 2.2rem;
}

.workspace-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* --- Upload Drop Zone --- */
.upload-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.upload-drop-zone:hover,
.upload-drop-zone.dragover {
  border-color: var(--brand);
  background: rgba(0, 208, 132, 0.03);
  box-shadow: 0 0 40px rgba(0, 208, 132, 0.06) inset;
}

.upload-drop-zone input[type="file"] {
  display: none;
}

.upload-icon {
  font-size: 3.4rem;
  margin-bottom: 16px;
  display: inline-block;
  color: var(--brand);
  transition: transform 0.25s ease;
}

.upload-drop-zone:hover .upload-icon {
  transform: translateY(-4px);
}

.upload-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.upload-subtitle {
  font-size: 0.94rem;
  color: var(--muted);
  margin-bottom: 18px;
}

/* --- Privacy Notice Banner --- */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 208, 132, 0.08);
  border: 1px solid rgba(0, 208, 132, 0.2);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  margin-top: 10px;
}

.limitation-alert {
  background: rgba(91, 140, 255, 0.08);
  border: 1px solid rgba(91, 140, 255, 0.2);
  color: #a5c2ff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.limitation-alert strong {
  color: var(--blue-accent);
}

/* --- Processing Dashboard --- */
.processing-container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .processing-container {
    grid-template-columns: 1fr;
  }
}

/* --- File List / Preview Canvas --- */
.files-preview-pane {
  background: rgba(12, 27, 49, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 300px;
  max-height: 620px;
  overflow-y: auto;
}

/* Organized Thumbnail Canvas Grids */
.thumbnail-canvas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.thumbnail-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  position: relative;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.thumbnail-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.thumbnail-card:active {
  cursor: grabbing;
}

.thumbnail-card.dragging {
  opacity: 0.5;
  border-color: var(--brand);
}

.thumbnail-container {
  background: #060b13;
  aspect-ratio: 1 / 1.41; /* standard portrait aspect ratio */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  position: relative;
}

.thumbnail-container canvas,
.thumbnail-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.thumbnail-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

/* Card Control Overlays */
.thumbnail-controls {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.thumbnail-card:hover .thumbnail-controls {
  opacity: 1;
}

.card-control-btn {
  background: rgba(8, 19, 36, 0.85);
  color: #fff;
  border: 1px solid var(--line);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.15s;
}

.card-control-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.card-control-btn.rotate-btn:hover {
  background: var(--blue-accent);
  border-color: var(--blue-accent);
}

/* Generic File rows */
.file-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.file-row-item:last-child {
  margin-bottom: 0;
}

.file-row-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-row-icon {
  font-size: 1.8rem;
}

.file-row-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row-size {
  font-size: 0.8rem;
  color: var(--muted);
}

/* --- Options Sidebar Panel --- */
.options-sidebar {
  background: rgba(12, 27, 49, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  color: var(--text);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* Form controls overrides */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.96rem;
  box-sizing: border-box;
}

.form-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.96rem;
}

/* Dynamic range input styling */
.slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-group input[type="range"] {
  flex-grow: 1;
  min-height: auto;
  accent-color: var(--brand);
}

.slider-val {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  min-width: 42px;
  text-align: right;
}

/* --- Progress Bar and Logs --- */
.progress-overlay {
  display: none;
  background: rgba(12, 27, 49, 0.95);
  backdrop-filter: blur(8px);
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border-radius: var(--radius-lg);
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-text {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.progress-sub {
  font-size: 0.94rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.progress-bar-bg {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--brand);
  border-radius: 99px;
  transition: width 0.15s ease;
}

/* --- Action states / Results overlay --- */
.output-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  border: 1px solid rgba(0, 208, 132, 0.25);
  background: rgba(0, 208, 132, 0.03);
  border-radius: var(--radius-lg);
  margin-top: 24px;
}

.success-icon {
  font-size: 3.6rem;
  color: var(--brand);
  margin-bottom: 16px;
  display: inline-block;
  line-height: 1;
}

.success-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.success-desc {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 480px;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* --- Utility Classes --- */
.hidden {
  display: none !important;
}

.text-danger {
  color: #ef4444;
}

.error-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ff9494;
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.94rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Why Choose Us Section --- */
.features-section {
  padding: 48px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

@media (max-width: 820px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.feature-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.feature-box:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.feature-box-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  display: inline-block;
  line-height: 1;
}

.feature-box h3 {
  margin: 0 0 10px 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.feature-box p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ==========================================================================
   PDF Pre-Conversion Intelligence & Safeguard Panel Styles
   ========================================================================== */

.pdf-intelligence-panel {
  background: rgba(12, 27, 49, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 10px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.pdf-intelligence-panel .sidebar-subtitle {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.pdf-intelligence-panel .metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.pdf-intelligence-panel .metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pdf-intelligence-panel .metric-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pdf-intelligence-panel .metric-label {
  color: var(--muted);
  font-weight: 500;
}

.pdf-intelligence-panel .metric-value {
  color: var(--text);
  font-weight: 600;
}

/* Badges for Intelligence Results */
.pdf-intelligence-panel .badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pdf-intelligence-panel .badge-success {
  background: rgba(0, 208, 132, 0.12);
  color: var(--brand);
  border: 1px solid rgba(0, 208, 132, 0.25);
}

.pdf-intelligence-panel .badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pdf-intelligence-panel .badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.pdf-intelligence-panel .badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Scanned Warning Box inside Options Sidebar */
.scanned-warning-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  color: #f87171;
  animation: fadeIn 0.25s ease;
}

.scanned-warning-box h5 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scanned-warning-box p {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #fca5a5;
}

.scanned-warning-box .roadmap-block {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  border-left: 3px solid #f59e0b;
}

.scanned-warning-box .roadmap-block strong {
  display: block;
  margin-bottom: 6px;
  color: #fbbf24;
}

.scanned-warning-box .roadmap-block ul {
  margin: 0;
  padding-left: 16px;
  color: #e2e8f0;
}

.scanned-warning-box .roadmap-block li {
  margin-bottom: 4px;
}

/* Scanned Preview Canvas Warning Overlay */
.scanned-warning-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 27, 49, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 10;
  animation: fadeIn 0.3s ease;
}

.scanned-warning-content {
  max-width: 320px;
}

.scanned-warning-content .warning-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: inline-block;
}

.scanned-warning-content h4 {
  margin: 0 0 10px 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f87171;
}

.scanned-warning-content p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Button & Action Overrides for Disabled Execution */
.btn-primary.disabled,
.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-warning {
  background: #f59e0b;
  color: #0b1329;
  border: 1px solid #f59e0b;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-warning:hover {
  background: #d97706;
  border-color: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
