/* GeoCover Symbol Catalog Styles */

:root {
    --primary-color: #007acc;
    --primary-light: #e8f4fc;
    --primary-hover: #005a9e;
    --text-color: #333;
    --text-muted: #666;
    --bg-color: #f5f5f5;
    --card-bg: white;
    --border-color: #ddd;
    --warning-bg: #fff3cd;
    --warning-text: #856404;
    --success-color: #28a745;
    --error-color: #dc3545;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 20px;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* Typography */
h1 {
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-top: 0;
}

h2 {
    color: var(--primary-color);
    margin-top: 30px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, .monospace {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Layout Components */
.stats {
    background: var(--primary-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.toc {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.toc strong {
    margin-right: 8px;
}

.toc a {
    padding: 4px 8px;
    background: #f0f7ff;
    border-radius: 4px;
    font-size: 0.9em;
}

.toc a:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.toc a.current {
    background: var(--primary-color);
    color: white;
}

.back-link {
    margin-bottom: 15px;
}

/* Symbol Grid */
.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.symbol-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.symbol-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.symbol-card img {
    width: 100%;
    height: auto;
    display: block;
}

.symbol-info {
    padding: 12px;
}

.symbol-name {
    font-weight: bold;
    color: var(--text-color);
    word-break: break-word;
    font-size: 0.7em;
}

.symbol-label {
    font-size: 0.7em;
    color: #555;
    margin-top: 3px;
    font-style: italic;
    word-break: break-word;
}

.symbol-meta {
    font-size: 0.7em;
    color: var(--text-muted);
    margin-top: 8px;
}

.symbol-meta a {
    color: var(--primary-color);
}

.missing {
    background: var(--warning-bg);
    color: var(--warning-text);
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* Search Box */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    padding: 10px 15px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
}

.pagination a {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

.pagination .disabled {
    color: #999;
    background: var(--bg-color);
}

/* Tables */
.layer-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.layer-table thead tr {
    background: var(--primary-color);
    color: white;
}

.layer-table th,
.layer-table td {
    padding: 12px;
    text-align: left;
}

.layer-table th:last-child,
.layer-table td:last-child {
    text-align: right;
}

.layer-table tbody tr {
    border-bottom: 1px solid #eee;
}

.layer-table tbody tr:hover {
    background: #f8f9fa;
}

.layer-table a {
    font-weight: bold;
}

/* Layer Groups */
.layer-group {
    margin-bottom: 30px;
}

.layer-group h3 {
    color: var(--text-muted);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .symbol-grid {
        grid-template-columns: 1fr;
    }

    .toc {
        flex-direction: column;
        align-items: flex-start;
    }
}

.feature-info { margin-top: 6px; font-size: 0.82em; }
.feature-info summary { cursor: pointer; color: #555; }
.fi-table { border-collapse: collapse; width: 100%; }
.fi-table th { text-align: left; color: #666; padding: 2px 8px 2px 0;
               white-space: nowrap; font-weight: normal; }
.fi-table td { padding: 2px 4px; color: #222; word-break: break-word; }
.fi-table tr:nth-child(even) td { background: #f5f5f5; }

/* ---- catalog-wide search (catalog_search.js) ---- */
.global-search { margin: 14px 0 18px; }
.global-search input {
    width: 100%; max-width: 640px; padding: 10px 12px; font-size: 1.05em;
    border: 2px solid #c00; border-radius: 4px; box-sizing: border-box;
}
.global-search .hint { font-size: 0.8em; color: #777; margin-top: 4px; }
#catalog-results.has-results { margin-top: 10px; padding: 8px 10px; background: #fafafa;
    border: 1px solid #ddd; border-radius: 4px; }
.sr-summary { margin-bottom: 8px; line-height: 1.9; }
.sr-layer { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 10px;
    background: #c00; color: #fff !important; text-decoration: none; font-size: 0.88em; }
.sr-list { list-style: none; margin: 0; padding: 0; }
.sr-list li { border-bottom: 1px solid #eee; }
.sr-link { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 5px 4px;
    text-decoration: none; color: #222; }
.sr-link:hover, .sr-first .sr-link { background: #fff3f3; }
.sr-layer-tag { min-width: 150px; font-family: monospace; font-size: 0.85em; color: #c00; }
.sr-label { font-weight: 600; }
.sr-symbol { font-family: monospace; font-size: 0.78em; color: #777; }
.sr-count, .sr-via { font-size: 0.78em; color: #888; }
.sr-weak .sr-label { font-weight: normal; }
.sr-none { color: #777; padding: 6px 2px; }
mark { background: #ffe58a; padding: 0; }
.symbol-card:target { outline: 3px solid #c00; box-shadow: 0 0 10px rgba(204, 0, 0, .4); }
