/* ─── Tool Page Layout ────────────────────────────── */
.tool-header {
  text-align: center;
  padding: 48px 0 32px;
}

.tool-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.tool-header p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.tool-body {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 64px;
}

/* ─── Drop Zone ───────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  margin-bottom: 24px;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(193, 98, 42, 0.04);
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

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

.drop-zone-text strong {
  color: var(--accent);
}

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

/* ─── File List ───────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-item-name {
  flex: 1;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.file-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

/* ─── Options Panel ───────────────────────────────── */
.options-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.options-panel h3 {
  margin-bottom: 16px;
  font-size: 1rem;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

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

.option-row input[type="range"] {
  flex: 1;
  max-width: 200px;
  accent-color: var(--accent);
}

.option-row select {
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  outline: none;
}

/* ─── Action Bar ──────────────────────────────────── */
.action-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

/* ─── Result Area ─────────────────────────────────── */
.result-area {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.result-area.visible {
  display: block;
}

.result-area h3 {
  margin-bottom: 16px;
  font-size: 1rem;
}

/* ─── Preview ─────────────────────────────────────── */
.preview-container {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  max-height: 400px;
  overflow: auto;
}

.preview-container img {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

.preview-container pre {
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── Progress ────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ─── Text Area Tool ──────────────────────────────── */
.text-tool-area {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 24px;
}

.text-tool-area:focus {
  border-color: var(--accent);
}

/* ─── Two Column Layout ───────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ─── Info Box ────────────────────────────────────── */
.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.info-box h3 {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.info-box ul {
  list-style: none;
  padding: 0;
}

.info-box li {
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.info-box li::before {
  content: '✓ ';
  color: var(--accent);
}

/* ─── Loading State ───────────────────────────────── */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.btn-loading .btn-text {
  visibility: hidden;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

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

@media (max-width: 768px) {
  .tool-header {
    padding: 32px 0 24px;
  }

  .tool-header h1 {
    font-size: 1.5rem;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-bar .btn {
    width: 100%;
  }

  .option-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .option-row input[type="range"] {
    max-width: 100%;
    width: 100%;
  }

  .option-row select {
    width: 100%;
  }

  .drop-zone {
    padding: 32px 16px;
  }

  .drop-zone-icon {
    font-size: 2.2rem;
  }

  .options-panel {
    padding: 16px;
  }

  .result-area {
    padding: 16px;
  }

  .file-item {
    flex-wrap: wrap;
  }

  .file-item-name {
    min-width: 0;
    white-space: normal;
    word-break: break-all;
  }

  .info-box {
    padding: 16px;
  }
}
