/* ═══════════════════════════════════════════════ */
/*  CSS VARIABLES — THEME SYSTEM                  */
/* ═══════════════════════════════════════════════ */
:root {
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.18);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0e0f13;
  --bg-secondary: #161821;
  --bg-tertiary: #1c1f2b;
  --bg-card: #1a1d28;
  --bg-card-hover: #212431;
  --bg-input: #12131a;
  --border-color: #2a2d3a;
  --border-hover: #3d4155;
  --text-primary: #e8e9ed;
  --text-secondary: #9499ad;
  --text-muted: #5d6278;
  --accent: #6c8aff;
  --accent-hover: #849dff;
  --accent-bg: rgba(108,138,255,0.1);
  --accent-border: rgba(108,138,255,0.25);
  --success: #4ecf8b;
  --success-bg: rgba(78,207,139,0.1);
  --warning: #f5a623;
  --warning-bg: rgba(245,166,35,0.1);
  --error: #f25555;
  --error-bg: rgba(242,85,85,0.1);
  --drop-bg: rgba(108,138,255,0.05);
  --drop-border: rgba(108,138,255,0.4);
  --tag-bg: #1e2130;
  --tag-text: #8892b0;
  --scrollbar-thumb: #2a2d3a;
  --scrollbar-track: transparent;
  --glow: 0 0 30px rgba(108,138,255,0.15);
}

[data-theme="light"] {
  --bg-primary: #f4f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ebedf2;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fb;
  --bg-input: #f0f1f5;
  --border-color: #dde0e8;
  --border-hover: #c5c9d6;
  --text-primary: #1a1d2d;
  --text-secondary: #5a5f75;
  --text-muted: #949ab0;
  --accent: #4a6cf7;
  --accent-hover: #3b5ce6;
  --accent-bg: rgba(74,108,247,0.07);
  --accent-border: rgba(74,108,247,0.2);
  --success: #2a9d5e;
  --success-bg: rgba(42,157,94,0.08);
  --warning: #d4911a;
  --warning-bg: rgba(212,145,26,0.08);
  --error: #d93636;
  --error-bg: rgba(217,54,54,0.08);
  --drop-bg: rgba(74,108,247,0.04);
  --drop-border: rgba(74,108,247,0.35);
  --tag-bg: #eef0f5;
  --tag-text: #5a5f75;
  --scrollbar-thumb: #cdd1dc;
  --scrollbar-track: transparent;
  --glow: 0 0 30px rgba(74,108,247,0.1);
}

/* ═══════════════════════════════════════════════ */
/*  RESET & BASE                                  */
/* ═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ═══════════════════════════════════════════════ */
/*  SKIP LINK                                     */
/* ═══════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  text-decoration: none;
}
.skip-link:focus {
  top: 8px;
}

/* ═══════════════════════════════════════════════ */
/*  LAYOUT                                        */
/* ═══════════════════════════════════════════════ */
.app-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ═══════════════════════════════════════════════ */
/*  HEADER                                        */
/* ═══════════════════════════════════════════════ */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
}

.logo-icon svg { width: 20px; height: 20px; }

.logo-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.logo-subtitle {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.privacy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse-privacy 2s ease infinite;
}

@keyframes pulse-privacy {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border: none;
  border-radius: 14px;
  background: var(--bg-tertiary);
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--border-hover); }

.theme-toggle .toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .theme-toggle .toggle-knob {
  transform: translateX(24px);
}

.toggle-knob svg {
  width: 12px;
  height: 12px;
  fill: #fff;
}

/* ═══════════════════════════════════════════════ */
/*  DROPZONE                                      */
/* ═══════════════════════════════════════════════ */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, var(--accent-bg) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

.dropzone:hover,
.dropzone:focus,
.dropzone.drag-over {
  border-color: var(--drop-border);
  background: var(--drop-bg);
  outline: none;
}

