/* =============================================================================
   Layer Symbology Modal
   Namespace: .lsym-*
   ============================================================================= */

.lsym-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lsym-overlay.hidden {
    display: none !important;
}

.lsym-modal {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

/* ----- Header ----- */
.lsym-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.lsym-modal-header-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.lsym-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.lsym-title-row h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.lsym-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    background: #e1f5ee;
    color: #0f6e56;
    text-transform: lowercase;
    white-space: nowrap;
}

.lsym-meta {
    color: #4b5563;
    font-size: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lsym-meta-sep {
    color: #9ca3af;
}

.lsym-close-x {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    flex-shrink: 0;
}

.lsym-close-x:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ----- Body (scrollable) ----- */
.lsym-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
}

/* ----- Footer ----- */
.lsym-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.lsym-footer button {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: transparent;
    color: #111827;
    font-size: 13px;
    cursor: pointer;
}

.lsym-footer button:hover {
    background: #f9fafb;
}

.lsym-btn-primary {
    background: #111827 !important;
    color: #ffffff !important;
    border-color: #111827 !important;
}

.lsym-btn-primary:hover {
    opacity: 0.88;
}

/* ----- Field rows ----- */
.lsym-field-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lsym-label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

/* ----- Inputs ----- */
.lsym-select,
.lsym-input {
    width: 100%;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.lsym-select:focus,
.lsym-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.lsym-color-input {
    width: 48px;
    height: 34px;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: white;
    cursor: pointer;
}

.lsym-color-label {
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
}

/* ----- Range rows ----- */
.lsym-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lsym-range-row input[type="range"] {
    flex: 1;
    accent-color: #2563eb;
}

.lsym-range-row span {
    min-width: 42px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}

/* ----- Style card (inner box) ----- */
.lsym-style-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ----- Two-column row ----- */
.lsym-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ----- Colormap grid ----- */
.lsym-colormap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lsym-cm-option {
    border: 1.5px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: white;
    padding: 2px;
}

.lsym-cm-option.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.lsym-cm-option canvas {
    display: block;
    width: 100%;
    height: 22px;
    border-radius: 6px;
}

/* ----- Categorical palette list ----- */
.lsym-palette-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lsym-palette-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    background: white;
}

.lsym-palette-row.active {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.04);
}

.lsym-palette-name {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

.lsym-palette-swatches {
    display: flex;
    gap: 4px;
}

.lsym-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ----- Preview area ----- */
.lsym-preview-area {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    min-height: 76px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ----- JSON output box ----- */
.lsym-json-box {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 160px;
    overflow-y: auto;
}

/* ----- Divider ----- */
.lsym-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2px 0;
}

/* ----- Responsive ----- */
@media (max-width: 640px) {
    .lsym-row2,
    .lsym-colormap-grid {
        grid-template-columns: 1fr;
    }

    .lsym-title-row h2 {
        max-width: 100%;
    }
}

/* =========================================================================
   Raster symbology - extra classes
   ========================================================================= */

/* Grid for raster colormap selection (similar to .lsym-colormap-grid but wider) */
.lrsym-cm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Small label below the strip */
.lrsym-cm-label {
    font-size: 10px;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 2px 0;
}

.lsym-cm-option:hover .lrsym-cm-label {
    color: #1e3a5f;
}

.lsym-cm-option.selected .lrsym-cm-label {
    color: #2563eb;
    font-weight: 600;
}
