/* ============================================================
   controls.css — Sidebar UI components
   ============================================================ */

/* ── Accordion ────────────────────────────────────────────── */
details.sec { border-bottom: 1px solid rgba(255,255,255,0.04); }

details.sec > summary {
  padding: 11px 20px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  transition: color 0.15s;
  user-select: none;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after {
  content: '›';
  font-size: 1rem;
  transition: transform 0.2s;
  font-weight: 400;
}
details.sec[open] > summary { color: var(--text-main); }
details.sec[open] > summary::after { transform: rotate(90deg); }
details.sec > summary:hover { color: var(--text-main); }

.sec-body {
  padding: 2px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* ── Control wrappers ─────────────────────────────────────── */
.ctrl { display: flex; flex-direction: column; gap: 4px; }
.ctrl-row { display: flex; gap: 8px; }
.ctrl-row .ctrl { flex: 1; }

.lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* ── Inputs & Selects (inset style) ──────────────────────── */
input[type=text],
input[type=number],
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid transparent;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238e8ea6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

input:focus, select:focus {
  border-color: var(--neon-blue);
  box-shadow: var(--shadow-glow-blue);
}

/* ── Range sliders ────────────────────────────────────────── */
input[type=range] {
  width: 100%;
  accent-color: var(--neon-blue);
  cursor: pointer;
  height: 3px;
}

.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; }
.rval {
  font-size: 0.72rem;
  color: var(--neon-blue);
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

/* ── Toggles ──────────────────────────────────────────────── */
.tog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tog-lbl { font-size: 0.8rem; color: var(--text-main); }

.tog {
  position: relative;
  width: 38px; height: 21px;
  background: var(--bg-hover);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.tog.on { background: var(--neon-blue); }
.tog::after {
  content: '';
  position: absolute;
  width: 15px; height: 15px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}
.tog.on::after { transform: translateX(17px); }

/* ── Button groups ────────────────────────────────────────── */
.btn-grp { display: flex; gap: 4px; flex-wrap: wrap; }

.bopt {
  flex: 1;
  padding: 6px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  white-space: nowrap;
}
.bopt.on {
  background: var(--neon-blue);
  border-color: var(--neon-blue);
  color: white;
  box-shadow: var(--shadow-glow-blue);
}
.bopt:hover:not(.on) {
  border-color: rgba(255,255,255,0.2);
  color: var(--text-main);
  background: var(--bg-hover);
}

/* ── Icon buttons ─────────────────────────────────────────── */
.ico-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.ico-btn:hover { color: var(--text-main); border-color: rgba(255,255,255,0.2); }

/* ── Primary / Export button ──────────────────────────────── */
.btn-primary {
  flex: 1;
  padding: 11px;
  background: var(--grad-pink);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-glow-pink);
  transition: all 0.3s ease;
  letter-spacing: -0.01em;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(253,93,147,0.6);
}

.btn-sec {
  width: 42px;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-input);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
  font-family: inherit;
}
.btn-sec:hover { color: var(--text-main); }

/* ── Color input ──────────────────────────────────────────── */
input[type=color] {
  width: 32px; height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-input);
}

/* ── Zoom bar ─────────────────────────────────────────────── */
.z-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
  font-family: inherit;
}
.z-btn:hover { border-color: rgba(255,255,255,0.2); }
#zoom-bar span { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

/* ── Toast ────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 70px; right: 20px;
  background: var(--bg-panel);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 999;
  box-shadow: var(--shadow-soft);
}
#toast.show { opacity: 1; transform: translateY(0); }

/* Sprint 3 — Feed source rows */
.source-row {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-input); border-radius: var(--radius-sm);
  padding: 5px 8px;
}
.source-row select {
  flex: 1; background: transparent; border: none;
  color: var(--text-main); font-size: .78rem; padding: 0;
  font-family: inherit; cursor: pointer;
}
.source-row select:focus { box-shadow: none; border: none; }
.feed-color-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: none; cursor: pointer; padding: 0;
  background: none; flex-shrink: 0;
  -webkit-appearance: none; overflow: hidden;
}
.feed-color-dot::-webkit-color-swatch-wrapper { padding: 0; }
.feed-color-dot::-webkit-color-swatch { border: none; border-radius: 50%; }
.rm-source { background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: .85rem; padding: 0; line-height: 1; flex-shrink: 0; }
.rm-source:hover { color: #ef4444; }
.add-source-btn {
  background: none; border: 1px dashed rgba(255,255,255,.15);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 5px 10px; font-size: .72rem; font-family: inherit;
  cursor: pointer; width: 100%; text-align: left;
  transition: border-color .15s, color .15s;
}
.add-source-btn:hover { border-color: var(--neon-blue); color: var(--neon-blue); }
.add-source-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── Sprint 3.5: Typography pairings grid ──────────────────── */
.type-pairings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.type-sw {
  background: var(--bg-input);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 8px 10px 6px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.type-sw:hover:not(.on) { border-color: rgba(255,255,255,0.25); }
.type-sw.on {
  border-color: var(--neon-blue);
  box-shadow: var(--shadow-glow-blue);
  background: rgba(29,140,248,0.06);
}

.type-sw-month {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.type-sw-num {
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1;
}
.type-sw-ev {
  font-size: 0.6rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
}
.type-sw-name {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--neon-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 4px;
}

/* ── Updated theme swatches ────────────────────────────────── */
.themes-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }

.tsw {
  border-radius: 7px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.15s;
  aspect-ratio: 3/4; display: flex; flex-direction: column;
}
.tsw.on { border-color: var(--neon-blue); box-shadow: var(--shadow-glow-blue); }
.tsw:hover:not(.on) { border-color: rgba(255,255,255,0.25); }

.tsw-ph { height: 28%; }
.tsw-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1px; padding: 2px;
}
.tsw-cell { border-radius: 1px; }
.tsw-name {
  font-size: 0.55rem; font-weight: 700;
  padding: 3px 4px; text-align: center;
}

/* ── Affiliate card ─────────────────────────────────────── */
.affiliate-card {
  background: linear-gradient(135deg, rgba(253,93,147,0.08), rgba(29,140,248,0.08));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-family: 'Poppins', sans-serif;
}
.aff-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.aff-link {
  font-size: 0.68rem;
  color: var(--neon-blue);
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}
.aff-link:hover { color: #fd5d93; }
@media print { .no-print { display: none !important; } }

/* ── Full-width print button (replaces round button) ─── */
.btn-print-full {
  width: 100%;
  background: linear-gradient(135deg, #fd5d93, #e53e7a);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 13px 16px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(253,93,147,0.35);
}
.btn-print-full:hover  { opacity: 0.92; }
.btn-print-full:active { transform: scale(0.97); }

/* ── UI language selector with flag icons ──────────── */
.ui-lang-sel {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.72rem;
  padding: 4px 6px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  max-width: 80px;
}
.ui-lang-sel:hover { background: rgba(255,255,255,0.1); }
