/* ========================================
   CSS RESET AND BASE STYLES
   ======================================== */

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

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary-color: #10b981;
  --accent-color: #8b5cf6;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  --max-width: 1280px;
  --spacing-unit: 1rem;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: var(--transition-base);
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.75;
}

/* ========================================
   CONTAINER AND LAYOUT
   ======================================== */

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

.text-center {
  text-align: center;
}

/* ========================================
   HEADER AND NAVIGATION
   ======================================== */

header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.02em;
  transition: var(--transition-fast);
}

.logo:hover {
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--text-primary);
  padding: 0.5rem 0;
  position: relative;
  font-size: 1rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--primary-color);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

.hamburger-icon {
  width: 1.5rem;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition-base);
  position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  width: 1.5rem;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition-base);
}

.hamburger-icon::before {
  transform: translateY(-0.5rem);
}

.hamburger-icon::after {
  transform: translateY(0.5rem);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.4;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

#hero-heading {
  color: white;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.125rem;
  line-height: 1.8;
  max-width: 50rem;
  margin: 0 auto 2.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: var(--border-radius-lg);
  transition: var(--transition-base);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: white;
  color: var(--primary-color);
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  background-color: var(--bg-secondary);
}

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

/* ========================================
   FEATURES SECTION
   ======================================== */

.features-section {
  padding: 5rem 0;
  background-color: var(--bg-secondary);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  border: 1px solid var(--border-color);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.feature-title {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* ========================================
   HOW TO USE SECTION
   ======================================== */

.how-to-section {
  padding: 5rem 0;
  background-color: var(--bg-primary);
}

.how-to-steps {
  max-width: 48rem;
  margin: 2rem auto 0;
  counter-reset: step-counter;
  list-style: none;
}

.how-to-steps li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 4rem;
  margin-bottom: 2rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.how-to-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: var(--shadow-md);
}

.how-to-section > .container > p {
  max-width: 48rem;
  margin: 2rem auto 0;
  text-align: center;
}

/* ========================================
   FAQ SECTION
   ======================================== */

.faq-section {
  padding: 5rem 0;
  background-color: var(--bg-secondary);
}

.faq-grid {
  max-width: 56rem;
  margin: 3rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition-base);
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.faq-item h3 {
  margin: 0;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: var(--transition-fast);
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-question[aria-expanded="true"]::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-question:hover {
  color: var(--primary-color);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 1.5rem;
}

.faq-answer.active {
  max-height: 1000px;
  padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
  background-color: var(--text-primary);
  color: var(--text-light);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: white;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer-section p {
  color: var(--text-light);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.625rem;
}

.footer-links a {
  color: var(--text-light);
  font-size: 0.9375rem;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: white;
  padding-left: 0.25rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  color: var(--text-light);
  font-size: 0.875rem;
  margin: 0;
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-spinner.active {
  display: flex;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-spinner p {
  color: white;
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0;
}

/* ========================================
   CONVERSION APP AREA
   ======================================== */

#conversion-app {
  padding: 3rem 0;
  min-height: 200px;
}

.conversion-controls {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 2px dashed var(--border-color);
  transition: var(--transition-base);
}

.conversion-controls:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-tertiary);
}

.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.file-preview-item {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  border: 1px solid var(--border-color);
  transition: var(--transition-base);
}

.file-preview-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-base);
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon {
    background-color: transparent;
  }

  .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon::before {
    transform: rotate(45deg);
  }

  .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon::after {
    transform: rotate(-45deg);
  }

  .hero-section {
    padding: 3rem 0;
  }

  .features-section,
  .how-to-section,
  .faq-section {
    padding: 3rem 0;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .how-to-steps li {
    padding-left: 3rem;
  }

  .how-to-steps li::before {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .feature-card,
  .faq-item {
    padding: 1.25rem;
  }

  .faq-question {
    padding: 1.25rem;
    font-size: 1rem;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.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;
}

.mt-1 { margin-top: calc(var(--spacing-unit) * 1); }
.mt-2 { margin-top: calc(var(--spacing-unit) * 2); }
.mt-3 { margin-top: calc(var(--spacing-unit) * 3); }
.mb-1 { margin-bottom: calc(var(--spacing-unit) * 1); }
.mb-2 { margin-bottom: calc(var(--spacing-unit) * 2); }
.mb-3 { margin-bottom: calc(var(--spacing-unit) * 3); }

/* === NEW UI UPDATES === */

/* Modern Gradient Background */
.hero-section {
  background: radial-gradient(circle at top right, #3b82f6 0%, #2563eb 40%, #1d4ed8 100%);
}

/* Glassmorphism Effect for Cards */
.conversion-controls, .feature-card, .faq-item {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* Toast Notification Style (Error/Success messages) */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2937;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 500;
}

@keyframes slideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  header,
  footer,
  .loading-spinner,
  .mobile-menu-toggle {
    display: none;
  }

  body {
    color: black;
    background: white;
  }

  a {
    text-decoration: underline;
  }
}