/*
 * cipher-converter.css
 * Pages: converter-tools/cipher-and-encoding-tool.php
 * Purpose: The "cipher studio" workspace: a controls column (input card,
 *          sticky and scrollable on desktop like font-tester.css) and an
 *          output panel with a multi-select "Convert to" dropdown (the shared
 *          .dd-select widget from tool-input.css) and one labeled, copyable
 *          output field per selected format. Input and output textareas use
 *          the same text style as font-tester.css (.ft-sample-text).
 * Load order: loaded AFTER assets/css/tool-input.css via $extraCss; only adds
 *             scoped .cec-* classes, so it does not conflict with shared styles.
 */

/* ======================= Workspace layout ======================= */

.cec-workspace {
    background: #f5f7fa;
    border: 1px solid #e4ebf1;
    border-radius: 16px;
    padding: 24px 18px 14px;
    margin: 18px auto;
    box-shadow: 0 4px 20px rgba(15, 30, 42, 0.06);
    max-width: 1240px;
}

.cec-workspace-head {
    text-align: center;
    margin-bottom: 14px;
}

.cec-workspace-head p {
    margin-bottom: 0;
}

/* Live mode switch sits under the "Load an example" link, centered. */
.cec-live-row {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.cec-live-row .form-check {
    margin-bottom: 0;
}

.cec-live-row .form-check-label {
    font-weight: 400;
    color: #374151;
}

/* ======================= Cards (same language as font-tester.css) ======================= */

.cec-panel {
    background: #ffffff;
    border: 1px solid #e4ebf1;
    border-radius: 14px;
    padding: 15px 16px 13px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04), 0 1px 2px rgba(16, 24, 40, 0.03);
}

.cec-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f5;
}

.cec-ico {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e7f4ec;
    color: #168332;
    border-radius: 9px;
    font-size: 0.95rem;
}

.cec-panel-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #237a3a;
}

/* Field labels use the brand green so they stand out from the values. */
.cec-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #168332;
    margin: 12px 0 5px;
}

.cec-panel .form-select,
.cec-panel .form-control {
    border-color: #dfe6ed;
}

.cec-input {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #d6dde5;
    border-radius: 10px;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    resize: vertical;
    min-height: 230px;
}

.cec-input:focus {
    outline: none;
    border-color: #168332;
    box-shadow: 0 0 0 0.25rem rgba(27, 138, 67, 0.12);
}

/* ======================= Convert / Clear buttons ======================= */

.cec-actionbar {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.cec-actionbar .btn {
    flex: 1 1 0;
    min-width: 120px;
}

/* ======================= Output fields ======================= */

.cec-outputs {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cec-outputs-multi {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cec-out {
    border: 1px solid #eef2f5;
    border-radius: 10px;
    background: #fbfdfe;
    padding: 10px 12px 8px;
    min-width: 0;
}

.cec-out-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.cec-out-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #168332;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cec-out-title i {
    width: 16px;
}

.cec-out-copy {
    font-size: 0.78rem;
    color: #0d6efd;
    text-decoration: none;
    flex: 0 0 auto;
}

.cec-out-copy:hover {
    text-decoration: underline;
}

.cec-out-value {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #d6dde5;
    border-radius: 10px;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    resize: vertical;
    min-height: 273px;
}

.cec-out-value:focus {
    outline: none;
    border-color: #168332;
    box-shadow: 0 0 0 0.25rem rgba(27, 138, 67, 0.12);
}

/* Compact fields when several outputs are shown at once */
.cec-outputs-multi .cec-out-value {
    min-height: 110px;
    font-size: 0.98rem;
}

.cec-output-error {
    color: #b02a37;
    background: #fdf3f4;
}

/* Hint/warning text sits right-aligned below each output field */
.cec-out-note {
    margin: 5px 0 0;
    font-size: 0.72rem;
    color: #b45309;
    text-align: right;
}

.cec-no-options {
    margin: 4px 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.cec-all-actions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eef2f5;
}

/* Stats/hint line under the output panel, right-aligned */
.cec-stats {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #555;
    text-align: right;
}

.cec-hidden-copy {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ======================= Responsive ======================= */

/* Keep the settings column visible while scrolling the output on desktop */
@media (min-width: 992px) {
    .cec-controls {
        position: sticky;
        top: 12px;
        align-self: flex-start;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        padding-right: 6px;
    }
}

@media (max-width: 575.98px) {
    .cec-outputs-multi {
        grid-template-columns: 1fr;
    }
    .cec-workspace {
        padding: 18px 12px 14px;
    }
}
