/* MapTrax v2.4.1.3 - Quarter Editor Styles */

.quarter-grid {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 3px;
    margin-bottom: 6px;
    justify-content: center;
}

.quarter-btn {
    padding: 4px 8px;
    background: #0066cc;
    color: white;
    border: 1px solid #0052a3;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s;
    min-width: 45px;
    text-align: center;
}

.quarter-btn:hover {
    background: #0052a3;
    border-color: #003d7a;
}

.quarter-btn.selected {
    background: #00CED1;
    border-color: #008B8B;
    color: white;
}

.acres-display {
    background: #f8f9fa;
    padding: 6px;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.acres-input-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.acres-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    background: #f8f9fa;
}

.acres-input:focus {
    outline: none;
    border-color: #00CED1;
    background: #fff;
}

.acres-input.modified {
    background: #fff3cd;
    border-color: #ffc107;
}

.refresh-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #17a2b8;
    border-radius: 4px;
    background: #17a2b8;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #138496;
    border-color: #117a8b;
}

.legal-description {
    background: #fff3cd;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ffc107;
    margin-bottom: 6px;
    min-height: 24px;
    font-family: monospace;
    font-size: 11px;
}

.breadcrumb-display {
    background: #e7f3ff;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #2196F3;
    min-height: 22px;
    font-size: 10px;
    color: #555;
}

.breadcrumb-item {
    display: inline-block;
    padding: 3px 8px;
    background: white;
    border-radius: 3px;
    margin-right: 5px;
    margin-bottom: 3px;
}

/* Live Preview Panel */
.preview-container {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

#preview-svg {
    width: 100%;
    height: 180px;
    display: block;
}

.preview-bg {
    fill: #fafafa;
}

.tract-outline {
    fill: rgba(200, 200, 200, 0.2);
    stroke: #666;
    stroke-width: 2;
}

.division-line {
    stroke: #999;
    stroke-width: 1;
    stroke-dasharray: 4, 2;
}

.selected-area {
    fill: rgba(0, 206, 209, 0.4);
    stroke: #008B8B;
    stroke-width: 2;
}

.less-area {
    fill: url(#less-hatch);
    stroke: #dc3545;
    stroke-width: 1;
}

.manual-part {
    fill: rgba(40, 167, 69, 0.3);
    stroke: #28a745;
    stroke-width: 1.5;
}

.corner-label {
    font-size: 9px;
    fill: #666;
    font-family: sans-serif;
}

/* Stacked Tract Navigation Bar */
.stacked-nav-bar {
    background: #f0f7ff;
    border: 1px solid #b8d4f0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.stacked-nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 4px;
}
.stacked-nav-arrow {
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stacked-nav-arrow:hover { background: #0052a3; }
.stacked-nav-arrow:disabled { background: #ccc; cursor: default; }
.stacked-nav-label {
    font-weight: 600;
    font-size: 13px;
}
.stacked-nav-info {
    font-size: 11px;
    color: #555;
    text-align: center;
    margin-bottom: 4px;
    min-height: 14px;
}
.stacked-nav-actions {
    display: flex;
    justify-content: center;
}
.stacked-nav-delete {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
}
.stacked-nav-delete:hover {
    background: #dc3545;
    color: white;
}

/* v2.10.3.0 — Manual-override controls for Legal Description + Base Acres.
   Pencil ✏️ button reveals an editable input; ↺ Reset clears the override
   and restores the auto-generated/calculated value. Visual indicator
   matches what v2.11.0.0 will use in the attribute table for consistency. */
.legal-desc-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legal-desc-row #legal-desc {
    flex: 1;
}

.base-acres-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.base-acres-row #base-acres {
    flex: 1;
}

/* Active override visual — italic + faint accent tint + accent border. */
.qc-override-active {
    font-style: italic;
    background: rgba(185, 108, 40, 0.08);
    border-color: #b96c28 !important;
}

/* Pencil button — visible when no override is active. */
.qc-override-edit {
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    font-size: 13px;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.qc-override-edit:hover {
    background: #f5efe8;
    color: #b96c28;
    border-color: #d4c5b0;
}

/* Reset button — visible when override IS active. */
.qc-override-reset {
    background: transparent;
    border: 1px solid #d4c5b0;
    color: #b96c28;
    font-size: 13px;
    padding: 1px 8px;
    cursor: pointer;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background 0.12s;
}

.qc-override-reset:hover {
    background: #fdf2e6;
}

/* Override input (legal description edit) — italic + accent. */
.qc-override-input {
    flex: 1;
    font-style: italic;
    font-size: 14px;
    padding: 4px 6px;
    border: 1px solid #b96c28;
    border-radius: 3px;
    background: rgba(185, 108, 40, 0.06);
}

.qc-override-input:focus {
    outline: none;
    border-color: #9a5820;
    background: rgba(185, 108, 40, 0.10);
}

/* v2.13.2.31 — Snap / Restore / Delete action row in the Quarter Call editor.
   Lives below the existing Apply / Cancel / Back / Reset / Undo / Pick-Edge
   rows so destructive + cross-grid actions stay visually separated from
   per-edit controls. */
.qe-snap-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}

.qe-btn-snap {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #2a7ab8;
    border-radius: 4px;
    color: #1c5b8c;
    font-size: 12px;
    cursor: pointer;
}

.qe-btn-snap:hover:not(:disabled) {
    background: #eaf3fb;
    color: #154867;
    border-color: #1c5b8c;
}

.qe-btn-snap:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.qe-btn-restore {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #888;
    border-radius: 4px;
    color: #555;
    font-size: 12px;
    cursor: pointer;
}

.qe-btn-restore:hover {
    background: #f4f4f4;
    color: #333;
    border-color: #555;
}

/* Reuse the M&B-style danger pattern locally so quarter-editor.css can stand
   on its own without depending on metes-bounds-editor.css load order. */
.qe-btn-danger {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #c44;
    border-radius: 4px;
    color: #a33;
    font-size: 12px;
    cursor: pointer;
}

.qe-btn-danger:hover {
    background: #fbeaea;
    color: #800;
    border-color: #800;
}

/* Pending-snap banner — appears above the action row while a snap is awaiting
   user confirmation, so the temporary on-map state is unmistakable. */
.qe-snap-banner {
    background: #fff8e1;
    border: 1px solid #d9a33b;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

.qe-snap-banner-text {
    color: #6b4f0c;
    margin-bottom: 6px;
}

.qe-snap-banner-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.qe-btn-apply {
    padding: 5px 12px;
    background: #2a8a3a;
    border: 1px solid #226e2e;
    border-radius: 4px;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.qe-btn-apply:hover {
    background: #226e2e;
}

.qe-btn-cancel {
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #888;
    border-radius: 4px;
    color: #555;
    font-size: 12px;
    cursor: pointer;
}

.qe-btn-cancel:hover {
    background: #f4f4f4;
    color: #333;
    border-color: #555;
}
