/* ------------------------------------------
   SEO-Assist — Warm Theme (Coral/Chocolate)
   Palette refs: #D2691E, #FFA07A, #FF7F50
-------------------------------------------*/

/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, figure { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; }
a { text-decoration: none; }
:root { -webkit-tap-highlight-color: transparent; }

/* Motion reduce */
@media (prefers-reduced-motion: reduce){
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Tokens */
:root{
  /* Surfaces */
  --bg: #fff8f1;            /* warm ivory page bg */
  --surface: #ffffff;       /* cards/panels */
  --surface-2: #fff3e8;     /* soft highlight */

  /* Text & borders */
  --text: #2b1b12;          /* warm dark brown */
  --text-muted: #7a5e51;    /* muted copy */
  --border: #f0d6c4;        /* warm border */

  /* Accents */
  --primary: #ff7f50;       /* coral */
  --primary-600: #ff6b38;   /* coral (hover) */
  --primary-soft: #ffe2d7;  /* soft coral bg */

  /* Status */
  --success:#3bb273;
  --warning:#ffb020;
  --danger:#e85b5b;

  /* Radii & shadows */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(210,105,30,.10);
  --shadow-sm: 0 6px 16px rgba(210,105,30,.12);

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
  --lh: 1.5;

  /* Spacing */
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
}

/* Base */
body{
  font-family: var(--font-sans);
  line-height: var(--lh);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 20% -10%, #fff0e4 0%, transparent 60%),
    radial-gradient(700px 400px at 120% 0%, #fff3e8 0%, transparent 60%),
    var(--bg);
}

/* Links */
a{
  color: var(--primary);
  transition: color .15s ease, opacity .15s ease;
}
a:hover,
a:focus-visible{
  color: var(--primary-600);
  text-decoration: underline;
  outline: none;
  cursor: pointer;
}

/* Utility */
.unstyled{ list-style: none; padding-left: 0; margin: 0; }

/* Layout */
.layout{
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100dvh;
}
.sidebar{
  background: linear-gradient(180deg, #fff6ee 0%, #fff 100%);
  border-right: 1px solid var(--border);
  padding: var(--space-6) var(--space-5);
  overflow-y: auto; /* длинное меню скроллится */
}
.brand{
  display:flex; align-items:center; gap:10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: .2px;
}
.brand-logo{ display:block; width:24px; height:24px; object-fit:contain; }

.nav{ margin-top: var(--space-5); display:flex; flex-direction:column; gap:6px; }
.nav-section{
  margin: var(--space-3) 0 var(--space-2);
  color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
}
.nav-link{
  display:flex; align-items:center; gap:10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text);
}
.nav-link:hover{ background: var(--surface-2); }
.nav-link:focus-visible{
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  background: var(--surface-2);
}
.nav-link.active{
  background: var(--primary-soft);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--primary);
}
.icon{ width: 18px; text-align:center; }

.main{ display:flex; flex-direction:column; min-width: 0; }
.topbar{
  display:flex; justify-content:space-between; align-items:center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #fff7f0 100%);
}
.content{ padding: var(--space-6) var(--space-5); }
.footer{
  margin-top: auto;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  background: #fff;
}

/* Cards */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header{
  padding: var(--space-5) var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,127,80,.06), transparent);
}
.card-body{ padding: var(--space-5); }
.card-title{ font-size: 22px; font-weight: 800; letter-spacing:.2px; }
.card-subtitle{ margin-top: 6px; color: var(--text-muted); }

