/* SwapHEIC — style.css */
/* Design language: dark-first, minimal, citytime.io aesthetic */

:root {
  --bg: #0a0a14;
  --bg-2: #12121f;
  --bg-3: #1a1a2e;
  --border: #2a2a40;
  --text: #e8e8f0;
  --text-2: #9090a8;
  --text-3: #5a5a72;
  --accent: #4a9eff;
  --accent-dim: #2a5a9a;
  --accent-glow: rgba(74, 158, 255, 0.12);
  --success: #4adf8a;
  --error: #ff5a5a;
  --warn: #ffaa4a;
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.18s ease;
}

[data-theme="light"] {
  --bg: #f4f4f8;
  --bg-2: #ffffff;
  --bg-3: #eaeaf0;
  --border: #d0d0e0;
  --text: #18181e;
  --text-2: #505068;
  --text-3: #9090a8;
  --accent: #2070d0;
  --accent-dim: #c0d8f8;
  --accent-glow: rgba(32, 112, 208, 0.08);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 0.5rem;
}

/* ─── Layout ─────────────────────────────────────── */
.site-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── Header ─────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0 0.5rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.site-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo span {
  color: var(--accent);
}

/* ─── Nav ────────────────────────────────────────── */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  width: 100%;
}

.nav-link {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  min-height: 36px;
  display: flex;
  align-items: center;
}
.nav-link:hover {
  background: var(--bg-3);
  color: var(--text);
}
.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 600;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ─── Main ───────────────────────────────────────── */
main {
  padding: 3rem 0 4rem;
}

/* ─── Hero ───────────────────────────────────────── */
.hero {
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.6rem;
}

.hero .subhead {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 520px;
}

/* ─── Uploader ───────────────────────────────────── */
.uploader {
  margin-bottom: 2rem;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg-2);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  user-select: none;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.drop-zone.drag-over {
  border-style: solid;
}

.drop-icon {
  width: 48px;
  height: 48px;
  color: var(--text-3);
  transition: color var(--transition);
}
.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
  color: var(--accent);
}

.drop-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.drop-sub {
  font-size: 0.875rem;
  color: var(--text-2);
}

.drop-limit {
  font-size: 0.78rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* ─── File list ──────────────────────────────────── */
.file-list-section {
  margin-bottom: 2rem;
}

.file-list-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: #6ab4ff;
  border-color: #6ab4ff;
}

.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: none;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--bg-3);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.file-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  transition: border-color var(--transition);
}
.file-card:hover {
  border-color: var(--border);
}
.file-card.status-converting {
  border-color: var(--accent-dim);
}
.file-card.status-done {
  border-color: var(--success);
}
.file-card.status-error {
  border-color: var(--error);
}

.file-thumb {
  width: 52px;
  height: 52px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-thumb .thumb-icon {
  width: 28px;
  height: 28px;
  color: var(--text-3);
}

.file-info {
  min-width: 0;
}
.file-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}
.file-meta {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-3);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.file-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
}
.file-status.ready { color: var(--text-3); }
.file-status.converting { color: var(--accent); }
.file-status.done { color: var(--success); }
.file-status.error { color: var(--error); }

.file-status.converting::before {
  content: '';
  width: 8px;
  height: 8px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.file-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}
.icon-btn svg {
  width: 15px;
  height: 15px;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--text-2);
}
.icon-btn.download-btn {
  color: var(--success);
  border-color: var(--success);
}
.icon-btn.download-btn:hover {
  background: rgba(74, 223, 138, 0.1);
}
.icon-btn.remove-btn:hover {
  color: var(--error);
  border-color: var(--error);
  background: rgba(255, 90, 90, 0.08);
}

/* Progress bar */
.progress-bar-wrap {
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ─── Privacy note ───────────────────────────────── */
.privacy-note {
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.privacy-note .lock-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ─── Content sections ───────────────────────────── */
.content-section {
  margin-bottom: 3rem;
}

.content-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.content-section p {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ─── Other tools grid ───────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
}
.tool-card:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.tool-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.tool-card-desc {
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ─── FAQ ────────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.1rem;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background var(--transition);
  min-height: 44px;
}
.faq-q:hover {
  background: var(--bg-3);
}
.faq-q svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-item.open .faq-q svg {
  transform: rotate(180deg);
}
.faq-a {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.7;
  padding: 0 1.1rem 1rem;
  display: none;
}
.faq-item.open .faq-a {
  display: block;
}

/* ─── Footer ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-note {
  font-size: 0.78rem;
  color: var(--text-3);
}

.footer-links {
  display: flex;
  gap: 1rem;
}
.footer-links a {
  font-size: 0.78rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover {
  color: var(--text-2);
}

/* ─── Toast / notifications ──────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  max-width: 320px;
  animation: toast-in 0.2s ease;
}
.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--success); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Divider ────────────────────────────────────── */
hr.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 600px) {
  .site-wrapper { padding: 0 1rem; }

  main { padding: 2rem 0 3rem; }

  .hero h1 { font-size: 1.6rem; }

  .drop-zone { padding: 2rem 1.25rem; min-height: 200px; }

  .file-card {
    grid-template-columns: 44px 1fr auto;
    gap: 0.6rem;
  }
  .file-thumb {
    width: 44px;
    height: 44px;
  }

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

  .footer-inner { flex-direction: column; align-items: flex-start; }

  .nav-link { font-size: 0.78rem; padding: 5px 8px; min-height: 32px; }
  .main-nav { gap: 3px 4px; }
}

@media (max-width: 400px) {
  .tools-grid { grid-template-columns: 1fr; }
  .file-list-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}
