/* ============================================================
   sokken-generator.css — WordPress Plugin
   Alle stijlen zijn gescoopt binnen .sgw-wrap
   ============================================================ */

/* ── Wrapper ──────────────────────────────────────────────── */
.sgw-wrap {
  --bg:            #F4EDE0;
  --bg-card:       #FFFCF6;
  --bg-output:     #FDFBF6;
  --text:          #271408;
  --text-muted:    #7A6555;
  --accent:        #B5521F;
  --accent-hover:  #943F12;
  --accent-light:  #F5E0D2;
  --border:        #DDD2BE;
  --border-focus:  #B5521F;
  --radius:        10px;
  --radius-sm:     6px;
  --font-head:     'Playfair Display', Georgia, serif;
  --font-body:     'Crimson Pro', Georgia, serif;
  --font-mono:     'Courier Prime', 'Courier New', monospace;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
}

/* ============================================================
   style.css — Sokkenpatroon Generator
   ============================================================ */

/* ── Main layout ─────────────────────────────────────────── */
.sgw-wrap .sgw-main {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: calc(100vh - 90px);
  gap: 0;
}
@media (max-width: 900px) {
  .sgw-wrap .sgw-main { grid-template-columns: 1fr; }
}

/* ── Sidebar (form) ──────────────────────────────────────── */
.sgw-wrap .sgw-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 2rem 1.75rem;
  overflow-y: auto;
}
.sgw-sidebar h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

/* Form groups */
.sgw-form-group {
  margin-bottom: 1.4rem;
}
.sgw-form-group label,
.sgw-form-group .sgw-group-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .45rem;
}
.sgw-form-group select,
.sgw-form-group input[type="text"] {
  width: 100%;
  padding: .55rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  transition: border-color .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A6555' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  padding-right: 2.4rem;
  cursor: pointer;
}
.sgw-form-group select:focus { outline: none; border-color: var(--border-focus); }

/* Radio buttons */
.sgw-radio-group {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.sgw-radio-option {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .18s, background .18s;
  background: var(--bg);
}
.sgw-radio-option:hover { border-color: var(--accent); background: var(--accent-light); }
.sgw-radio-option input[type="radio"] { accent-color: var(--accent); margin-top: .2rem; flex-shrink: 0; }
.sgw-radio-option input[type="radio"]:checked ~ .sgw-radio-label { color: var(--accent); font-weight: 600; }
.sgw-radio-option.sgw-selected { border-color: var(--accent); background: var(--accent-light); }
.sgw-radio-label { font-size: .95rem; line-height: 1.3; }
.sgw-radio-label .sgw-radio-desc { display: block; font-size: .8rem; color: var(--text-muted); margin-top: .1rem; }

/* Color chart row (only shown for colorwork) */
#sgw-chart-group { transition: opacity .3s; }
#sgw-chart-group.sgw-hidden { display: none; }

/* Divider */
.sgw-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 1.5rem 0;
}

/* Language toggle */
.sgw-lang-toggle {
  display: flex;
  gap: .5rem;
}
.sgw-lang-btn {
  flex: 1;
  padding: .45rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: .9rem;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
}
.sgw-lang-btn.sgw-active { background: var(--text); color: #F4EDE0; border-color: var(--text); }

/* Generate button */
.sgw-btn-generate {
  width: 100%;
  padding: .85rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .2s, transform .1s;
  margin-top: .5rem;
}
.sgw-btn-generate:hover { background: var(--accent-hover); }
.sgw-btn-generate:active { transform: scale(.98); }
.sgw-btn-generate:disabled { background: var(--text-muted); cursor: not-allowed; }

/* Loading spinner */
.sgw-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: .5rem;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Output pane ─────────────────────────────────────────── */
.sgw-wrap .sgw-output-pane {
  padding: 2rem 2.5rem;
  background: var(--bg);
  overflow-y: auto;
}
.sgw-output-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.sgw-output-toolbar h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sgw-btn-print {
  padding: .45rem 1rem;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-body);
  font-size: .9rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: all .2s;
}
.sgw-btn-print:hover { background: var(--text); color: #fff; border-color: var(--text); }
.sgw-btn-print.sgw-hidden { display: none; }

/* Empty state */
.sgw-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--text-muted);
  text-align: center;
  gap: 1rem;
}
.sgw-empty-state .empty-icon { font-size: 4rem; opacity: .4; }
.sgw-empty-state h3 { font-family: var(--font-head); font-size: 1.3rem; color: var(--text); }
.sgw-empty-state p { font-size: .95rem; max-width: 300px; }