/* Forms */
.form .label{ display:block; font-weight:700; margin-bottom: 8px; }
.textarea, .input{
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.textarea{ min-height: 140px; resize: vertical; }
.textarea:focus, .input:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,127,80,.18);
  background: #fffefd;
}
.input:disabled, .textarea:disabled{ background:#faf6f2; color: var(--text-muted); }
.actions{ display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }
.helper{ color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* Buttons — unified interaction */
.btn,
.btn-secondary,
.btn-ghost{
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

/* Primary (coral) */
.btn{
  background: var(--primary);
  color: #3b251a;
  font-weight: 800;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 6px 18px rgba(255,127,80,.25);
}
.btn:hover{ background: var(--primary-600); }
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Ghost */
.btn-ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 700;
  padding: 10px 16px;
  box-shadow: none;
}
.btn-ghost:hover{
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(255,127,80,.15);
}
.btn-ghost:active{ transform: translateY(1px); }
.btn-ghost:focus-visible{
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Secondary */
.btn-secondary{
  background: #ffd0bf;
  color: #4a2b1d;
  border: 1px solid #ffc2a9;
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 6px 18px rgba(255,160,122,.25);
  font-weight: 700;
}
.btn-secondary:hover{
  background: #ffc9b5;         /* чуть темнее */
  border-color: #ffb89d;
  color: #3a2218;
  box-shadow: 0 6px 18px rgba(255,160,122,.28);
}
.btn-secondary:active{ transform: translateY(1px); }
.btn-secondary:focus-visible{
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Legacy safety: if .btn and .btn-secondary used together — keep secondary look */
.btn.btn-secondary,
.btn.btn-secondary:hover{
  background: #ffd0bf;
  color: #4a2b1d;
  border-color: #ffc2a9;
  box-shadow: 0 6px 18px rgba(255,160,122,.25);
}

/* Disabled */
.btn[disabled], .btn-secondary[disabled], .btn-ghost[disabled]{
  opacity: .6; cursor: not-allowed; transform: none;
}

/* Alerts */
.alert{
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.alert-success{ border-color: rgba(59,178,115,.35); background: rgba(59,178,115,.10); }
.alert-danger{ border-color: rgba(232,91,91,.35); background: rgba(232,91,91,.10); }
.alert-warning{ border-color: rgba(255,176,32,.35); background: rgba(255,176,32,.10); }

/* Tables */
.table{
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.table thead th{
  background: #fff7f0;
  padding: 10px 12px; text-align:left; font-weight:800; border-bottom:1px solid var(--border);
}
.table tbody td{
  padding: 10px 12px; border-top: 1px solid var(--border);
}
.table tbody tr:hover{ background: #fffaf6; }

/* Badges & helpers */
.badge{
  display:inline-block; padding: 4px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight:800; font-size:12px;
}
.muted{ color: var(--text-muted); }

/* Stacks */
.stack-lg > * + *{ margin-top: var(--space-6); }
.stack-md > * + *{ margin-top: var(--space-4); }
.stack-sm > * + *{ margin-top: var(--space-3); }

/* Code box */
.codebox{
  background:#fffaf6;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  overflow:auto;
  line-height:1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:13px;
}

/* === Mobile hamburger & off-canvas === */
.hamburger{
  display: none;            /* hidden on desktop */
  padding: 8px 10px;
  border-radius: 12px;
}

.backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(1px);
  z-index: 80;
}

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .hamburger{ display: inline-flex; align-items:center; justify-content:center; }

  /* Off-canvas sidebar — hidden by default */
  .sidebar{
    position: fixed;
    z-index: 100;
    top: 0; left: 0;
    height: 100dvh;
    width: min(86vw, 320px);
    transform: translateX(-100%);
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: none;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, #fff6ee 0%, #fff 100%);
  }
  .sidebar.open{
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  .topbar{ position: sticky; top: 0; z-index: 70; }
}

/* мини-стили для drag-списка */
#colList { margin-top: 6px; }
.dr-item{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border:1px solid var(--border); border-radius:10px;
  background:#fff; cursor:grab;
}
.dr-item + .dr-item{ margin-top:8px; }
.dr-item.dragging{ opacity:.6; }
.dr-handle{
  user-select:none; -webkit-user-select:none;
  font-weight:700; letter-spacing:2px; cursor:grab;
  display:flex; align-items:center; justify-content:center;
  width:20px; color:#9b6b4a;
}
.dr-label{ flex:1; cursor:pointer; }
.dr-item.is-key{ opacity:.65; }
#colList input[type="checkbox"]{ cursor:pointer; }
#downloadLinks li a{ text-decoration:underline; }

/* больше расстояние между кнопками выбора колонок */
#preflightCard .actions.actions-cols {
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

/* ==== Result snackbar (File Joiner) ==== */
.donebar{
  position:fixed; left:16px; right:16px; bottom:16px;
  background:#fff; border:1px solid var(--border-color,#e7d3c8);
  box-shadow:0 10px 30px rgba(0,0,0,.12); border-radius:16px;
  padding:12px; z-index:9999;
}
.donebar[hidden]{ display:none !important; }
.donebar-content{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.done-check{
  width:28px; height:28px; border-radius:999px;
  background:#10b981; color:#fff; display:inline-flex;
  align-items:center; justify-content:center; font-weight:700;
}
.done-title{ font-weight:600; }
.done-sub{ font-size:13px; color:#6b7280; }
.donebar .btn{ margin-left:auto; }
.donebar .btn-ghost{ margin-left:0; }
@media (max-width:640px){
  .donebar .btn, .donebar .btn-ghost{ flex:1 1 100%; }
}
