/* ===================================================
   style.css — JPG2PDF Converter
   =================================================== */

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0d0f14;
  color: #e2e8f0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Utility ── */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
}

.gradient-text {
  background: linear-gradient(135deg, #6C63FF 0%, #48c6ef 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  padding: 14px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.3px;
}

.logo strong {
  color: #6C63FF;
}

.logo-icon {
  width: 36px;
  height: 36px;
}

.header-nav {
  display: flex;
  gap: 28px;
}

.header-nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: .9rem;
  transition: color .2s;
}

.header-nav a:hover {
  color: #fff;
}

/* ── Hero ── */
.hero {
  padding: 80px 0 40px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(108, 99, 255, .15);
  border: 1px solid rgba(108, 99, 255, .3);
  color: #a29bfe;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .5px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 18px;
  letter-spacing: -.5px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: #94a3b8;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
  white-space: nowrap;
}

.btn-primary {
  padding: 14px 28px;
  background: linear-gradient(135deg, #6C63FF 0%, #48c6ef 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(108, 99, 255, .35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, .5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  padding: 10px 18px;
  background: transparent;
  color: #a29bfe;
  border: 1px solid rgba(108, 99, 255, .4);
}

.btn-outline:hover {
  background: rgba(108, 99, 255, .1);
  border-color: rgba(108, 99, 255, .7);
}

.btn-ghost {
  padding: 10px 16px;
  background: transparent;
  color: #64748b;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .05);
  color: #94a3b8;
}

.btn-sm {
  font-size: .82rem;
  padding: 8px 14px;
  border-radius: 9px;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1rem;
  border-radius: 14px;
}

/* ── Converter Card ── */
.converter-card {
  background: #161923;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 24px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}

.converter-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(108, 99, 255, .15) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed rgba(108, 99, 255, .35);
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease;
  background: rgba(108, 99, 255, .04);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #6C63FF;
  background: rgba(108, 99, 255, .1);
  transform: scale(1.01);
}

.drop-zone.drag-over {
  box-shadow: 0 0 0 4px rgba(108, 99, 255, .2);
}

.drop-icon {
  margin-bottom: 20px;
}

.drop-icon svg {
  width: 64px;
  height: 64px;
}

.drop-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.drop-sub {
  color: #64748b;
  font-size: .95rem;
  margin-bottom: 24px;
}

.drop-hint {
  margin-top: 16px;
  font-size: .8rem;
  color: #475569;
}

/* ── Preview Section ── */

.preview-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.preview-title-group h3 {
  font-size: 1.1rem;
  color: #e2e8f0;
  font-weight: 600;
}

.preview-hint {
  font-size: .8rem;
  color: #475569;
  margin-top: 4px;
}

.preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
  min-height: 80px;
}

/* Image Card */
.img-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #1e2330;
  border: 2px solid transparent;
  cursor: grab;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  aspect-ratio: 1;
  user-select: none;
}

.img-card:hover {
  border-color: rgba(108, 99, 255, .5);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

.img-card.dragging {
  opacity: .4;
  cursor: grabbing;
  border-color: #6C63FF;
}

.img-card.drag-target {
  border-color: #48c6ef;
  box-shadow: 0 0 0 3px rgba(72, 198, 239, .25);
}

.img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity .2s;
  display: flex;
  align-items: flex-end;
  padding: 8px;
}

.img-card:hover .img-card-overlay {
  opacity: 1;
}

.img-name {
  font-size: .7rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.img-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(108, 99, 255, .85);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, .85);
  border: none;
  cursor: pointer;
  color: white;
  font-size: .85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}

.img-card:hover .remove-btn {
  opacity: 1;
}

.remove-btn:hover {
  transform: scale(1.15);
}

/* ── Convert Bar ── */
.convert-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  flex-wrap: wrap;
}

.convert-info {
  font-size: .85rem;
  color: #64748b;
}

.convert-info span {
  color: #94a3b8;
  font-weight: 500;
}