.dropzone:hover::before,
.dropzone:focus::before,
.dropzone.drag-over::before {
  opacity: 1;
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.dropzone-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.dropzone p {
  font-size: 13px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* Supported formats tags */
.format-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.format-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--tag-text);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════ */
/*  FILE INFO PANEL                               */
/* ═══════════════════════════════════════════════ */
.file-panel {
  display: none;
  margin-top: 24px;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.file-panel.visible { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
  color: #fff;
}

.file-icon-box.type-doc  { background: #3b82f6; }
.file-icon-box.type-pdf  { background: #ef4444; }
.file-icon-box.type-xls  { background: #22c55e; }
.file-icon-box.type-csv  { background: #f59e0b; }
.file-icon-box.type-img  { background: #a855f7; }
.file-icon-box.type-txt  { background: #6b7280; }
.file-icon-box.type-md   { background: #06b6d4; }
.file-icon-box.type-html { background: #f97316; }
.file-icon-box.type-json { background: #eab308; }
.file-icon-box.type-svg  { background: #ec4899; }
.file-icon-box.type-rtf  { background: #8b5cf6; }
.file-icon-box.type-xml  { background: #14b8a6; }

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

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

.file-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-remove {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

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

/* ═══════════════════════════════════════════════ */
/*  CONVERSION OPTIONS                            */
/* ═══════════════════════════════════════════════ */
.convert-section {
  display: none;
  margin-top: 24px;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.convert-section.visible { display: block; }

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.output-option {
  position: relative;
  cursor: pointer;
}

.output-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.output-option .option-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: all var(--transition);
}

.output-option:hover .option-card {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.output-option input:checked + .option-card {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 1px var(--accent);
}

.option-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.output-option input:checked + .option-card .option-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.option-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity var(--transition);
}

.output-option input:checked + .option-card .option-dot::after {
  opacity: 1;
}

.option-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════ */
/*  CONVERT BUTTON                                */
/* ═══════════════════════════════════════════════ */
.convert-actions {
  display: none;
  margin-top: 24px;
}

.convert-actions.visible { display: flex; gap: 12px; }

.btn-convert {
  flex: 1;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-convert:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--glow); }
.btn-convert:active { transform: translateY(0); }
.btn-convert:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-convert svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-convert .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-convert.loading .spinner { display: block; }
.btn-convert.loading svg { display: none; }
.btn-convert.loading { pointer-events: none; }

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

/* ═══════════════════════════════════════════════ */
/*  STATUS / LOG                                  */
/* ═══════════════════════════════════════════════ */
.status-bar {
  display: none;
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  animation: slideUp 0.3s ease;
}

.status-bar.visible { display: flex; align-items: center; gap: 10px; }

.status-bar.status-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(78,207,139,0.2);
}

.status-bar.status-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(242,85,85,0.2);
}

.status-bar.status-info {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.status-bar svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════ */
/*  PREVIEW PANEL                                 */
/* ═══════════════════════════════════════════════ */
.preview-section {
  display: none;
  margin-top: 24px;
}

.preview-section.visible { display: block; }

.preview-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
}

.preview-header span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.preview-content {
  padding: 20px;
  max-height: 320px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-content img {
  max-width: 100%;
  border-radius: 6px;
}

.preview-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.preview-content table th,
.preview-content table td {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.preview-content table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════ */
/*  CONVERSION MAP (info footer)                  */
/* ═══════════════════════════════════════════════ */
.info-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.info-footer h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.conv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.conv-item {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color var(--transition), background var(--transition);
}

.conv-item:hover {
  border-color: var(--accent-border);
  background: var(--bg-card-hover);
}

.conv-from {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  background: var(--accent-bg);
  padding: 2px 7px;
  border-radius: 4px;
}

.conv-arrow {
  color: var(--text-muted);
  font-size: 12px;
}

.conv-to {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════ */
/*  RESPONSIVE                                    */
/* ═══════════════════════════════════════════════ */
@media (max-width: 600px) {
  .app-wrapper { padding: 20px 16px 60px; }
  .header-inner { height: 56px; }
  .logo-text { font-size: 17px; }
  .dropzone { padding: 36px 20px; }
  .output-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .conv-grid { grid-template-columns: 1fr; }
  .file-card { flex-wrap: wrap; }
}

/* ===== SITE FOOTER ===== */
.site-footer{
  margin-top:60px;padding:48px 28px 36px;
  border-top:1px solid var(--border-color);
  background:var(--bg-primary);color:var(--text-secondary);
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  font-size:14px;line-height:1.6;
}
.site-footer .footer-inner{max-width:1100px;margin:0 auto}
.site-footer .footer-grid{
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr;
  gap:40px;margin-bottom:40px;
}
.site-footer .footer-brand{display:flex;align-items:center;gap:10px;margin-bottom:16px}
.site-footer .footer-brand svg{width:32px;height:32px;color:#a855f7;flex-shrink:0}
.site-footer .footer-brand-name{
  font-size:20px;font-weight:700;
  background:linear-gradient(90deg,#8B5CF6,#EC4899,#3B82F6);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;
}
.site-footer .footer-desc{color:var(--text-muted);margin-bottom:16px;max-width:360px}
.site-footer .footer-copy{font-size:12px;color:var(--text-muted);opacity:.7}
.site-footer h4{font-weight:700;margin-bottom:16px;color:var(--text-primary);font-size:15px}
.site-footer ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
.site-footer a{color:var(--text-secondary);text-decoration:none;transition:color .2s}
.site-footer a:hover{color:#a855f7}
.site-footer .footer-bottom{
  border-top:1px solid var(--border-color);
  padding-top:20px;text-align:center;
}
.site-footer .footer-bottom p{color:var(--text-muted);font-size:13px;opacity:.7}
.site-footer .footer-bottom span{color:#a855f7}

@media(max-width:768px){
  .site-footer .footer-grid{grid-template-columns:1fr;gap:32px}
  .site-footer{padding:36px 16px 28px}
}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
