@import url('tool-shared.css');

.compressor-card {
  gap: 1.5rem;
}

.compressor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  align-items: stretch;
}

.drop-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 2.75rem 1.5rem;
  text-align: center;
  background: rgba(7, 7, 8, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.dropzone .file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  overflow: hidden;
  white-space: nowrap;
}

.dropzone.is-dragover {
  border-color: rgba(0, 207, 213, 0.8);
  background: rgba(0, 207, 213, 0.08);
  transform: translateY(-2px);
}

.drop-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(0, 207, 213, 0.08);
  border: 1px solid rgba(0, 207, 213, 0.25);
}

.drop-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.drop-subtitle {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.drop-feedback {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.drop-feedback[data-tone="success"] {
  color: #36d399;
}

.drop-feedback[data-tone="warning"] {
  color: #ffd479;
}

.drop-feedback[data-tone="error"] {
  color: var(--danger);
}

.options-panel {
  background: rgba(7, 8, 10, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.options-panel h2 {
  margin-bottom: -0.25rem;
}

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

.option-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.option-row > :first-child {
  flex: 1;
}

.option-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.option-row select {
  width: 220px;
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-main);
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
}

.option-label {
  font-weight: 600;
}

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

.option-value {
  font-weight: 700;
  color: var(--accent);
}

.switch {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  margin-left: 2px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch input:checked + .switch-slider {
  transform: translateX(20px);
  background: var(--accent);
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.2rem;
}

.head-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.summary-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1rem 1.25rem;
}

.global-stats {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.global-stat {
  flex: 1 1 220px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
}

.global-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.global-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.summary-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.summary-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.results-list {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.results-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 16, 0.55);
  align-items: flex-start;
}

.result-main {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-name {
  font-size: 1rem;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.status-badge {
  padding: 0.15rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-badge[data-state="processing"] {
  border-color: rgba(0, 207, 213, 0.4);
  color: var(--accent);
}

.status-badge[data-state="done"] {
  border-color: rgba(54, 211, 153, 0.6);
  color: #36d399;
}

.status-badge[data-state="error"] {
  border-color: rgba(255, 78, 85, 0.6);
  color: var(--danger);
}

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

.job-error {
  color: var(--danger);
  font-size: 0.9rem;
}

.job-note {
  color: var(--accent);
  font-size: 0.85rem;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, auto));
  gap: 1.2rem;
  align-items: flex-start;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.stat-value.success {
  color: #36d399;
}

.stat-value.muted {
  color: var(--text-muted);
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  min-width: 140px;
}

.result-actions .button {
  width: 100%;
}

.icon-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: transparent;
  color: var(--text-main);
  padding: 0.4rem 0.6rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.icon-button:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--accent);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.icon-button--danger {
  border-color: rgba(255, 78, 85, 0.4);
  color: var(--danger);
}

.icon-button--danger:hover {
  border-color: rgba(255, 78, 85, 0.8);
  color: #ff6b73;
}

.info-card {
  display: grid;
  gap: 1.25rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.info-grid article {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.faq-card h2 {
  margin-bottom: 0.5rem;
}

@media (max-width: 992px) {
  .compressor-grid {
    grid-template-columns: 1fr;
  }

  .result-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .result-stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .result-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .result-actions .button,
  .result-actions .icon-button {
    flex: 1;
  }
}

@media (max-width: 640px) {
  .dropzone {
    padding: 2rem 1rem;
  }

  .results-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

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

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

  .result-actions {
    flex-direction: column;
    width: 100%;
  }

  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
}
