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

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background: #09090b;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

/* ── Ambient Mesh Glows ─────────────── */
.mesh-glow {
  position: fixed; border-radius: 50%; filter: blur(120px); opacity: 0.5; z-index: -1;
  animation: drift 20s infinite alternate ease-in-out; pointer-events: none;
}
.mesh-1 { width: 50vw; height: 50vw; background: #6366f1; top: -10vw; left: -10vw; mix-blend-mode: screen; }
.mesh-2 { width: 45vw; height: 45vw; background: #a855f7; bottom: -10vw; right: -10vw; mix-blend-mode: screen; animation-delay: -10s; }
@keyframes drift { 0% { transform: scale(1) translate(0, 0); } 100% { transform: scale(1.1) translate(5vw, 5vw); } }

/* ── Glassmorphism Helper ───────────── */
.glass-panel {
  background: rgba(24, 24, 27, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  border-radius: 20px;
}

/* ── Header ─────────────────────────── */
header {
  width: 100%;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(9, 9, 11, 0.6); backdrop-filter: blur(8px);
  z-index: 10;
}
header a.logo-link {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
}
header .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex; align-items: center; justify-content: center;
}
header .site-title { font-size: 18px; font-weight: 700; margin:0;}
header .site-title span {
  background: linear-gradient(135deg, #818cf8, #d8b4fe);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
header nav {
  margin-left: auto; display: flex; gap: 16px; font-size: 13px; font-weight: 500;
}
header nav a { color: #94a3b8; text-decoration: none; transition: 0.2s; }
header nav a:hover { color: white; }

/* ── Language Switcher ─────────────── */
.lang-switcher { position: relative; margin-left: 4px; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 6px 10px;
  color: inherit; font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: 0.2s;
}
.lang-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(99,102,241,0.5); }
.lang-btn .lang-chev { transition: transform 0.2s; }
.lang-btn[aria-expanded="true"] .lang-chev { transform: rotate(180deg); }
.lang-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: rgba(24, 24, 27, 0.95); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 6px;
  min-width: 170px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); z-index: 100;
}
.lang-menu.open { display: flex; flex-direction: column; animation: fadeIn 0.2s ease; }
.lang-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px;
  text-decoration: none; color: #cbd5e1;
  font-size: 13px; font-weight: 500; transition: 0.15s;
}
.lang-opt:hover { background: rgba(99,102,241,0.15); color: white; }
.lang-opt.active { background: rgba(99,102,241,0.2); color: #d8b4fe; }

/* ── Mega Menu ─────────────── */
.mega-menu-wrapper { position: relative; display: flex; align-items: center; margin-right: auto; }
.mega-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 7px 12px;
  color: #cbd5e1; font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.25s ease;
}
.mega-btn:hover { background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.35); color: white; }
.mega-btn[aria-expanded="true"] { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); color: white; }
.mega-btn .mega-chev { transition: transform 0.25s ease; }
.mega-btn[aria-expanded="true"] .mega-chev { transform: rotate(180deg); }

