/* Code Minifier & Beautifier - tool-specific styles (scoped with cm- prefix)
   Accent color for this tool: var(--site-light) (used only within cm- scoped classes,
   never overriding the global site header/title-bar). */

.cm-card { padding: 28px; }
.cm-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.cm-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; }

.cm-body { display: flex; flex-direction: column; gap: 18px; }

/* ===== Language selector pills ===== */
.cm-lang-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cm-lang-label { font-weight: 700; font-size: .88em; color: #23272f; }
.cm-lang-group { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-lang-pill { position: relative; display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 20px; padding: 7px 16px; font-size: .88em; font-weight: 600; color: #23272f; cursor: pointer; background: #f7f8fa; transition: background .15s ease, border-color .15s ease, color .15s ease; user-select: none; }
.cm-lang-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.cm-lang-pill:hover { border-color: var(--site-light); }
.cm-lang-pill:has(input:checked) { background: var(--site-light); border-color: var(--site-light); color: #fff; }

/* ===== Input/output panes ===== */
.cm-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cm-pane label { display: block; font-weight: 600; font-size: .88em; margin-bottom: 8px; color: #23272f; }
.cm-pane textarea { width: 100%; min-height: 260px; box-sizing: border-box; border: 1px solid #ddd; border-radius: 8px; padding: 12px 14px; font-family: "Courier New", monospace; font-size: .88em; line-height: 1.55; resize: vertical; color: #23272f; background: #fafbfc; }
.cm-pane textarea:focus { outline: none; border-color: var(--site-light); box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); background: #fff; }
#cmOutput { background: #f7f8fa; color: #23272f; }
#cmOutput::placeholder { color: #9aa0aa; }

.cm-output-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cm-output-label-row label { margin-bottom: 0; }
.cm-copy-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #ddd; border-radius: 8px; background: #fff; color: #23272f; padding: 6px 12px; font-size: .82em; font-weight: 600; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.cm-copy-btn:hover { background: var(--site-light); border-color: var(--site-light); color: #fff; }
.cm-copy-btn.cm-copied { background: var(--site-success); border-color: var(--site-success); color: #fff; }
.cm-copied { font-size: .82em; color: var(--site-success); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* ===== Action buttons ===== */
.cm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cm-minify-btn, .cm-beautify-btn, .cm-clear-btn { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 10px; padding: 11px 22px; font-size: .92em; font-weight: 700; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.cm-minify-btn { background: linear-gradient(135deg, var(--site-light), var(--site-success)); color: #fff; }
.cm-minify-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(101, 163, 13, .3); }
.cm-beautify-btn { background: #fff; color: var(--site-success); border: 1px solid var(--site-light); }
.cm-beautify-btn:hover { background: #f2f8e8; }
.cm-clear-btn { background: none; color: #6b7280; border: 1px solid #ddd; }
.cm-clear-btn:hover { background: #f5f5f5; }
.cm-stats { margin-left: auto; font-size: .82em; font-weight: 700; color: var(--site-success); background: #f2f8e8; border-radius: 20px; padding: 6px 14px; }

@media (max-width: 760px) {
    .cm-panes { grid-template-columns: 1fr; }
    .cm-stats { margin-left: 0; }
}

@media (max-width: 600px) {
    .cm-title-bar { margin: -20px -20px 20px; padding: 16px 18px; }
    .cm-pane textarea { min-height: 200px; }
}
