* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #10b981;
  --dark: #1e293b;
  --gray: #64748b;
  --light: #f8fafc;
  --white: #ffffff;
  --shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.01);
  --radius: 1rem;
  --transition: all 0.2s ease;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  background: var(--white);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.9);
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--dark);
  letter-spacing: -0.5px;
}

.logo i {
  color: var(--primary);
  margin-right: 4px;
}

.logo span {
  color: var(--primary);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--dark);
  cursor: pointer;
  padding: 0.5rem;
}

.main-nav {
  display: flex;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-list a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.nav-list a i {
  font-size: 0.9rem;
}

.nav-list a:hover,
.nav-list a.active {
  background: #eef2ff;
  color: var(--primary);
}

.hero {
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--gray);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border-radius: 3rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px -2px rgba(59,130,246,0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(59,130,246,0.1);
}

.btn-large {
  padding: 1rem 3rem;
  font-size: 1.2rem;
}

.tools-section,
.how-section,
.cta-section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.tool-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
  border: 1px solid #e2e8f0;
}

.tool-card:hover {
  transform: scale(1.02);
  border-color: var(--primary);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.tool-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}

.tool-card p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.card-link {
  text-decoration: none;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.step {
  text-align: center;
}

.step-icon {
  background: #eef2ff;
  width: 80px;
  height: 80px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
  margin: 0 auto 1.5rem;
}

.api-note {
  background: #e6f7ed;
  padding: 1rem;
  border-radius: 2rem;
  text-align: center;
  color: #065f46;
}

.cta-section {
  background: var(--dark);
  color: white;
  text-align: center;
}

.cta-section h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-section .btn-primary {
  background: white;
  color: var(--dark);
}

.site-footer {
  background: #1e293b;
  color: #cbd5e1;
  padding: 3rem 0 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: white;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 2rem;
  text-align: center;
}

.converter-card {
  max-width: 700px;
  margin: 2rem auto;
  background: white;
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  border: 1px solid #e2e8f0;
}

.file-label {
  display: block;
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.file-label i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.file-label span {
  display: block;
  font-weight: 600;
  font-size: 1.1rem;
}

.file-label small {
  color: var(--gray);
}

.file-label:hover {
  border-color: var(--primary);
  background: #eef2ff;
}

#fileInput {
  display: none;
}

.selected-file {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  background: #e6f7ed;
  border-radius: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
}

.selected-file i {
  color: #10b981;
}

#convertBtn {
  width: 100%;
  justify-content: center;
  margin: 1.5rem 0;
}

#statusMessage {
  text-align: center;
  padding: 0.8rem;
  border-radius: 2rem;
  font-weight: 500;
}

#status {
  text-align: center;
  padding: 0.8rem;
  border-radius: 2rem;
  background: #f1f5f9;
  font-weight: 500;
  margin: 1rem 0;
  white-space: pre-wrap;
}

.error {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.download-btn {
  display: inline-block;
  background: var(--secondary);
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 3rem;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 6px -2px rgba(16,185,129,0.3);
}

.download-btn:hover {
  background: #0f9e6a;
  transform: translateY(-2px);
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 2rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.back-link i {
  margin-right: 0.3rem;
}

.back-link:hover {
  text-decoration: underline;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.3s ease;
  }

  .main-nav.open {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .nav-list a {
    width: 100%;
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .converter-card {
    padding: 1.5rem;
  }

  .file-label {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
  h1 {
    font-size: 1.8rem;
  }
  .btn {
    padding: 0.6rem 1.5rem;
  }
}