/* ============================================
   PDF → PPTX Converter — Freecvt.com
   Design System & Full Stylesheet
   ============================================ */

:root {
  --bg-primary: #0f0f14;
  --bg-secondary: #1a1a24;
  --bg-tertiary: #24243a;
  --border-color: #2e2e48;
  --border-hover: #6366f1;
  --text-primary: #e0e0e0;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --max-w: 640px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* ---- Skip Link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-size: 14px;
  font-weight: 600;
}
.skip-link:focus {
  top: 16px;
}

/* ---- Header ---- */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo:hover { color: var(--accent-hover); }

/* ---- Nav Toggle (Mobile) ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Nav Grid ---- */
.main-nav {
  overflow: hidden;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.main-nav.open .nav-grid {
  max-height: 2000px;
}

.nav-grid a {
  display: block;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-grid a:hover,
.nav-grid a:focus {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-grid a.active {
  background: var(--accent-glow);
  color: var(--accent-hover);
  font-weight: 600;
}

@media (min-width: 1024px) {
  .main-nav { overflow: visible; }
  .nav-grid {
    max-height: none;
    overflow: visible;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .nav-toggle { display: none !important; }
}

@media (max-width: 1023px) {
  .nav-toggle { display: flex; }
}

/* ---- Main Content ---- */
.converter-page {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ---- Hero ---- */
.converter-hero {
  text-align: center;
  margin-bottom: 32px;
}

.converter-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ---- Converter Section ---- */
.converter-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 40px;
}

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 12px;
  transition: color 0.2s;
}
.upload-zone:hover .upload-icon,
.upload-zone.dragover .upload-icon {
  color: var(--accent);
}

.upload-text {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-subtext {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.upload-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- File List ---- */
.file-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.file-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

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

.file-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.file-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.file-remove:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* ---- Progress ---- */
.progress-container {
  margin-top: 16px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
}

/* ---- Convert Button ---- */
.btn-convert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.1s;
}

.btn-convert:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-convert:active:not(:disabled) {
  transform: scale(0.98);
}

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

.btn-convert .btn-icon {
  font-size: 1.1rem;
}

/* ---- Result Area ---- */
.result-area {
  margin-top: 16px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.result-item.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.result-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

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

.result-name {
  font-size: 0.875rem;
  font-weight: 600;
}

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

.result-download {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--success);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}
.result-download:hover { opacity: 0.85; color: #fff; }

/* ---- Info Section ---- */
.info-section {
  margin-bottom: 40px;
}

.info-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.step {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 10px;
}

.step h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.step p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- FAQ Section ---- */
.faq-section {
  margin-bottom: 40px;
}

.faq-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.faq-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.faq-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 20px;
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .converter-hero h1 { font-size: 1.5rem; }
  .converter-section { padding: 20px 16px; }
  .upload-zone { padding: 28px 16px; }
  .steps { grid-template-columns: 1fr 1fr; }
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.file-item,
.result-item {
  animation: fadeIn 0.25s ease-out;
}

/* ---- Spinner ---- */
.spinner-small {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---- Status Badge ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
}

.status-badge.success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
}

/* ---- Utility ---- */
[hidden] { display: none !important; }

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