/* ═══════════════════════════════════════════════════════════
   FancyText.io — Generator Page CSS v2.1
   ═══════════════════════════════════════════════════════════ */

/* ── INPUT SECTION ───────────────────────────────────────── */
.input-section {
  background: var(--ink); padding: 24px 20px 18px;
  border-bottom: 3px solid var(--yellow);
}
.input-inner { max-width: 1060px; margin: 0 auto; }
.input-label {
  font-family: var(--display);
  font-size: 1rem; letter-spacing: 3px; color: #999;
  text-transform: uppercase; margin-bottom: 10px; display: block;
}

/* Input row */
.input-row { display: flex; gap: 10px; align-items: stretch; }

/* Single-line input (default) */
#main-input {
  flex: 1;
  padding: 14px 16px;
  font-family: var(--mono); font-size: 1.1rem; font-weight: 500;
  background: #fff; color: var(--ink);
  border: 3px solid transparent; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 54px;
  resize: none; /* starts as input-like, becomes textarea when toggled */
  line-height: 1.4;
  overflow: hidden;
}
/* Multiline state */
#main-input.multiline {
  height: auto;
  min-height: 54px;
  max-height: 160px;
  resize: vertical;
  overflow: auto;
}
#main-input::placeholder { color: #bbb; }
#main-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255,224,0,0.22);
}

