/* ============================================================
   style.css  —  Shared styles for all pages
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-primary:   #4f46e5;   /* indigo-600 */
  --clr-primary-h: #4338ca;   /* indigo-700 */
  --clr-accent:    #06b6d4;   /* cyan-500   */
  --clr-bg:        #f8fafc;
  --clr-surface:   #ffffff;
  --clr-border:    #e2e8f0;
  --clr-text:      #1e293b;
  --clr-muted:     #64748b;
  --clr-danger:    #ef4444;
  --clr-success:   #22c55e;
  --radius:        0.75rem;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --transition:    0.2s ease;
  --max-w:         1200px;
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--clr-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--clr-primary-h); }

/* Accessible text links within copy/editorial content */
p a, .prose a, .faq-answer a, .compare-table td a, section li a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 2px;
}
p a:hover, .prose a:hover, .faq-answer a:hover, .compare-table td a:hover, section li a:not(.btn):hover {
  text-decoration-thickness: 2px;
}
.nav-links a, .footer-links a, .btn, .nav-brand, .hero-actions a {
  text-decoration: none;
}

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

/* ── Editorial / long-form prose ─────────────────────── */
.prose-section h2 { margin-top: 2.25rem; }
.prose-section p,
.prose-section li { color: var(--clr-text); line-height: 1.8; }
.prose-section ol,
.prose-section ul { padding-left: 1.4rem; margin-top: .6rem; }
.prose-section li  { margin-bottom: .3rem; }

/* ── Typography ───────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p  { color: var(--clr-muted); }

/* ── Layout Helpers ───────────────────────────────────── */
.container { max-width: var(--max-w); margin-inline: auto; padding-inline: 1.25rem; }
.section   { padding-block: 4rem; }
.flex      { display: flex; }
.grid      { display: grid; }
main       { flex: 1; }

/* ── Header / Nav ─────────────────────────────────────── */
.site-header {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.25rem; font-weight: 800;
  color: var(--clr-text);
  text-decoration: none;
}
.nav-brand img { display: block; flex-shrink: 0; }

.nav-brand-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--clr-text);
  letter-spacing: -.01em;
  line-height: 1;
}

.nav-links {
  display: flex; align-items: center; gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: .9rem; font-weight: 500;
  color: var(--clr-muted);
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--clr-primary); }

.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; color: var(--clr-text); padding: .25rem;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none; flex-direction: column; gap: .5rem;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open { display: flex; }
  .site-header { position: relative; }
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .625rem 1.4rem;
  border-radius: 999px;
  font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--clr-primary); color: #fff;
}
.btn-primary:hover {
  background: var(--clr-primary-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--clr-primary);
  color: var(--clr-primary);
}
.btn-outline:hover {
  background: var(--clr-primary); color: #fff;
  transform: translateY(-1px);
}

.btn-danger { background: var(--clr-danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: .4rem 1rem; font-size: .8rem; }
.btn-lg { padding: .8rem 2rem; font-size: 1rem; }

.btn:disabled {
  opacity: .5; cursor: not-allowed; transform: none !important;
}

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-static:hover { box-shadow: var(--shadow-sm); transform: none; }

/* ── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  background: #ede9fe; color: var(--clr-primary);
}

/* ── Hero (Homepage) ──────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
  padding-block: 5rem 4rem;
  text-align: center;
}
.hero h1 { margin-bottom: .75rem; }
.hero p  { font-size: 1.1rem; max-width: 580px; margin-inline: auto; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Tool Grid (Homepage) ─────────────────────────────── */
.tools-section { padding-block: 4rem; }
.tools-section h2 { text-align: center; margin-bottom: .5rem; }
.tools-section > .container > p { text-align: center; margin-bottom: 2.5rem; }

.tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.tool-card { display: flex; flex-direction: column; gap: .75rem; }
.tool-card-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: .625rem;
  background: #ede9fe; color: var(--clr-primary);
}
.tool-card h3 { margin-bottom: .15rem; }
.tool-card p  { flex: 1; font-size: .9rem; }
.tool-card a.btn { align-self: flex-start; margin-top: .25rem; }

