/* PixLite – mobile-first, responsive */

:root {
  --bg: #0f0f12;
  --surface: #1a1a1f;
  --border: #2d2d35;
  --text: #e8e8ec;
  --text-muted: #9a9aa3;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --error: #f87171;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.header {
  padding: 1.5rem 1rem;
  text-align: center;
}

.title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.privacy-icon {
  font-size: 1rem;
}

/* Main */
.main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Input section */
.input-section {
  margin-bottom: 1.5rem;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

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

.drop-zone-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.batch-error {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  color: var(--error);
  font-size: 0.9rem;
}

/* Options */
.options-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.option {
  flex: 1 1 100%;
  min-width: 0;
}

@media (min-width: 480px) {
  .option {
    flex: 1 1 auto;
  }
}

.option label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.option output {
  font-weight: 600;
  color: var(--text);
}

.option input[type="range"] {
  width: 100%;
  height: 8px;
  margin: 0;
  accent-color: var(--accent);
}

.option select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.option select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Results */
.results-section {
  margin-top: 1.5rem;
}

.results-actions {
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

@media (min-width: 480px) {
  .btn-primary {
    width: auto;
  }
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

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

.result-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.result-thumb-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.result-thumb {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
}

.thumb-indicator {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.8);
  transform-origin: center;
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.thumb-indicator-spinner .thumb-spinner {
  border: 2px solid rgba(148, 163, 184, 0.45);
  border-top-color: var(--accent);
  border-radius: 999px;
  width: 14px;
  height: 14px;
  animation: thumb-spin 0.75s linear infinite;
}

.thumb-indicator-check {
  background: #22c55e;
  color: #022c22;
  font-size: 0.9rem;
  font-weight: 700;
}

.thumb-check-icon {
  line-height: 1;
}

.result-info {
  flex: 1 1 200px;
  min-width: 0;
}

.result-name {
  font-weight: 500;
  margin: 0 0 0.25rem;
  word-break: break-all;
}

.result-sizes {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.result-sizes .savings {
  color: #86efac;
}

.result-actions {
  flex-shrink: 0;
}

.result-item .btn {
  margin-top: 0.5rem;
}

@media (min-width: 480px) {
  .result-item .btn {
    margin-top: 0;
  }
}

.result-error {
  color: var(--error);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.result-item.is-loading .thumb-indicator-spinner {
  opacity: 1;
  transform: scale(1);
}

.result-item.is-done .thumb-indicator-check {
  opacity: 1;
  transform: scale(1);
  animation: thumb-check-pop 0.22s ease-out;
}

.result-item.is-error .thumb-indicator-spinner,
.result-item.is-error .thumb-indicator-check {
  opacity: 0;
}

.result-item.compressing .result-thumb {
  opacity: 0.7;
}

.result-item.compressing .result-actions {
  pointer-events: none;
  opacity: 0.7;
}

/* About / SEO content */
#about {
  max-width: 560px;
  margin: 2.5rem auto 0;
  padding: 1.5rem 1.5rem 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

#about h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

#about h2:first-of-type {
  margin-top: 0;
}

#about p {
  margin: 0.4rem 0 0.75rem;
}

#about ol,
#about ul {
  margin: 0.25rem 0 0.85rem;
  padding-left: 1.2rem;
}

#about li + li {
  margin-top: 0.25rem;
}

#about strong {
  color: var(--text);
}

#about .faq-item {
  margin-top: 0.75rem;
}

#about table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 0.5rem;
  font-size: 0.9rem;
}

#about th,
#about td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

#about th {
  background: #13131a;
  color: var(--text);
  font-weight: 600;
}

#about tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.01);
}

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

@keyframes thumb-check-pop {
  0% {
    transform: scale(0.6);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.25rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-copy {
  margin: 0;
  text-align: center;
}

/* Legal pages */
.legal-main {
  max-width: 720px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem 3rem;
}

.legal-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.75rem 1.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  box-shadow: var(--shadow);
}

.legal-card h1,
.legal-card h2,
.legal-card h3,
.legal-card h4 {
  color: var(--text);
}

.legal-card h1 {
  margin-top: 0;
  font-size: 1.5rem;
}

.legal-card h2 {
  margin-top: 1.75rem;
  font-size: 1.15rem;
}

.legal-card h3,
.legal-card h4 {
  margin-top: 1.25rem;
  font-size: 1rem;
}

.legal-card p {
  margin: 0.5rem 0 0.75rem;
}

.legal-card ul {
  margin: 0.25rem 0 0.85rem;
  padding-left: 1.2rem;
}

.legal-card li + li {
  margin-top: 0.25rem;
}

.legal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
}

.legal-back-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.header-home-link {
  text-decoration: none;
  color: inherit;
}

.header-home-link:hover .title {
  color: var(--accent-hover);
}
