:root {
  color-scheme: light dark;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #101418;
  color: #e6e8ea;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #1f2a37, #0b1016 60%);
}

.app-header,
.app-footer {
  padding: 1.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
}

.privacy {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #8b9cb8;
}

.app-main {
  flex: 1;
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

section {
  background: rgba(16, 22, 30, 0.85);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.drop-zone {
  border: 2px dashed rgba(139, 156, 184, 0.6);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.drop-zone:focus,
.drop-zone.dragover {
  outline: none;
  border-color: #5c8aff;
  background: rgba(92, 138, 255, 0.15);
}

.primary,
.secondary {
  appearance: none;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 1rem;
}

.primary {
  background: linear-gradient(135deg, #5c8aff, #8a5cff);
  color: #fff;
  box-shadow: 0 10px 30px rgba(92, 138, 255, 0.4);
}

.primary:focus,
.primary:hover,
.secondary:focus,
.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(92, 138, 255, 0.35);
}

.secondary {
  background: rgba(92, 138, 255, 0.15);
  color: #c7d3ff;
  border: 1px solid rgba(92, 138, 255, 0.4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

input[type='range'] {
  width: 100%;
}

.switch {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.page-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  align-items: center;
}

.page-selector input[type='text'] {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.file-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(13, 18, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(135deg, #5c8aff, #8a5cff);
  transition: width 0.3s ease;
}

.status {
  font-size: 0.85rem;
  color: #8b9cb8;
}

.results-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.result-card {
  background: rgba(13, 18, 26, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.result-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.result-card footer {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-card button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(92, 138, 255, 0.3);
  background: rgba(92, 138, 255, 0.1);
  color: inherit;
  cursor: pointer;
}

@media (max-width: 768px) {
  body {
    background: #0b1016;
  }

  .app-main {
    padding: 1rem;
    display: flex;
    flex-direction: column;
  }

  .drop-zone {
    padding: 1.5rem;
  }

  section {
    padding: 1.25rem;
  }

  .primary,
  .secondary {
    width: 100%;
  }
}

:focus-visible {
  outline: 2px solid #8a5cff;
  outline-offset: 3px;
}
