﻿/* ============================================================
   MAPXER Portal — AppConfig Editor Styles
   Include via _Host.cshtml or add @import to portal.css
   ============================================================ */

/* ── Section cards ─────────────────────────────────────────────────────────── */
.ac-section {
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ac-section-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 24px;
    background: #f7f9fc;
    border-bottom: 1px solid #dde3ec;
}

.ac-section-icon {
    font-size: 22px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

.ac-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e2a3a;
    margin-bottom: 2px;
}

.ac-section-sub {
    font-size: 12px;
    color: #6b7c93;
    line-height: 1.5;
}

.ac-section-body {
    padding: 20px 24px;
}

/* ── Form grids ────────────────────────────────────────────────────────────── */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ── Hints ─────────────────────────────────────────────────────────────────── */
.hint {
    font-size: 11px;
    color: #9aabbd;
    font-weight: 400;
    margin-left: 4px;
}

code.token-hint {
    background: #eef2f8;
    color: #3a6bc8;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* ── File path bar ─────────────────────────────────────────────────────────── */
.appconfig-filepath {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.filepath-ok {
    font-size: 12px;
    color: #3b6d11;
    background: #eaf3de;
    border: 1px solid #b8dba0;
    padding: 2px 10px;
    border-radius: 20px;
    font-family: monospace;
}

.filepath-missing {
    font-size: 12px;
    color: #a32d2d;
    background: #fdecea;
    border: 1px solid #f5c6c6;
    padding: 2px 10px;
    border-radius: 20px;
}

.filepath-meta {
    font-size: 12px;
    color: #9aabbd;
}

/* ── Template blocks ───────────────────────────────────────────────────────── */
.template-block {
    background: #f7f9fc;
    border: 1px solid #dde3ec;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

    .template-block:last-child {
        margin-bottom: 0;
    }

.template-block-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.template-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.template-block-label strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #1e2a3a;
    margin-bottom: 2px;
}

.template-block-label .hint {
    display: block;
    margin-left: 0;
    font-size: 11px;
    color: #9aabbd;
}

.template-textarea {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #fff;
    color: #1e2a3a;
}

.template-preview-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aabbd;
    margin: 10px 0 6px;
}

/* ── Preview containers ────────────────────────────────────────────────────── */
.template-preview {
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #333;
    min-height: 36px;
    line-height: 1.6;
}

/* Info window title — bold, slightly larger */
.template-preview-title {
    font-weight: 700;
    font-size: 14px;
    border-left: 3px solid #4a90e2;
    padding-left: 12px;
}

/* List card — mimics the rowBox style */
.template-preview-card {
    background: #f9f9f9;
    border-left: 3px solid #27ae60;
    padding-left: 12px;
}

/* Detail panel — mimics the slide-in panel */
.template-preview-detail {
    background: #fff;
    border-left: 3px solid #9b59b6;
    padding-left: 12px;
    max-height: 150px;
    overflow-y: auto;
}

/* Unresolved token highlight */
.token-unresolved {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 11px;
    font-family: monospace;
}

/* ── Column table ──────────────────────────────────────────────────────────── */
.ac-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

    .ac-table thead th {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #6b7c93;
        padding: 8px 10px;
        border-bottom: 2px solid #dde3ec;
        text-align: left;
    }

    .ac-table tbody tr:hover {
        background: #f7f9fc;
    }

    .ac-table tbody td {
        padding: 6px 8px;
        border-bottom: 1px solid #eef1f5;
        vertical-align: middle;
    }

.ac-input {
    width: 100%;
    border: 1px solid #dde3ec;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 13px;
    color: #1e2a3a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

    .ac-input:focus {
        border-color: #4a90e2;
        box-shadow: 0 0 0 2px rgba(74,144,226,0.12);
    }

.btn-remove {
    background: none;
    border: 1px solid #e0c4c4;
    color: #c0392b;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-remove:hover {
        background: #fdecea;
    }

.btn-add-row {
    background: none;
    border: 1px dashed #9aabbd;
    color: #4a90e2;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
    transition: background 0.15s, border-color 0.15s;
}

    .btn-add-row:hover {
        background: #eef2f8;
        border-color: #4a90e2;
    }

/* ── Filter cards ──────────────────────────────────────────────────────────── */
.filter-card {
    border: 1px solid #dde3ec;
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
    background: #fff;
}

.filter-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f7f9fc;
    border-bottom: 1px solid #dde3ec;
}

.filter-card-title {
    font-size: 13px;
    color: #1e2a3a;
}

.filter-card-body {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

.filter-col-map {
    grid-column: 1 / -1;
}

/* Filter type badges */
.filter-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    flex-shrink: 0;
}

.filter-badge-text {
    background: #e8f0fe;
    color: #3a6bc8;
}

.filter-badge-dropdown {
    background: #e8f8f0;
    color: #1e7d4a;
}

.filter-badge-checkbox {
    background: #f5eefe;
    color: #7c3aed;
}

/* Column chips */
.col-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.col-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid #dde3ec;
    border-radius: 20px;
    font-size: 12px;
    color: #4a6080;
    background: #f7f9fc;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}

    .col-chip input[type=checkbox] {
        width: 12px;
        height: 12px;
        margin: 0;
        cursor: pointer;
    }

    .col-chip:hover {
        background: #eef2f8;
        border-color: #9aabbd;
    }

.col-chip-on {
    background: #e8f0fe;
    border-color: #4a90e2;
    color: #3a6bc8;
    font-weight: 600;
}

/* Filter add strip */
.filter-add-strip {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-add-filter {
    flex: 1;
    padding: 8px 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px dashed;
    transition: background 0.15s;
}

.btn-add-text {
    border-color: #4a90e2;
    color: #3a6bc8;
    background: none;
}

.btn-add-dropdown {
    border-color: #27ae60;
    color: #1e7d4a;
    background: none;
}

.btn-add-checkbox {
    border-color: #9b59b6;
    color: #7c3aed;
    background: none;
}

.btn-add-text:hover {
    background: #e8f0fe;
}

.btn-add-dropdown:hover {
    background: #e8f8f0;
}

.btn-add-checkbox:hover {
    background: #f5eefe;
}

/* ── Save bar ───────────────────────────────────────────────────────────────── */
.ac-save-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 10px;
    margin-bottom: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.btn-save-large {
    padding: 10px 28px;
    font-size: 14px;
    white-space: nowrap;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .form-grid-2,
    .form-grid-3,
    .filter-card-body {
        grid-template-columns: 1fr;
    }

    .filter-col-map {
        grid-column: 1;
    }

    .filter-add-strip {
        flex-direction: column;
    }

    .ac-save-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