/* ── Page Hero (inner pages) ──────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
  padding-block: 3rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--clr-border);
}
.page-hero h1 { margin-bottom: .5rem; }
.page-hero p  { font-size: 1rem; max-width: 540px; margin-inline: auto; }

/* ── Tool Workspace ───────────────────────────────────── */
.tool-wrapper {
  max-width: 860px;
  margin-inline: auto;
  padding-block: 2.5rem;
  padding-inline: 1.25rem;
}

/* Upload Zone */
.upload-zone {
  border: 2.5px dashed var(--clr-border);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--clr-surface);
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--clr-primary);
  background: #f5f3ff;
}
.upload-zone:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
  border-color: var(--clr-primary);
  background: #f5f3ff;
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.upload-icon {
  width: 56px; height: 56px;
  background: #ede9fe; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: var(--clr-primary);
}
.upload-zone .upload-heading { margin-bottom: .35rem; color: var(--clr-text); font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.upload-zone p  { font-size: .88rem; }
.upload-hint    { font-size: .78rem; margin-top: .5rem; color: #94a3b8; }

/* Options Panel */
.options-panel {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}
.options-panel .options-heading { margin-bottom: 1rem; font-size: 1rem; font-weight: 700; line-height: 1.25; display: flex; align-items: center; gap: .5rem; }

.options-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.option-group { display: flex; flex-direction: column; gap: .35rem; }
.option-group label {
  font-size: .82rem; font-weight: 600;
  color: var(--clr-muted); text-transform: uppercase; letter-spacing: .04em;
}
.option-group select,
.option-group input[type="text"],
.option-group input[type="number"] {
  padding: .5rem .75rem;
  border: 1.5px solid var(--clr-border);
  border-radius: .5rem;
  font-size: .9rem;
  background: var(--clr-bg);
  color: var(--clr-text);
  transition: border-color var(--transition);
  width: 100%;
}
.option-group select:focus,
.option-group input:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.toggle-group {
  display: flex; align-items: center;
  gap: .6rem; margin-top: .25rem;
}
.toggle-group span { font-size: .9rem; }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #cbd5e1; border-radius: 999px;
  transition: .3s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: .3s;
}
.switch input:checked + .slider { background: var(--clr-primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Image Preview Grid */
.preview-section { margin-top: 1.75rem; }
.preview-section .preview-heading {
  font-size: 1rem; font-weight: 700; line-height: 1.25; margin-bottom: .9rem;
  display: flex; align-items: center; justify-content: space-between;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
}

.image-item {
  position: relative;
  border-radius: .5rem;
  overflow: hidden;
  border: 1.5px solid var(--clr-border);
  background: #f1f5f9;
  aspect-ratio: 1 / 1.3;
  cursor: grab;
  transition: box-shadow var(--transition), transform var(--transition);
  user-select: none;
}
.image-item:hover { box-shadow: var(--shadow-md); }
.image-item.dragging { opacity: .5; transform: scale(.97); }
.image-item.drag-target { border-color: var(--clr-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.2); }

.image-item img {
  width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
}

.image-item-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 50%);
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: .4rem;
  opacity: 0; transition: opacity var(--transition);
}
.image-item:hover .image-item-overlay { opacity: 1; }

.image-item-num {
  background: rgba(0,0,0,.55);
  color: #fff; font-size: .7rem; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  align-self: flex-start;
}
.image-item-actions {
  display: flex; gap: .3rem; justify-content: flex-end;
}
.image-item-actions button {
  background: rgba(255,255,255,.9);
  border: none; border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .7rem; color: var(--clr-text);
  transition: background var(--transition);
}
.image-item-actions button:hover { background: #fff; }
.image-item-actions button.del { color: var(--clr-danger); }

.image-item-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: .25rem .4rem;
  font-size: .68rem; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
}

/* Action Bar */
.action-bar {
  display: flex; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--clr-border);
}
.action-bar .info { flex: 1; font-size: .85rem; color: var(--clr-muted); }