/* Right-side action buttons */
.input-actions {
  display: flex; flex-direction: column; gap: 6px;
}
.btn-clear {
  flex: 1; padding: 0 18px;
  font-family: var(--display); font-size: 1rem; letter-spacing: 2px;
  background: transparent; color: #fff;
  border: 3px solid #444; cursor: pointer;
  transition: all 0.15s; text-transform: uppercase; white-space: nowrap;
  min-height: 34px; display: flex; align-items: center; justify-content: center;
}
.btn-clear:hover { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* Multiline toggle switch */
.multiline-toggle {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none;
  background: #1a1a1a; border: 2px solid #333;
  padding: 5px 10px; transition: border-color 0.15s;
  white-space: nowrap; justify-content: center;
}
.multiline-toggle:hover { border-color: #555; }
.toggle-label {
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 1px; text-transform: uppercase; color: #aaa;
  transition: color 0.15s;
}
.multiline-toggle.on .toggle-label { color: var(--yellow); }
/* pill switch */
.toggle-track {
  width: 30px; height: 16px; background: #333; border-radius: 8px;
  position: relative; flex-shrink: 0; transition: background 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; background: #666; border-radius: 50%;
  transition: left 0.2s, background 0.2s;
}
.multiline-toggle.on .toggle-track { background: #3a3000; }
.multiline-toggle.on .toggle-track::after { left: 16px; background: var(--yellow); }

/* Meta bar */
.input-meta {
  max-width: 1060px; margin: 8px auto 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.char-counter {
  font-size: 0.7rem; color: #aaa; letter-spacing: 1px; white-space: nowrap;
}
.char-counter.warn  { color: #ff9800; }
.char-counter.limit { color: var(--red); font-weight: 700; }
.stats-bar {
  font-size: 0.7rem; color: #aaa; letter-spacing: 1px; flex: 1;
}
.stats-bar strong { color: var(--yellow); }
.share-btn {
  padding: 5px 11px; font-family: var(--display);
  font-size: 0.78rem; letter-spacing: 1px; text-transform: uppercase;
  background: transparent; color: #888;
  border: 2px solid #333; cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.share-btn:hover { background: var(--ink); color: var(--yellow); border-color: #555; }

/* Style search */
.search-wrap { max-width: 1060px; margin: 10px auto 0; }
#style-search {
  width: 100%; padding: 9px 14px;
  font-family: var(--mono); font-size: 0.85rem;
  background: #1a1a1a; color: #eee;
  border: 2px solid #333; outline: none;
  transition: border-color 0.2s; letter-spacing: 0.5px;
}
#style-search::placeholder { color: #555; }
#style-search:focus { border-color: var(--yellow); }

/* ── CATEGORY BAR — FULL WIDTH, MULTILINE, NO SCROLL ──── */
.cat-bar {
  background: #fff;
  border-bottom: 3px solid var(--gray2);
  /* NOT sticky so multiline can expand freely */
  padding: 0;
}
.cat-inner {
  /* Constrained exactly like header & body — same 1060px max-width */
  max-width: 1060px; margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;          /* ← wraps to multiple lines */
  gap: 0;
  overflow: visible;        /* no scrollbar ever */
}

.cat-btn {
  padding: 11px 14px;
  font-family: var(--display);
  font-size: 0.92rem; letter-spacing: 1px; text-transform: uppercase;
  background: transparent; color: #999;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat-btn:hover { color: var(--ink); background: var(--gray); }
.cat-btn.active, .cat-btn[aria-selected="true"] {
  color: var(--ink); border-bottom-color: var(--yellow);
  background: var(--row-h);
}
/* Starred tab gets a gold accent */
.cat-btn[data-cat="starred"] { color: #bba000; }
.cat-btn[data-cat="starred"].active { color: #7a6000; }

.cat-count {
  display: inline-block;
  background: var(--gray2); color: #888;
  font-family: var(--mono); font-size: 0.6rem;
  padding: 1px 5px; border-radius: 20px; margin-left: 3px;
  vertical-align: middle;
}
.cat-btn.active .cat-count, .cat-btn[aria-selected="true"] .cat-count {
  background: var(--yellow); color: var(--ink);
}
.cat-btn[data-cat="starred"] .cat-count { background: #ffe88a; color: #7a6000; }
.cat-btn[data-cat="starred"].active .cat-count { background: var(--yellow); color: var(--ink); }

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
.main-wrap {
  max-width: 1060px; margin: 0 auto;
  display: flex; gap: 24px; padding: 0 20px 64px;
}
.styles-col { flex: 1; min-width: 0; }

/* ── SPECIAL PANELS (Favorites / Recent) ─────────────────── */
.special-section {
  border: 2px solid var(--gray2); margin: 20px 0 0; overflow: hidden;
}
.special-section-head {
  font-family: var(--display);
  font-size: 1rem; letter-spacing: 3px; text-transform: uppercase;
  padding: 10px 14px; background: var(--ink); color: var(--yellow);
  display: flex; justify-content: space-between; align-items: center;
}
.special-section-head .ss-clear {
  font-family: var(--mono); font-size: 0.65rem; color: #666;
  background: none; border: none; cursor: pointer;
  text-transform: uppercase; letter-spacing: 1px; transition: color 0.15s;
}
.special-section-head .ss-clear:hover { color: var(--red); }
.special-empty {
  padding: 14px 16px; font-size: 0.78rem; color: #bbb; font-style: italic;
}

/* Virtual clear button inside section-head */
.virtual-clear-btn {
  margin-left: auto; font-family: var(--mono); font-size: 0.65rem;
  color: #aaa; background: none; border: 1px solid #ddd;
  padding: 3px 8px; cursor: pointer; text-transform: uppercase;
  letter-spacing: 1px; transition: all 0.15s; flex-shrink: 0;
}
.virtual-clear-btn:hover { color: var(--red); border-color: var(--red); }
  text-align: center; padding: 60px 20px;
  font-family: var(--display); font-size: 1.3rem;
  color: #ddd; letter-spacing: 3px; text-transform: uppercase;
  line-height: 1.6;
}
.starred-empty span { display: block; font-family: var(--mono); font-size: 0.75rem;
  letter-spacing: 1px; color: #aaa; margin-top: 8px; text-transform: none; }

/* ── SECTION HEADERS ─────────────────────────────────────── */
.section-head {
  font-family: var(--display); font-size: 1.4rem; letter-spacing: 4px;
  text-transform: uppercase; padding: 28px 0 10px; color: var(--ink);
  display: flex; align-items: center; gap: 12px;
}
.section-head::after { content: ''; flex: 1; height: 2px; background: var(--yellow); }
.section-head .sh-count {
  font-family: var(--mono); font-size: 0.68rem; color: #aaa; font-weight: 400; letter-spacing: 1px;
}

/* ── STYLE ROWS ──────────────────────────────────────────── */
.style-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px; margin: 0 -10px;
  border-bottom: 1px solid var(--gray2);
  transition: background 0.1s, border-color 0.1s;
}
.style-row:hover { background: var(--row-h); border-bottom-color: var(--yellow); }
.style-row:last-child { border-bottom: none; }

.sn {
  width: 140px; flex-shrink: 0;
  font-size: 0.66rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.4px; color: #aaa; line-height: 1.4;
}
.st {
  flex: 1; min-width: 0;
  font-size: 1.05rem; line-height: 1.55;
  word-break: break-all; overflow-wrap: anywhere; color: var(--ink);
}
.st.empty { color: #ccc; font-style: italic; font-size: 0.82rem; }

/* Favorite star */
.fav-btn {
  flex-shrink: 0; width: 32px; height: 44px;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: #ddd;
  transition: color 0.15s, transform 0.15s;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.fav-btn:hover  { color: var(--yellow); transform: scale(1.2); }
.fav-btn.starred { color: var(--yellow); }

/* Copy button */
.copy-btn {
  flex-shrink: 0; min-width: 64px; height: 44px;
  padding: 0 14px; font-family: var(--display);
  font-size: 0.95rem; letter-spacing: 1px;
  background: var(--ink); color: #fff;
  border: 2px solid var(--ink); cursor: pointer;
  transition: all 0.15s; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
}
.copy-btn:hover  { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.copy-btn.ok     { background: var(--green); border-color: var(--green); color: #fff; }
.copy-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Sidebar ad */
.sidebar { width: 160px; flex-shrink: 0; padding-top: 28px; }
.sidebar-ad-block {
  position: sticky; top: 80px;
  background: var(--gray); border: 2px dashed var(--gray2);
  height: 600px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  font-size: 0.62rem; color: var(--gray3);
  text-transform: uppercase; letter-spacing: 1.5px; text-align: center;
}
.sidebar-ad-block::before { content: '📢'; font-size: 2rem; opacity: 0.25; }

.no-results-msg {
  text-align: center; padding: 60px 20px;
  font-family: var(--display); font-size: 1.5rem;
  color: var(--gray2); letter-spacing: 4px; text-transform: uppercase;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 860px) { .sidebar { display: none; } }
@media (max-width: 700px) {
  .cat-btn { padding: 10px 11px; font-size: 0.84rem; }
}
@media (max-width: 600px) {
  .sn { width: 88px; font-size: 0.6rem; }
  .st { font-size: 0.88rem; }
  .copy-btn { min-width: 50px; font-size: 0.82rem; }
  .section-head { font-size: 1.15rem; }
  .fav-btn { width: 26px; }
  .cat-btn { padding: 9px 10px; font-size: 0.8rem; }
  .input-actions { flex-direction: row; }
  .btn-clear { flex: 1; min-height: 44px; }
  .multiline-toggle { flex: 1; }
}