/* ── Pattern Output ──────────────────────────────────────── */
#sgw-pattern-output { display: none; }
#sgw-pattern-output.sgw-visible { display: block; }

.sgw-pattern-header {
  background: var(--text);
  color: #F4EDE0;
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin-bottom: 1.5rem;
}
.sgw-pattern-header h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #F4EDE0;
  margin-bottom: 1.2rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid rgba(244,237,224,.2);
}
.sgw-pattern-meta { display: grid; gap: .5rem; }
.sgw-meta-row {
  display: flex;
  gap: .75rem;
  font-size: .95rem;
  align-items: baseline;
}
.sgw-meta-key {
  font-size: .75rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: .65;
  min-width: 160px;
  flex-shrink: 0;
}
.sgw-meta-val { font-family: var(--font-body); }
.sgw-meta-row.highlight .sgw-meta-val { font-size: 1.1rem; font-weight: 600; }
.sgw-cast-on-number {
  font-family: var(--font-head);
  font-size: 1.4rem !important;
  color: #F7C97E;
}

/* Pattern sections */
.sgw-pattern-section {
  background: var(--bg-output);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}
.sgw-pattern-section h3 {
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bg-output);
  background: var(--accent);
  padding: .55rem 1.25rem;
}
.sgw-section-title-en { opacity: .75; font-weight: 400; }
.sgw-section-content { padding: 1rem 1.25rem; font-size: .97rem; }
.sgw-section-content p { margin-bottom: .65rem; }
.sgw-section-content p:last-child { margin-bottom: 0; }
.sgw-section-content ul { padding-left: 1.3rem; }
.sgw-section-content li { margin-bottom: .45rem; }
.sgw-section-content h4 { font-family: var(--font-head); font-size: 1rem; margin: .75rem 0 .4rem; color: var(--accent); }
.sgw-en-version { color: var(--text-muted); font-style: italic; font-size: .93em; }
.sgw-en-inline  { color: var(--text-muted); font-size: .88em; }
.sgw-en-step    { display: block; color: var(--text-muted); font-style: italic; font-size: .9em; margin-top: .2rem; }

/* Abbreviations */
.sgw-abbr-list {
  columns: 2;
  column-gap: 1.5rem;
  list-style: none;
  padding: 0;
}
.sgw-abbr-list li { font-size: .88rem; margin-bottom: .3rem; break-inside: avoid; }
@media (max-width: 700px) { .sgw-abbr-list { columns: 1; } }

/* ── Color Chart ─────────────────────────────────────────── */
.sgw-color-chart { margin: .75rem 0; }
.sgw-color-chart h4 { font-family: var(--font-head); font-size: 1rem; margin-bottom: .35rem; }
.sgw-chart-note { font-size: .83rem; color: var(--text-muted); margin-bottom: .75rem; }

.sgw-chart-grid {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-width: 100%;
}
.sgw-chart-row {
  display: flex;
  align-items: center;
}
.sgw-chart-row:nth-child(even) { background: rgba(0,0,0,.02); }
.sgw-chart-cell {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  border: .5px solid rgba(0,0,0,.1);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.sgw-chart-header .sgw-chart-cell { background: #E8DDD0; font-size: .7rem; font-weight: 600; color: var(--text-muted); border: none; height: 20px; }
.sgw-chart-col-num { background: #E8DDD0 !important; }
.sgw-chart-row-num {
  width: 24px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  background: #F0E8DC;
  border-right: 1px solid var(--border);
}
.sgw-chart-header .sgw-chart-row-num { height: 20px; }

.sgw-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .65rem;
}
.sgw-legend-item { display: flex; align-items: center; gap: .4rem; font-size: .88rem; }
.sgw-legend-swatch {
  width: 22px; height: 22px;
  border: 1px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}

/* Error state */
.sgw-error-msg {
  background: #FDECEA;
  border: 1px solid #E8A09A;
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  color: #8B1A14;
  margin-bottom: 1rem;
}

/* ── Print styles ─────────────────────────────────────────── */
@media print {
  .sgw-sidebar, .sgw-output-toolbar, .sgw-btn-print, .sgw-empty-state { display: none !important; }
  .sgw-wrap .sgw-main { display: block; }
  .sgw-wrap .sgw-output-pane { padding: 0; }
  #sgw-pattern-output { display: block !important; }
  