/* Fast Image Converter - Clean, High-Performance Modern CSS */
:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --accent-green: #15803d;
  --accent-green-hover: #166534;
  --accent-green-light: #f0fdf4;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

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

button, input, select {
  font: inherit;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.narrow-container {
  width: 100%;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ==================== HEADER & NAV ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}

.site-logo svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.site-logo:hover {
  text-decoration: none;
  color: var(--primary-hover);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary);
  background-color: var(--primary-light);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  color: var(--text-main);
}

/* ==================== HERO & TOOL ==================== */
.hero-section {
  padding: 1.5rem 0 2rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.125rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 0.625rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

.hero-subtitle a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.hero-subtitle a:hover {
  color: var(--primary-hover);
}

/* Tool Box Container */
.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  max-width: 820px;
  margin: 0 auto;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-md);
  background-color: #f8fafc;
  padding: 2.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background-color: #eff6ff;
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  color: var(--primary);
}

.dropzone-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.dropzone-hint {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary);
  color: #ffffff;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-upload:hover {
  background-color: var(--primary-hover);
}

/* Tool Configuration Row */
.tool-controls {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.select-format {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
}

.select-format:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.quality-slider {
  width: 140px;
  accent-color: var(--primary);
  cursor: pointer;
}

.quality-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 32px;
}

/* Tool Format Notes */
.tool-note {
  width: 100%;
  background-color: #f1f5f9;
  border-left: 4px solid var(--primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
  margin-bottom: 1rem;
}

.tool-alert {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* Action Buttons */
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  align-items: center;
}

.btn-convert {
  background-color: var(--accent-green);
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 700;
  padding: 0.7rem 1.75rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.btn-convert:hover:not(:disabled) {
  background-color: var(--accent-green-hover);
}

.btn-convert:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.btn-zip {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-zip:hover {
  background-color: var(--primary-hover);
}

/* Files List */
.file-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  background-color: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}

.file-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background-color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-light);
  overflow: hidden;
}

.file-thumb canvas, .file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.file-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 2px;
}

.format-badge {
  display: inline-block;
  padding: 1px 6px;
  background-color: #e2e8f0;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
}

.format-badge.success {
  background-color: #dcfce7;
  color: #166534;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-download-single {
  background-color: var(--accent-green);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.btn-download-single:hover {
  background-color: var(--accent-green-hover);
  text-decoration: none;
  color: #ffffff;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
}

.btn-remove:hover {
  color: #ef4444;
  background-color: #fee2e2;
}

/* Quick Tools & Badges */
.hero-footer {
  margin-top: 1.25rem;
  text-align: center;
}

.quick-tools {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.quick-tools a {
  font-weight: 500;
  margin: 0 0.25rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #047857;
}

.hero-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==================== CONTENT SECTIONS ==================== */
.section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}

.section-alt {
  background-color: #ffffff;
}

.section-header {
  margin-bottom: 2rem;
  text-align: center;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.section-intro {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

/* ==================== BANNERS ==================== */
.banner-wrapper {
  margin: 1.75rem auto;
  max-width: 980px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  background-color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.banner-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.responsive-banner {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 1672 / 941;
}

/* Popular Converters Grid */
.converters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.converter-card-link {
  display: block;
  padding: 1.25rem;
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.converter-card-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.converter-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.converter-card-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* How to Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.step-card {
  background-color: #ffffff;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: relative;
}

.step-number {
  display: inline-block;
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.875rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.step-title {
  font-size: 1.1875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.step-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Formats Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.formats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

.formats-table th {
  background-color: #f1f5f9;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.formats-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.formats-table tr:last-child td {
  border-bottom: none;
}

.formats-table tr:hover td {
  background-color: #f8fafc;
}

.format-name {
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.table-note {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 1rem;
}

/* Why Choose & Which Format Typography */
.prose {
  font-size: 1.0625rem;
  color: var(--text-main);
  line-height: 1.7;
}

.prose p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.prose li {
  margin-bottom: 0.5rem;
}

.tip-box {
  background-color: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: #1e3a8a;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 840px;
  margin: 0 auto;
}

.faq-item {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] {
  border-color: var(--primary-border);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: "\2212";
}

.faq-answer {
  padding: 0 1.25rem 1.25rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Final CTA Section */
.cta-section {
  text-align: center;
  padding: 3.5rem 0;
  background: linear-gradient(180deg, var(--bg-page) 0%, #eff6ff 100%);
}

.cta-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.cta-text {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.btn-cta {
  display: inline-block;
  background-color: var(--accent-green);
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 700;
  padding: 0.85rem 2.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-cta:hover {
  background-color: var(--accent-green-hover);
  text-decoration: none;
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==================== FOOTER ==================== */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
  font-size: 0.875rem;
}

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

.footer-col h4 {
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: #94a3b8;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: #ffffff;
  text-decoration: none;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid #1e293b;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-disclaimer {
  color: #64748b;
  font-size: 0.8125rem;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs span {
  margin: 0 0.4rem;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  .hero-section {
    padding: 1rem 0 1.5rem;
  }
  
  .hero-title {
    font-size: 1.625rem;
  }
  
  .hero-subtitle {
    font-size: 0.9375rem;
  }

  .converter-card {
    padding: 1rem;
  }

  .dropzone {
    padding: 1.5rem 1rem;
  }

  .tool-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .control-group {
    justify-content: space-between;
  }

  .quality-slider {
    width: 120px;
  }

  .tool-actions {
    flex-direction: column;
  }

  .tool-actions button,
  .tool-actions a {
    width: 100%;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: #ffffff;
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.4rem;
  }

  .file-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 0.5rem;
  }
}
