/* Tool Workspace & Layout Styles */

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs span.separator {
  opacity: 0.5;
}

.breadcrumbs span.current {
  color: var(--secondary);
  font-weight: 500;
}

/* Tool Workspace Container */
.tool-container {
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.tool-header-block {
  text-align: center;
  margin-bottom: 1rem;
}

.tool-header-block h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
}

.tool-header-block p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

/* Tool Interface Box */
.tool-workspace {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
}

/* Drag & Drop File Zone */
.upload-zone {
  border: 2px dashed rgba(13, 110, 253, 0.3);
  background: rgba(9, 13, 22, 0.4);
  border-radius: var(--border-radius-md);
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(13, 110, 253, 0.05);
  box-shadow: 0 0 20px rgba(13, 110, 253, 0.15);
}

.upload-zone-icon {
  width: 64px;
  height: 64px;
  color: var(--primary);
  transition: transform var(--transition-fast);
}

.upload-zone:hover .upload-zone-icon {
  transform: translateY(-5px) scale(1.05);
}

.upload-zone-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
}

.upload-zone-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* File Input Hidden */
.file-input {
  display: none;
}

/* Settings and Options for Tools */
.tool-options-panel {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tool-options-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Select, range sliders, check inputs */
.option-select, .option-text-input {
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.option-select:focus, .option-text-input:focus {
  outline: none;
  border-color: var(--primary);
}

.range-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.option-range {
  flex-grow: 1;
  accent-color: var(--primary);
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
}

.range-val {
  font-weight: 600;
  min-width: 40px;
}

/* Action Area (Buttons) */
.action-area {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.action-btn-container {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
}

/* File list after upload */
.selected-files-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.file-item-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.file-item-size {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0.25rem;
}

/* Progress and Processing States */
.processing-indicator {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(13, 110, 253, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

/* Double Panel / Text Editors (For Converters, JSON tools, etc.) */
.editor-panels-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.editor-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
}

.editor-textarea {
  width: 100%;
  height: 350px;
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
  resize: vertical;
  line-height: 1.5;
}

.editor-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(13, 110, 253, 0.15);
}

/* Custom mini action btns */
.panel-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.panel-action-btn:hover {
  background: var(--primary);
  color: var(--secondary);
}

/* Tool Result Box (Success / Download Screen) */
.tool-result-box {
  display: none;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--border-radius-md);
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.result-success-icon {
  width: 48px;
  height: 48px;
  color: #10b981;
}

.result-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
}

/* SEO Content Area */
.tool-seo-section {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.seo-card {
  background: var(--bg-dark-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 3rem;
  box-shadow: var(--glass-shadow);
}

.seo-card h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 1.5rem;
}

.seo-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--secondary);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.seo-card p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.seo-card ul {
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.seo-card li {
  position: relative;
  padding-left: 2rem;
  color: var(--text-muted);
}

.seo-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.1rem;
}

.benefits-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
}

.benefits-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: rgba(9, 13, 22, 0.4);
}

.benefits-table th, .benefits-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.benefits-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.benefits-table td {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.benefits-table tr:last-child td {
  border-bottom: none;
}

/* Accordion FAQs */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.faq-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}

.faq-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--secondary);
  user-select: none;
}

.faq-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.faq-arrow {
  width: 20px;
  height: 20px;
  color: var(--primary);
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-arrow {
  transform: rotate(180deg);
}

.faq-body {
  display: none;
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.active .faq-body {
  display: block;
}

/* Related Tools Panel */
.related-tools-section h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 1.5rem;
}

/* Responsive adjust for editors & workspaces */
@media (max-width: 768px) {
  .tool-container {
    padding: 0 1rem;
    margin-top: 1.5rem;
    gap: 2rem;
  }
  .editor-panels-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .editor-textarea {
    height: 250px;
  }
  .tool-header-block h1 {
    font-size: 2rem;
  }
  .tool-workspace {
    padding: 1.5rem;
  }
  .seo-card {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .tool-workspace {
    padding: 1rem;
  }
  .upload-zone {
    padding: 2rem 1rem;
  }
  .upload-zone-title {
    font-size: 1.1rem;
  }
  .upload-zone-subtitle {
    font-size: 0.85rem;
  }
  .seo-card {
    padding: 1.5rem 1rem;
  }
  .seo-card h2 {
    font-size: 1.45rem;
    margin-bottom: 1rem;
  }
  .seo-card h3 {
    font-size: 1.15rem;
    margin-top: 1.25rem;
  }
  .benefits-table th, .benefits-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
  .faq-header {
    padding: 1rem;
    font-size: 0.9rem;
  }
  .faq-body {
    padding: 0 1rem 1rem;
    font-size: 0.85rem;
  }
  .tool-options-panel {
    padding: 1rem;
  }
  .range-slider-wrapper {
    gap: 0.5rem;
  }
  .option-range {
    height: 4px;
  }
  .action-btn-container {
    max-width: 100%;
  }
  
  /* Compression Stats Mobile Collapse */
  #compression-stats {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
}