/* ── Progress Overlay ── */
.progress-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 15, 20, .9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  z-index: 10;
}

.progress-content {
  text-align: center;
  width: 300px;
}

.progress-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border: 3px solid rgba(108, 99, 255, .2);
  border-top-color: #6C63FF;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-label {
  color: #e2e8f0;
  font-weight: 500;
  margin-bottom: 16px;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, .08);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6C63FF, #48c6ef);
  border-radius: 100px;
  width: 0%;
  transition: width .3s ease;
}

.progress-pct {
  font-size: .85rem;
  color: #64748b;
}

/* ── Features Strip ── */
.features-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 64px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #161923;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 16px;
  padding: 20px;
  transition: border-color .2s;
}

.feature-item:hover {
  border-color: rgba(108, 99, 255, .3);
}

.feature-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.feature-item strong {
  display: block;
  color: #e2e8f0;
  font-size: .9rem;
  margin-bottom: 2px;
}

.feature-item span {
  font-size: .8rem;
  color: #64748b;
}

/* ── Info Sections ── */
.info-section {
  margin-bottom: 72px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 36px;
  text-align: center;
  letter-spacing: -.3px;
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.step-card {
  background: #161923;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 20px;
  padding: 32px 28px;
  transition: transform .25s, box-shadow .25s;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4);
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6C63FF, #48c6ef);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(108, 99, 255, .3);
}

.step-card h3 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 10px;
  font-weight: 600;
}

.step-card p {
  font-size: .88rem;
  color: #64748b;
  line-height: 1.65;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #161923;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s;
}

.faq-item:hover {
  border-color: rgba(108, 99, 255, .25);
}

.faq-item summary {
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 600;
  color: #e2e8f0;
  font-size: .95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: #6C63FF;
  flex-shrink: 0;
  transition: transform .2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 24px 20px;
  font-size: .88rem;
  color: #64748b;
  line-height: 1.7;
  border-top: 1px solid rgba(255, 255, 255, .05);
  padding-top: 16px;
}

/* ── SEO Article ── */
.seo-article {
  max-width: 800px;
  margin: 0 auto 80px;
}

.article-content {
  background: #161923;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 24px;
  padding: 48px;
  color: #94a3b8;
  line-height: 1.8;
  font-size: .95rem;
}

.article-content h2,
.article-content h3 {
  color: #e2e8f0;
  margin-top: 36px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.article-content h2 {
  font-size: 1.4rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  padding-bottom: 12px;
}

.article-content h3 {
  font-size: 1.15rem;
  color: #cbd5e1;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content p:last-child {
  margin-bottom: 0;
}

.seo-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 24px;
}

.seo-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
}

.seo-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 1px;
  color: #6C63FF;
  font-size: .8rem;
}

.seo-list li strong {
  color: #e2e8f0;
}

/* Metrics Table */
.metrics-table-wrapper {
  margin: 36px 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.metrics-table th,
.metrics-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.metrics-table th {
  background: rgba(108, 99, 255, .1);
  color: #a29bfe;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.metrics-table tr:last-child td {
  border-bottom: none;
}

.metrics-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, .02);
}

.metrics-table tbody tr:hover {
  background: rgba(255, 255, 255, .04);
}

/* ── Footer ── */
.site-footer {
  background: #0a0c11;
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 32px 0;
  margin-top: 80px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner p {
  font-size: .82rem;
  color: #334155;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e2330;
  border: 1px solid rgba(255, 255, 255, .1);
  color: #e2e8f0;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: .88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(239, 68, 68, .4);
  color: #fca5a5;
}

.toast.success {
  border-color: rgba(72, 198, 239, .3);
  color: #7dd3fc;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .converter-card {
    padding: 24px 20px;
  }

  .drop-zone {
    padding: 40px 20px;
  }

  .convert-bar {
    justify-content: center;
  }

  .convert-info {
    text-align: center;
  }

  .header-nav {
    display: none;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .hero {
    padding: 50px 0 30px;
  }
}