/* ================================================================
   FileConvert — Dark Theme Stylesheet
   ================================================================ */

:root {
  --bg-base:        #0a0a0f;
  --bg-card:        rgba(255,255,255,0.04);
  --bg-card-hover:  rgba(255,255,255,0.07);
  --border:         rgba(255,255,255,0.08);
  --border-accent:  rgba(108,99,255,0.4);
  --text-primary:   #f0f0f8;
  --text-secondary: #8888aa;
  --text-muted:     #555577;
  --accent:         #6c63ff;
  --accent-hover:   #7c73ff;
  --accent-glow:    rgba(108,99,255,0.3);
  --success:        #22c55e;
  --success-bg:     rgba(34,197,94,0.1);
  --error:          #ef4444;
  --error-bg:       rgba(239,68,68,0.1);
  --warning:        #f59e0b;
  --cat-image:      #a78bfa;
  --cat-audio:      #34d399;
  --cat-video:      #f472b6;
  --cat-document:   #60a5fa;
  --cat-data:       #fbbf24;
  --cat-archive:    #fb923c;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      20px;
  --shadow:         0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:      0 16px 64px rgba(0,0,0,0.6);
  --transition:     0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Background gradient ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(108,99,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(34,197,94,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 60% 30%, rgba(239,68,68,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Header ── */
.site-header {
  text-align: center;
  margin-bottom: 48px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--accent-glow);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

h1.site-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #a78bfa 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ── Card base ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 28px;
  transition: border-color var(--transition);
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 50%, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(108,99,255,0.04);
}

.drop-zone:hover::before,
.drop-zone.dragover::before {
  opacity: 1;
}

.drop-zone.dragover {
  transform: scale(1.01);
  box-shadow: 0 0 40px var(--accent-glow);
}

.drop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(167,139,250,0.2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.drop-zone:hover .drop-icon,
.drop-zone.dragover .drop-icon {
  transform: scale(1.1) translateY(-3px);
}

.drop-icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.drop-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

.drop-subtitle span {
  color: var(--accent);
  font-weight: 500;
}

.drop-formats {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── File info (after drop) ── */
.file-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  animation: slideIn 0.3s ease;
}

.file-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}

.file-remove:hover {
  color: var(--error);
  background: var(--error-bg);
}

.file-remove svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* ── Section labels ── */
.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Format pills ── */
.format-picker {
  margin-bottom: 28px;
}

.format-category {
  margin-bottom: 20px;
}

.category-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-label::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.category-image .category-label   { color: var(--cat-image); }
.category-audio .category-label   { color: var(--cat-audio); }
.category-video .category-label   { color: var(--cat-video); }
.category-document .category-label{ color: var(--cat-document); }
.category-data .category-label    { color: var(--cat-data); }
.category-archive .category-label { color: var(--cat-archive); }

.category-image .category-label::before    { background: var(--cat-image); }
.category-audio .category-label::before    { background: var(--cat-audio); }
.category-video .category-label::before    { background: var(--cat-video); }
.category-document .category-label::before { background: var(--cat-document); }
.category-data .category-label::before     { background: var(--cat-data); }
.category-archive .category-label::before  { background: var(--cat-archive); }

.pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  user-select: none;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}

.pill:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.category-image   .pill.selected { background: rgba(167,139,250,0.2); border-color: var(--cat-image); color: var(--cat-image); }
.category-audio   .pill.selected { background: rgba(52,211,153,0.2);  border-color: var(--cat-audio); color: var(--cat-audio); }
.category-video   .pill.selected { background: rgba(244,114,182,0.2); border-color: var(--cat-video); color: var(--cat-video); }
.category-document .pill.selected{ background: rgba(96,165,250,0.2);  border-color: var(--cat-document); color: var(--cat-document); }
.category-data    .pill.selected { background: rgba(251,191,36,0.2);  border-color: var(--cat-data); color: var(--cat-data); }
.category-archive .pill.selected { background: rgba(251,146,60,0.2);  border-color: var(--cat-archive); color: var(--cat-archive); }

/* ── Convert button ── */
.btn-convert {
  width: 100%;
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-convert::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-convert:hover:not(:disabled)::before {
  opacity: 1;
}

.btn-convert:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-convert:active:not(:disabled) {
  transform: translateY(0);
}

.btn-convert:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Progress ── */
.progress-section {
  animation: slideIn 0.3s ease;
}

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

.progress-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-pct {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 3em;
  text-align: right;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  transition: width 0.5s ease;
  position: relative;
  min-width: 0;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: translateX(200%); opacity: 0; }
}

.progress-message {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(108,99,255,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* ── Result / Download ── */
.result-section {
  animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
  0%   { transform: scale(0.9); opacity: 0; }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

.result-card {
  background: var(--success-bg);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.result-icon {
  width: 72px;
  height: 72px;
  background: rgba(34,197,94,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.result-icon svg {
  width: 36px;
  height: 36px;
  color: var(--success);
}

.result-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.result-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(34,197,94,0.3);
  margin-bottom: 20px;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(34,197,94,0.4);
}

.btn-download:active {
  transform: translateY(0);
}

.btn-download svg {
  width: 20px;
  height: 20px;
}

.btn-reset {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition);
  display: block;
  margin: 0 auto;
}

.btn-reset:hover {
  color: var(--text-secondary);
}

/* ── Error state ── */
.error-section {
  animation: slideIn 0.3s ease;
}

.error-card {
  background: var(--error-bg);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.error-icon {
  width: 40px;
  height: 40px;
  background: rgba(239,68,68,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.error-icon svg {
  width: 20px;
  height: 20px;
  color: var(--error);
}

.error-content h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--error);
  margin-bottom: 4px;
}

.error-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.error-actions {
  margin-top: 16px;
}

.btn-retry {
  padding: 8px 20px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-right: 10px;
}

.btn-retry:hover {
  background: rgba(239,68,68,0.25);
}

.btn-new-file {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-new-file:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding-top: 48px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

.site-footer .footer-highlight {
  color: var(--text-secondary);
}

.footer-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.footer-badge {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-badge.image    { background: rgba(167,139,250,0.15); color: var(--cat-image); }
.footer-badge.audio    { background: rgba(52,211,153,0.15);  color: var(--cat-audio); }
.footer-badge.video    { background: rgba(244,114,182,0.15); color: var(--cat-video); }
.footer-badge.document { background: rgba(96,165,250,0.15);  color: var(--cat-document); }
.footer-badge.data     { background: rgba(251,191,36,0.15);  color: var(--cat-data); }
.footer-badge.archive  { background: rgba(251,146,60,0.15);  color: var(--cat-archive); }

/* ── Animations ── */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Hidden utility ── */
.hidden { display: none !important; }

/* ── Step flow ── */
.step {
  margin-bottom: 24px;
  animation: slideIn 0.3s ease;
}

/* ── Max size notice ── */
.max-size-notice {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .page-wrapper {
    padding: 24px 16px 60px;
  }

  h1.site-title {
    font-size: 2rem;
  }

  .drop-zone {
    padding: 40px 20px;
  }

  .card {
    padding: 20px 16px;
  }

  .result-card {
    padding: 24px 16px;
  }

  .btn-download {
    padding: 12px 24px;
    font-size: 0.95rem;
  }

  .file-info {
    padding: 14px 16px;
  }
}

@media (max-width: 400px) {
  .drop-zone {
    padding: 32px 16px;
  }

  .pill {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}
