/* =================================================================
   tools/classical-ciphers.css
   Auto-extracted from math.css (2026-05-11).
   Loaded via config/js-manifest.php → templates/partials/head-styles.php.
   ================================================================= */

/* ═══════════════════════════════════════════════════
   Classical Ciphers — visuals
   ═══════════════════════════════════════════════════ */

.math-cipher-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--math-border-light);
    margin-bottom: 14px;
}
.math-cipher-summary-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}
.math-cipher-summary-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--math-text-muted);
}
.math-cipher-summary-value {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--math-text);
    word-break: break-all;
    line-height: 1.4;
}
.math-cipher-summary-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.math-cipher-type-badge,
.math-cipher-mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.math-cipher-type-badge i,
.math-cipher-mode-chip i {
    font-size: 10px;
}
.math-cipher-type-badge[data-family="substitution"] {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.35);
}
.math-cipher-type-badge[data-family="polyalphabetic"] {
    background: rgba(236, 72, 153, 0.12);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.35);
}
.math-cipher-type-badge[data-family="stream"] {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}
.math-cipher-type-badge[data-family="other"] {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.35);
}
.math-cipher-mode-chip[data-mode="encode"] {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}
.math-cipher-mode-chip[data-mode="decode"] {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

.math-cipher-family-note {
    font-size: 12px;
    color: var(--math-text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}
.math-cipher-family-note:empty { display: none; }

.math-cipher-formula {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 8px;
    margin-bottom: 16px;
}
.math-cipher-formula:empty { display: none; }
.math-cipher-formula-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--math-text-muted);
}
.math-cipher-formula-code {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #a5b4fc;
}

.math-cipher-section {
    margin-bottom: 18px;
}
.math-cipher-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--math-text-muted);
    margin-bottom: 10px;
}
.math-cipher-section-title i {
    color: #a5b4fc;
}

/* ─── Caesar / ROT13 alphabet mapping ─── */
.math-cipher-viz {
    overflow-x: auto;
    padding-bottom: 4px;
}
.math-cipher-alpha-block {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
}
.math-cipher-alpha-rowlabel {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--math-text-muted);
    min-width: 50px;
    text-align: right;
}
.math-cipher-alpha-row {
    display: flex;
    gap: 3px;
}
.math-cipher-alpha-cell {
    width: 26px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
}
.math-cipher-alpha-cell.is-plain {
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    border-color: rgba(99, 102, 241, 0.3);
}
.math-cipher-alpha-cell.is-cipher {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.3);
}
.math-cipher-alpha-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0;
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 700;
    margin-left: 58px;
}
.math-cipher-alpha-arrow i {
    font-size: 14px;
}
.math-cipher-alpha-arrow-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--math-text-muted);
}
.math-cipher-alpha-note {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--math-border-light);
    border-radius: 6px;
    font-size: 11px;
    color: var(--math-text-muted);
    line-height: 1.5;
}
.math-cipher-alpha-note i {
    color: #818cf8;
    margin-right: 4px;
}

/* ─── Vigenère alignment table ─── */
.math-cipher-vig-table {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    align-items: center;
    min-width: max-content;
}
.math-cipher-vig-rowlabel {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--math-text-muted);
    text-align: right;
    white-space: nowrap;
}
.math-cipher-vig-row {
    display: flex;
    gap: 3px;
}
.math-cipher-vig-cell {
    min-width: 28px;
    padding: 4px 2px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid transparent;
}
.math-cipher-vig-cell.is-plain {
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    border-color: rgba(99, 102, 241, 0.3);
}
.math-cipher-vig-cell.is-key {
    background: rgba(236, 72, 153, 0.15);
    color: #fbcfe8;
    border-color: rgba(236, 72, 153, 0.3);
}
.math-cipher-vig-cell.is-cipher {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.3);
}
.math-cipher-vig-cell.is-skip {
    background: rgba(255, 255, 255, 0.03);
    color: var(--math-text-muted);
    border-color: rgba(255, 255, 255, 0.08);
}
.math-cipher-vig-ch {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
}
.math-cipher-vig-sub {
    font-size: 9px;
    opacity: 0.7;
}

/* ─── XOR byte visualization ─── */
.math-cipher-xor-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.math-cipher-xor-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--math-border-light);
    border-radius: 8px;
    min-width: 88px;
}
.math-cipher-xor-cell {
    width: 100%;
    padding: 5px 6px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    border: 1px solid transparent;
}
.math-cipher-xor-cell.is-plain {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}
.math-cipher-xor-cell.is-key {
    background: rgba(236, 72, 153, 0.12);
    border-color: rgba(236, 72, 153, 0.3);
}
.math-cipher-xor-cell.is-result {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}
.math-cipher-xor-cell-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--math-text-muted);
}
.math-cipher-xor-cell-hex {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--math-text);
}
.math-cipher-xor-cell-bin {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--math-text-muted);
}
.math-cipher-xor-op {
    font-size: 14px;
    font-weight: 800;
    color: #a5b4fc;
    padding: 1px 0;
}
.math-cipher-xor-more {
    margin-top: 8px;
    font-size: 11px;
    color: var(--math-text-muted);
    font-style: italic;
}

/* ─── Per-char / per-byte mapping table ─── */
.math-cipher-map-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
.math-cipher-map-table th {
    text-align: left;
    padding: 6px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--math-text-muted);
    border-bottom: 1px solid var(--math-border-light);
}
.math-cipher-map-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.math-cipher-map-pos {
    width: 40px;
    color: var(--math-text-muted);
    font-size: 11px;
}
.math-cipher-map-plain { color: #c7d2fe; font-weight: 700; }
.math-cipher-map-key   { color: #fbcfe8; font-weight: 700; }
.math-cipher-map-cipher { color: #a7f3d0; font-weight: 700; }
.math-cipher-map-calc {
    font-size: 11px;
    color: var(--math-text);
}
.math-cipher-map-calc code {
    font-size: 10px;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 4px;
    border-radius: 3px;
}
.math-cipher-map-idx {
    margin-left: 6px;
    font-size: 9px;
    opacity: 0.6;
    font-weight: 500;
}
.math-cipher-map-more {
    margin-top: 6px;
    font-size: 11px;
    color: var(--math-text-muted);
    font-style: italic;
}

.math-cipher-map-table.is-xor td {
    font-size: 11px;
}

/* Mobile */
@media (max-width: 640px) {
    .math-cipher-summary-value {
        font-size: 15px;
    }
    .math-cipher-alpha-cell {
        width: 22px;
        height: 28px;
        font-size: 11px;
    }
    .math-cipher-alpha-rowlabel,
    .math-cipher-vig-rowlabel {
        min-width: 40px;
        font-size: 9px;
    }
    .math-cipher-alpha-arrow {
        margin-left: 48px;
    }
    .math-cipher-vig-cell {
        min-width: 24px;
    }
    .math-cipher-vig-ch { font-size: 11px; }
    .math-cipher-vig-sub { font-size: 8px; }
    .math-cipher-xor-col {
        min-width: 78px;
        padding: 6px;
    }
    .math-cipher-xor-cell-hex { font-size: 12px; }
    .math-cipher-xor-cell-bin { font-size: 9px; }
    .math-cipher-map-table { font-size: 11px; }
    .math-cipher-map-table th,
    .math-cipher-map-table td { padding: 5px 6px; }
}