.mega-dropdown {
  display: none; position: absolute; top: calc(100% + 12px); left: 0;
  background: rgba(15, 15, 20, 0.92); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(99,102,241,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
  z-index: 100;
  min-width: 680px;
}
.mega-dropdown::before {
  content: ''; position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129,140,248,0.4), rgba(168,85,247,0.4), transparent);
  border-radius: 1px;
}
.mega-dropdown.open { display: block; animation: slideUpFade 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.mega-column h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: #818cf8;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(99,102,241,0.15);
  font-weight: 700;
}
.mega-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px; margin-left: -12px;
  text-decoration: none; color: #94a3b8;
  font-size: 13px; font-weight: 500; transition: all 0.2s ease;
  white-space: nowrap; position: relative;
}
.mega-link svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; transition: 0.2s; }
.mega-link:hover svg { opacity: 1; stroke: #818cf8; }
.mega-link:hover {
  background: rgba(99,102,241,0.12); color: #e2e8f0;
  transform: translateX(3px);
  box-shadow: inset 3px 0 0 #818cf8;
}
.mega-link.nav-active {
  color: #d8b4fe; background: rgba(99,102,241,0.1);
  box-shadow: inset 3px 0 0 #a855f7;
}

/* ── Page Layout ────────────────────── */
.page-container {
  display: flex; gap: 24px; width: 100%; max-width: 1040px;
  padding: 24px; margin: 0 auto; z-index: 1; flex: 1;
}
main {
  width: 100%; max-width: 640px;
  display: flex; flex-direction: column; gap: 24px;
  margin: 0 auto;
}


/* ── SEO Typography & Articles ──────── */
.seo-article {
  padding: 30px; font-size: 15px; line-height: 1.6; color: #cbd5e1;
}
.seo-article h1, .seo-article h2, .seo-article h3 { color: white; margin: 24px 0 12px; }
.seo-article h1 { font-size: 26px; margin-top: 0; background: linear-gradient(135deg, #818cf8, #d8b4fe); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.seo-article h2 { font-size: 20px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 8px;}
.seo-article p { margin-bottom: 16px; }
.seo-article a { color: #818cf8; text-decoration: none; }
.seo-article a:hover { text-decoration: underline; }
.seo-article ul { margin-left: 20px; margin-bottom: 16px; }
.seo-article li { margin-bottom: 8px; }

/* ── Related Links Component ────────── */
.related-tools {
  padding: 20px; display: grid; gap: 12px; grid-template-columns: 1fr 1fr;
}
.related-tools h3 { grid-column: 1 / -1; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 8px; }
.related-tools a {
  padding: 12px; background: rgba(0,0,0,0.2); border-radius: 12px;
  text-decoration: none; color: #cbd5e1; font-size: 13px; font-weight: 500;
  border: 1px solid rgba(255,255,255,0.05); transition: 0.2s;
}
.related-tools a:hover { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.08); color: white; }



/* ── Format Tabs ────────────────────── */
.format-tabs {
  display: flex; gap: 8px; padding: 6px; margin-bottom: 8px;
}
.format-tabs .tab {
  flex: 1; padding: 14px; border: 1px solid rgba(255,255,255,0.05); border-radius: 12px;
  background: rgba(255,255,255,0.02); color: #94a3b8; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all 0.2s ease;
}
.format-tabs .tab:hover { background: rgba(255,255,255,0.05); color: white; border-color: rgba(255,255,255,0.1); }
.format-tabs .tab.active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.5); color: #d8b4fe; box-shadow: 0 4px 12px rgba(99,102,241,0.2); }

/* ── Drop zone ──────────────────────── */
.drop-zone {
  border: 2px dashed rgba(99,102,241,0.4); border-radius: 20px;
  padding: 48px 20px; text-align: center; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; background: rgba(24, 24, 27, 0.45);
}
.drop-zone:hover, .drop-zone.dragging { border-color: #818cf8; background: rgba(99,102,241,0.08); box-shadow: 0 0 40px rgba(99,102,241,0.15); border-style: solid; }
.drop-zone .icon {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.15));
  display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.05);
}
.drop-zone .icon svg { width: 32px; height: 32px; stroke: #c084fc; transition: transform 0.3s; }
.drop-zone:hover .icon svg { transform: translateY(-4px); stroke: #818cf8; }

.drop-zone h2 { font-size: 19px; font-weight: 600; margin-bottom: 8px; color: #e2e8f0; }
.drop-zone p { font-size: 13px; color: #94a3b8; margin-bottom: 24px; }
.cloud-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn-cloud {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  font-size: 12px; font-weight: 500; color: #e2e8f0; cursor: pointer; transition: all 0.2s ease;
}
.btn-cloud:hover { background: rgba(255,255,255,0.1); border-color: rgba(99,102,241,0.5); }
.btn-cloud svg { width: 14px; height: 14px; }
.drop-zone input { display: none; }

.url-modal {
  display: none; position: absolute; inset: 0; background: rgba(9,9,11,0.95); backdrop-filter: blur(8px);
  border-radius: 20px; flex-direction: column; align-items: center; justify-content: center; padding: 20px; z-index: 10;
}
.url-modal.visible { display: flex; animation: fadeIn 0.3s ease; }
.url-modal input {
  width: 100%; padding: 12px; border-radius: 8px; background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1); color: white; margin-bottom: 12px; font-family: inherit; font-size: 13px; outline: none; transition: 0.2s border-color, 0.2s box-shadow;
}
.url-modal input:focus {
  border-color: #a855f7; box-shadow: 0 0 16px rgba(168,85,247,0.2);
}
.url-modal .url-actions { display: flex; gap: 8px; width: 100%; }
.url-modal button { flex: 1; padding: 10px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; transition: 0.2s; }
.url-modal .btn-fetch { background: #6366f1; color: white; }
.url-modal .btn-fetch:hover { background: #4f46e5; }
.url-modal .btn-cancel { background: rgba(255,255,255,0.1); color: white; }
.url-modal .btn-cancel:hover { background: rgba(255,255,255,0.15); }

/* ── File Gallery (Grid) ────────────── */
.file-gallery {
  display: none; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px; max-height: 400px; overflow-y: auto; padding-right: 8px; padding-bottom: 12px;
}
.file-gallery.visible { display: grid; }
.file-gallery::-webkit-scrollbar { width: 6px; }
.file-gallery::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

.file-item {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 14px; position: relative; transition: transform 0.2s, border-color 0.2s;
}
.file-item:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.15); }
.file-item .thumb { width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,0.3); flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.file-item .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.file-item:hover .thumb img { transform: scale(1.15); }

.file-item .info { width: 100%; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; }
.file-item .info .name { font-size: 12px; font-weight: 600; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e2e8f0; }
.file-item .info .meta { font-size: 11px; color: #94a3b8; }
.file-item .status { font-size: 11px; font-weight: 700; color: #4ade80; display: none; margin-top: auto; letter-spacing: 0.05em; text-transform: uppercase; background: rgba(74, 222, 128, 0.1); padding: 4px 8px; border-radius: 6px; }
.file-item.done .status { display: block; }

.btn-remove { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.5); border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); color: white; border: none; cursor: pointer; transition: 0.2s; }
.btn-remove:hover { background: #ef4444; }

.skeleton-loader { width: 100%; height: 100%; background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.02) 75%); background-size: 200% 100%; animation: skeletonShimmer 1.5s infinite; border-radius: inherit; }
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Convert button ─────────────────── */
.btn-convert {
  display: none; position: relative; overflow: hidden;
  align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border: none; border-radius: 14px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  color: white; cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #9333ea);
  box-shadow: 0 4px 20px rgba(99,102,241,0.3);
  transition: all 0.3s ease;
}
.btn-convert.visible { display: flex; }
.btn-convert::after {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(transparent, rgba(255,255,255,0.2), transparent);
  transform: rotate(45deg) translateY(-100%); transition: 0s;
}
.btn-convert:hover { box-shadow: 0 6px 28px rgba(99,102,241,0.5); transform: translateY(-2px); }
.btn-convert:hover::after { transform: rotate(45deg) translateY(100%); transition: transform 0.7s ease-in-out; }
.btn-convert:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; pointer-events: none; }

/* ── Progress Bar ───────────────────── */
.progress-container { width: 100%; height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; display: none; box-shadow: inset 0 1px 3px rgba(0,0,0,0.3); }
.progress-container.visible { display: block; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width 0.3s ease; border-radius: 4px; }

/* ── Result card ────────────────────── */
.result-card { display: none; padding: 20px; flex-direction: column; gap: 16px; animation: fadeIn 0.4s ease forwards; }
.result-card.visible { display: flex; }
.result-card .result-header { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #d8b4fe; }
.result-card .stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #94a3b8; background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; }
.result-card .stats strong { color: #e2e8f0; }

.btn-download { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: 1px solid rgba(168,85,247,0.3); border-radius: 12px; background: rgba(168,85,247,0.1); color: #d8b4fe; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.btn-download:hover { background: rgba(168,85,247,0.2); border-color: rgba(168,85,247,0.5); }
.action-row { display: flex; gap: 10px; }
.btn-copy { display: flex; align-items: center; justify-content: center; width: 48px; border: 1px solid rgba(255,255,255,0.15); border-radius: 12px; flex-shrink: 0; background: rgba(255,255,255,0.05); color: white; cursor: pointer; transition: all 0.2s ease; }
.btn-copy:hover { background: rgba(255,255,255,0.1); }
.btn-copy.success { color: #22c55e; border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.1); }

/* ── Toast System ───────────────────── */
#toastContainer { position: fixed; bottom: 30px; right: 30px; z-index: 1000; display: flex; flex-direction: column; gap: 12px; pointer-events: none;}
.toast { padding: 14px 20px; border-radius: 12px; font-size: 13px; font-weight: 500; color: white; background: rgba(24, 24, 27, 0.9); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; display: flex; align-items: center; gap: 10px; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.success { border-left: 4px solid #22c55e; }
.toast.info { border-left: 4px solid #6366f1; }
@keyframes toastSlideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastFadeOut { to { opacity: 0; transform: translateY(10px); } }

/* ── SEO FAQ Section ────────────────── */
.faq-section {
  display: flex; flex-direction: column; gap: 12px; margin-top: 24px;
}
.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}
.faq-item:last-child {
  border-bottom: none; padding-bottom: 0;
}
.faq-question {
  font-size: 16px; font-weight: 600; color: #e2e8f0; margin-bottom: 8px;
}
.faq-answer {
  font-size: 14px; color: #94a3b8; line-height: 1.6;
}

/* ── Trust Badge ────────────────────── */
.trust-badge {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  margin: 0 auto 16px; padding: 8px 16px;
  background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px; color: #4ade80; font-size: 13px; font-weight: 500;
  width: fit-content; text-align: center;
}
.trust-badge svg { flex-shrink: 0; }

/* ── Footer ─────────────────────────── */
footer {
  width: 100%; border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.4); padding: 40px 20px; text-align: center; font-size: 13px; color: #94a3b8;
  display: flex; flex-direction: column; gap: 20px; align-items: center; z-index: 10;
}
.footer-links {
  display: flex; gap: 24px; flex-wrap: wrap; justify-content: center;
}
.footer-links a { color: #cbd5e1; text-decoration: none; transition: 0.2s; }
.footer-links a:hover { color: #818cf8; }
.footer-copy { font-size: 12px; color: #64748b; }

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

#canvas { display: none; }

/* ── UI/UX Physics & Micro-Animations ─ */
.drop-zone {
  animation: dropZoneBreath 4s infinite ease-in-out;
}
@keyframes dropZoneBreath {
  0% { box-shadow: 0 0 0 0 rgba(168,85,247,0); }
  50% { box-shadow: 0 0 30px 0 rgba(168,85,247,0.15); }
  100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); }
}

.btn-convert:active, .btn-download:active, .btn-copy:active, .btn-cloud:active {
  transform: scale(0.96) !important;
  transition: transform 0.1s !important;
}

@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.file-item {
  animation: slideUpFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* ── Accessibility (a11y) ───────────── */
:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 4px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid #a855f7;
}

/* ── Light Mode Theme Engine ────────── */
[data-theme="light"] {
  background: #f8fafc;
  color: #0f172a;
}
[data-theme="light"] .mesh-1 { background: #818cf8; opacity: 0.3; }
[data-theme="light"] .mesh-2 { background: #e879f9; opacity: 0.3; }
[data-theme="light"] .glass-panel { background: rgba(255, 255, 255, 0.65); border: 1px solid rgba(0, 0, 0, 0.1); box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05); }
[data-theme="light"] header { background: rgba(255, 255, 255, 0.7); border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
[data-theme="light"] header nav a { color: #475569; }
[data-theme="light"] header nav a:hover { color: #0f172a; }
[data-theme="light"] .seo-article { color: #334155; }
[data-theme="light"] .seo-article h1, [data-theme="light"] .seo-article h2, [data-theme="light"] .seo-article h3 { color: #0f172a; }
[data-theme="light"] .seo-article h2 { border-bottom: 1px solid rgba(0,0,0,0.1); }
[data-theme="light"] .related-tools a { background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.1); color: #334155; }
[data-theme="light"] .related-tools a:hover { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.4); color: #1e1b4b; }
[data-theme="light"] .format-tabs .tab { background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.1); color: #475569; }
[data-theme="light"] .format-tabs .tab:hover { background: rgba(0,0,0,0.06); color: #0f172a; }
[data-theme="light"] .drop-zone { background: rgba(255, 255, 255, 0.65); border-color: rgba(99,102,241,0.5); }
[data-theme="light"] .drop-zone h2 { color: #0f172a; }
[data-theme="light"] .drop-zone p { color: #475569; }
[data-theme="light"] .btn-cloud { background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.1); color: #334155; }
[data-theme="light"] .file-item { background: rgba(255,255,255,0.7); border: 1px solid rgba(0,0,0,0.1); }
[data-theme="light"] .file-item .info .name { color: #0f172a; }
[data-theme="light"] .file-item .info .meta { color: #475569; }
[data-theme="light"] .result-card .stats { background: rgba(0,0,0,0.05); color: #475569; }
[data-theme="light"] .result-card .stats strong { color: #0f172a; }
[data-theme="light"] .faq-question { color: #0f172a; }
[data-theme="light"] .faq-answer { color: #334155; }
[data-theme="light"] .faq-item { border-bottom: 1px solid rgba(0,0,0,0.1); }
[data-theme="light"] footer { background: rgba(255,255,255,0.5); border-top: 1px solid rgba(0,0,0,0.1); color: #475569; }
[data-theme="light"] .footer-links a { color: #334155; }
[data-theme="light"] .toast { background: rgba(255,255,255,0.95); color: #0f172a; border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
[data-theme="light"] .lang-btn { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .lang-btn:hover { background: rgba(0,0,0,0.08); border-color: rgba(99,102,241,0.4); }
[data-theme="light"] .lang-menu { background: rgba(255,255,255,0.97); border-color: rgba(0,0,0,0.1); box-shadow: 0 10px 40px rgba(0,0,0,0.12); }
[data-theme="light"] .lang-opt { color: #334155; }
[data-theme="light"] .lang-opt:hover { background: rgba(99,102,241,0.1); color: #1e1b4b; }
[data-theme="light"] .lang-opt.active { background: rgba(99,102,241,0.15); color: #6366f1; }

[data-theme="light"] .mega-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: #475569; }
[data-theme="light"] .mega-btn:hover { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.3); color: #0f172a; }
[data-theme="light"] .mega-btn[aria-expanded="true"] { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.35); color: #4f46e5; }
[data-theme="light"] .mega-dropdown { background: rgba(255,255,255,0.97); border-color: rgba(0,0,0,0.08); box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 0 0 1px rgba(99,102,241,0.06); }
[data-theme="light"] .mega-dropdown::before { background: linear-gradient(90deg, transparent, rgba(99,102,241,0.3), rgba(168,85,247,0.3), transparent); }
[data-theme="light"] .mega-column h4 { color: #6366f1; border-bottom-color: rgba(99,102,241,0.12); }
[data-theme="light"] .mega-link { color: #475569; }
[data-theme="light"] .mega-link:hover { background: rgba(99,102,241,0.06); color: #4f46e5; box-shadow: inset 3px 0 0 #6366f1; }
[data-theme="light"] .mega-link.nav-active { color: #6366f1; background: rgba(99,102,241,0.06); box-shadow: inset 3px 0 0 #6366f1; }

/* ── Mobile Touch Overrides ─────────── */
@media (hover: none) {
  .file-item:hover { transform: none; border-color: rgba(255,255,255,0.08); }
  .file-item:hover .thumb img { transform: none; }
  .btn-convert:hover { box-shadow: 0 4px 20px rgba(99,102,241,0.3); transform: none; }
  .drop-zone:hover:not(.dragging) { border-color: rgba(99,102,241,0.4); background: rgba(24, 24, 27, 0.45); box-shadow: none; }
  
  [data-theme="light"] .drop-zone:hover:not(.dragging) { background: rgba(255, 255, 255, 0.65); border-color: rgba(99,102,241,0.5); }
  [data-theme="light"] .file-item:hover { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.1); }
}

/* -- UX #2: Convert button smooth entrance -- */
.btn-convert.visible {
  animation: slideUpFade 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* -- UX #3: Active nav link indicator -- */
header nav a.nav-active { color: white; position: relative; }
header nav a.nav-active::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, #818cf8, #d8b4fe); border-radius: 2px;
}

/* -- UX #4: Tab switch pop animation -- */
@keyframes tabPop {
  0% { transform: scale(0.93); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}
.format-tabs .tab.active { animation: tabPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* -- UX #5: Progress counter label -- */
.progress-label {
  font-size: 12px; color: #94a3b8; text-align: center;
  margin-top: 6px; min-height: 18px; letter-spacing: 0.02em;
}
[data-theme="light"] .progress-label { color: #64748b; }

/* -- UX #7: Savings pill badge -- */
.savings-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  background: rgba(34,197,94,0.15); color: #4ade80;
  border: 1px solid rgba(34,197,94,0.3);
  vertical-align: middle; margin-left: 4px;
}
.savings-pill.worse {
  background: rgba(239,68,68,0.1); color: #f87171;
  border-color: rgba(239,68,68,0.3);
}

/* -- UX #1: Clear / Convert More button -- */
.btn-clear {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px; border-radius: 12px;
  border: 1px dashed rgba(255,255,255,0.12);
  background: transparent; color: #64748b;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.25s ease; margin-top: 2px;
}
.btn-clear:hover { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.35); color: #f87171; }
[data-theme="light"] .btn-clear { color: #94a3b8; border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .btn-clear:hover { color: #ef4444; border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.05); }

/* -- Tablet responsive header -- */
@media (max-width: 900px) {
  .mega-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .mega-dropdown { min-width: 440px; left: -50px; }
}

/* -- UX #8: Mobile responsive header -- */
@media (max-width: 640px) {
  header { position: relative; flex-wrap: wrap; padding: 12px 16px; gap: 8px; justify-content: space-between; z-index: 100; }
  header nav { width: 100%; justify-content: center; gap: 6px; font-size: 12px; flex-wrap: wrap; }
  header nav a { padding: 4px 8px; background: rgba(255,255,255,0.04); border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); }
  header nav a.nav-active { background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); color: #c4b5fd; }
  header nav a.nav-active::after { display: none; }
  .mega-menu-wrapper { margin-right: 0; width: 100%; justify-content: center; position: static; }
  .mega-dropdown { position: absolute; top: calc(100% + 8px); left: 16px; right: 16px; min-width: 0; width: auto; max-height: calc(100vh - 120px); overflow-y: auto; border-radius: 18px; padding: 20px; }
  .mega-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* -- UX #9: Drop zone + layout mobile padding -- */
@media (max-width: 640px) {
  .drop-zone { padding: 28px 16px; }
  .page-container { padding: 12px; gap: 12px; }
  main { gap: 14px; }
  .file-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
}

/* -- UX #10: Toast moves to top on mobile -- */
@media (max-width: 640px) {
  #toastContainer { bottom: auto; top: 16px; right: 12px; left: 12px; }
  .toast { font-size: 12px; padding: 10px 14px; }
}

/* -- Compress Settings Panel -- */
.compress-settings { padding: 20px; margin-bottom: 8px; }
.compress-settings h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #e2e8f0; }
[data-theme="light"] .compress-settings h3 { color: #0f172a; }

/* -- Size Preset Buttons (shared across EN + localized compress pages) -- */
.preset-pill, .preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s;
}
[data-theme="light"] .preset-pill, [data-theme="light"] .preset {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #334155;
}
.preset-pill:hover, .preset:hover {
  background: rgba(129, 140, 248, 0.2);
  border-color: #818cf8;
}
.preset-pill.active, .preset.active {
  background: #818cf8;
  color: #fff;
  border-color: #818cf8;
}
.size-presets { display: flex; flex-wrap: wrap; gap: 8px; }
