:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-soft: #666;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --border: #e5e7eb;
  --radius: 24px;
  --container: 1100px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

body { 
  font-family: 'Plus Jakarta Sans', sans-serif; 
  background-color: var(--bg); 
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 2rem; }

/* Navigation (Universal) */
nav {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nav-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2.5rem; }
.nav-item { position: relative; }
.nav-link { text-decoration: none; color: var(--text-soft); font-size: 0.9375rem; font-weight: 600; transition: color 0.2s; display: flex; align-items: center; gap: 0.35rem; }
.nav-link:hover, .nav-link.active { color: var(--text); }

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  min-width: 240px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s var(--ease);
}
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; text-decoration: none; color: var(--text); border-radius: 8px; transition: background 0.2s; }
.dropdown-item:hover { background: var(--bg); }
.dropdown-item .icon { font-size: 1.125rem; color: var(--accent); display: flex; align-items: center; }
.dropdown-item .title { font-weight: 700; font-size: 0.875rem; display: block; }
.dropdown-item .desc { font-size: 0.75rem; color: var(--text-soft); display: block; }

.nav-cta {
  padding: 0.7rem 1.5rem;
  background: var(--text);
  color: white;
  text-decoration: none;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* Main Layout */
.main-layout { padding: 4rem 0 8rem; max-width: 800px; }
.tool-header { text-align: center; margin-bottom: 4rem; }
.tool-header .badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 100px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}
.tool-header h1 { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 1rem; }
.tool-header h1 span { color: var(--accent); }
.tool-header p { color: var(--text-soft); font-size: 1.125rem; }

/* Converter Card */
.converter-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  box-shadow: var(--shadow);
  margin-bottom: 4rem;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 20px;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { 
  width: 64px; height: 64px; background: var(--accent-soft); color: var(--accent);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
}
.drop-zone h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.drop-zone p { color: var(--text-soft); font-size: 0.875rem; }

/* Process Area */
.process-area { display: flex; flex-direction: column; gap: 2rem; }

.preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.preview-info { display: flex; align-items: center; gap: 1rem; }
#imagePreview { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.file-meta { display: flex; flex-direction: column; }
#fileName { font-weight: 700; font-size: 0.9375rem; color: var(--text); }
#fileSize { font-size: 0.75rem; color: var(--text-soft); }
.reset-btn { width: 32px; height: 32px; border: none; background: none; color: var(--text-soft); cursor: pointer; transition: color 0.2s; }
.reset-btn:hover { color: #ef4444; }

.convert-options label { font-weight: 700; font-size: 0.875rem; color: var(--text-soft); display: block; margin-bottom: 1rem; }
.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 2rem; }
.format-btn {
  padding: 1rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.format-btn:hover { border-color: var(--accent); }
.format-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.quality-row { margin-bottom: 2.5rem; }
.quality-label { display: flex; justify-content: space-between; margin-bottom: 0.75rem; font-weight: 700; font-size: 0.875rem; }
#qualityVal { color: var(--accent); }

input[type="range"] {
  width: 100%; height: 6px; background: var(--border); border-radius: 10px; outline: none; appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; background: var(--accent); border: 3px solid white; border-radius: 50%; cursor: pointer; box-shadow: var(--shadow);
}

.btn-primary {
  width: 100%;
  padding: 1.25rem;
  background: var(--text);
  color: white;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.2s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature-card { background: white; padding: 2rem; border-radius: 20px; border: 1px solid var(--border); }
.feature-card .icon { color: var(--accent); margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.875rem; color: var(--text-soft); }

/* Footer */
footer { padding: 6rem 0; background: #111; color: white; border-top: 1px solid #333; }
.footer-content { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer-brand .logo { color: white; margin-bottom: 1.5rem; }
.footer-brand p { color: #999; font-size: 0.9375rem; line-height: 1.6; max-width: 300px; }
.footer-col h4 { font-size: 1rem; font-weight: 700; margin-bottom: 1.5rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col ul li a { color: #999; text-decoration: none; font-size: 0.9375rem; transition: color 0.2s; }
.footer-col ul li a:hover { color: white; }
.footer-bottom { padding-top: 3rem; border-top: 1px solid #333; display: flex; justify-content: space-between; align-items: center; color: #666; font-size: 0.875rem; }
.footer-socials { display: flex; gap: 1.5rem; }
.footer-socials a { color: inherit; text-decoration: none; transition: color 0.2s; }
.footer-socials a:hover { color: white; }

/* Mobile */
.mobile-only { display: none; }
.menu-toggle { display: none; flex-direction: column; gap: 6px; cursor: pointer; padding: 0.5rem; z-index: 1001; }
.menu-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }
.menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 991px) {
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 100%; height: 100vh; background: white;
    flex-direction: column; align-items: center; justify-content: center; padding: 2rem; gap: 2rem; transition: 0.4s var(--ease); z-index: 1000;
  }
  .nav-links.active { right: 0; }
  .dropdown { position: static; transform: none !important; opacity: 1 !important; visibility: visible !important; box-shadow: none; border: none; padding: 0; height: 0; overflow: hidden; transition: height 0.3s var(--ease); width: 100%; display: flex; flex-direction: column; align-items: center; }
  .nav-item.active .dropdown { height: auto; padding-top: 1rem; }
  .nav-item.active .chevron { transform: rotate(180deg); }
  .tool-header h1 { font-size: 2.5rem; }
  .converter-card { padding: 1.5rem; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { align-items: center; }
  .footer-bottom { flex-direction: column; gap: 1.5rem; }
}