/* Progress */
.progress-wrap {
  margin-top: 1.5rem;
  display: none;
}
.progress-wrap.visible { display: block; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: .82rem; color: var(--clr-muted);
  margin-bottom: .4rem;
}
.progress-bar-bg {
  height: 8px; border-radius: 999px;
  background: var(--clr-border); overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  width: 0%; transition: width .3s ease;
}

/* Alert / Toast */
.alert {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .9rem 1.1rem;
  border-radius: .625rem;
  margin-top: 1rem;
  font-size: .88rem;
}
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── Features Section ─────────────────────────────────── */
.features-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.feature-item { text-align: center; padding: 1.5rem 1rem; }
.feature-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .85rem;
  background: #ede9fe; color: var(--clr-primary);
}
.feature-item h3,
.feature-item h4 { margin-bottom: .35rem; font-size: 1rem; font-weight: 700; line-height: 1.25; }
.feature-item p  { font-size: .88rem; }

/* ── FAQ ──────────────────────────────────────────────── */
.faq-list { max-width: 680px; margin-inline: auto; margin-top: 2rem; }
.faq-item {
  border-bottom: 1px solid var(--clr-border);
  padding-block: 1rem;
}
.faq-question {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; background: none; border: none; padding: 0;
  font: inherit; font-weight: 600; color: inherit; text-align: left;
  cursor: pointer; gap: .5rem;
}
.faq-question:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 4px;
  border-radius: 4px;
}
.faq-answer {
  font-size: .9rem; color: var(--clr-muted);
  overflow: hidden; max-height: 0;
  transition: max-height .35s ease, padding .35s ease;
}
.faq-item.open .faq-answer { max-height: 300px; padding-top: .6rem; }
.faq-chevron { transition: transform .3s; flex-shrink: 0; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  background: var(--clr-text);
  color: #94a3b8;
  padding-block: 2.5rem;
  font-size: .88rem;
  margin-top: auto;
}
.footer-inner {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.footer-brand {
  font-weight: 800; font-size: 1.1rem;
  color: #fff; display: flex; align-items: center; gap: .4rem;
}
.footer-links {
  display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap;
}
.footer-links a { color: #94a3b8; transition: color var(--transition); }
.footer-links a:hover { color: #fff; }
.footer-copy { width: 100%; text-align: center; padding-top: 1.5rem; border-top: 1px solid #334155; margin-top: 1rem; }

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  list-style: none; font-size: .82rem; color: var(--clr-muted);
  margin-bottom: .75rem;
}
.breadcrumb a { color: var(--clr-muted); }
.breadcrumb a:hover { color: var(--clr-primary); }

/* ── Contact Page ────────────────────────────────────── */
.contact-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: stretch;
}

@media (max-width: 768px) {
  .contact-cards-row { grid-template-columns: 1fr; }
}

.contact-card-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.1rem; margin-bottom: .6rem; color: var(--clr-text);
}
.contact-checklist {
  padding-left: 1.2rem; margin-top: .5rem;
  font-size: .92rem; color: var(--clr-muted); line-height: 1.8;
}
.contact-email-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-top: 1.15rem; padding: 1rem 1.25rem;
  background: var(--clr-bg); border: 1.5px solid var(--clr-border); border-radius: .625rem;
}
.contact-email-box a.contact-email-link {
  font-weight: 700; font-size: 1.05rem; word-break: break-all;
}
.contact-email-actions {
  display: flex; gap: .6rem; flex-wrap: wrap;
}

/* ── Utility ──────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.hidden { display: none !important; }

