/* ==========================================================================
   USGN Menu Analyzer - styles

   Deployed per-client at:  /vol1/<client>/css/menu_analyzer.css
   Paired JS lives at:      /vol1/<client>/js/menu_analyzer.js
   Include in the footer template with, e.g.:
     <link rel="stylesheet" href="/vol1/<client>/css/menu_analyzer.css">

   Namespaced under .usgn-ma- so nothing here collides with build_menu.cgi's
   existing styles. Written as a self-contained "bootstrap-look" modal so it
   renders correctly whether or not real Bootstrap CSS/JS is loaded on this
   page (build_menu.cgi is a legacy CGI screen and we can't assume either).
   This file is purely cosmetic - menu_analyzer.js works even if this
   stylesheet fails to load, it will just render unstyled.
   ========================================================================== */

.usgn-ma-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: none;
}
.usgn-ma-backdrop.usgn-ma-open { display: block; }

.usgn-ma-modal {
    position: fixed;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1100px;
    max-height: 94vh;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.35);
    z-index: 100001;
    display: none;
    flex-direction: column;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #333;
}
.usgn-ma-modal.usgn-ma-open { display: flex; }

.usgn-ma-header {
    padding: 12px 18px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7f7f9;
    border-radius: 6px 6px 0 0;
}
.usgn-ma-header h4 { margin: 0; font-size: 17px; }
.usgn-ma-close {
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: #888;
    padding: 0 4px;
}
.usgn-ma-close:hover { color: #000; }

.usgn-ma-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.usgn-ma-help {
    cursor: pointer;
    border: 1px solid #ccc;
    background: #fff;
    color: #555;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.usgn-ma-help:hover { background: #f0f0f0; color: #000; }

.usgn-ma-body {
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.usgn-ma-footer {
    padding: 10px 18px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #f7f7f9;
    border-radius: 0 0 6px 6px;
}

.usgn-ma-btn {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}
.usgn-ma-btn:hover { background: #f0f0f0; }
.usgn-ma-btn-primary { background: #337ab7; border-color: #2e6da4; color: #fff; }
.usgn-ma-btn-primary:hover { background: #2e6da4; }

.usgn-ma-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.usgn-ma-card {
    flex: 1 1 120px;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 8px 10px;
    text-align: center;
    background: #fafafa;
}
.usgn-ma-card .usgn-ma-card-num { font-size: 20px; font-weight: bold; display: block; }
.usgn-ma-card .usgn-ma-card-label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: .03em; }
.usgn-ma-card.err .usgn-ma-card-num { color: #b30000; }
.usgn-ma-card.warn .usgn-ma-card-num { color: #a06a00; }
.usgn-ma-card.info .usgn-ma-card-num { color: #1f5fa8; }

.usgn-ma-section-title {
    font-size: 14px;
    font-weight: bold;
    margin: 16px 0 6px;
}

.usgn-ma-cat-table, .usgn-ma-issue-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 4px;
}
.usgn-ma-cat-table th, .usgn-ma-cat-table td,
.usgn-ma-issue-table th, .usgn-ma-issue-table td {
    border: 1px solid #e2e2e2;
    padding: 5px 7px;
    text-align: left;
    vertical-align: top;
}
.usgn-ma-cat-table th, .usgn-ma-issue-table th {
    background: #f2f2f2;
    position: sticky;
    top: 0;
}
.usgn-ma-issue-table tr:nth-child(even) { background: #fbfbfb; }
.usgn-ma-issue-table .usgn-ma-loc { color: #555; font-size: 12px; }
.usgn-ma-issue-table .usgn-ma-link { font-family: Consolas, Menlo, monospace; font-size: 11px; word-break: break-all; color: #555; }
.usgn-ma-issue-table .usgn-ma-detail { font-size: 12px; color: #444; }

.usgn-ma-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}
.usgn-ma-badge-error { background: #c9302c; }
.usgn-ma-badge-warning { background: #c99a00; }
.usgn-ma-badge-info { background: #337ab7; }

.usgn-ma-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.usgn-ma-toolbar input[type="text"] {
    flex: 1 1 200px;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 160px;
}
.usgn-ma-filter-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}
.usgn-ma-filter-btn.usgn-ma-active { background: #333; color: #fff; border-color: #333; }

.usgn-ma-empty-state {
    padding: 30px 10px;
    text-align: center;
    color: #666;
}
.usgn-ma-error-state {
    padding: 14px;
    background: #fdecea;
    border: 1px solid #f5c2c0;
    border-radius: 4px;
    color: #7a1f1a;
}
