/* ── Tool tabs ─────────────────────────────────────────── */
.tool-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 14px;
    margin-bottom: 14px;
}
.tool-tab {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}
.tool-tab:hover { background: #30363d; }
.tool-tab.active {
    background: #161b22;
    border-color: #58a6ff;
    color: #58a6ff;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── File input ───────────────────────────────────────── */
.file-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.file-input-wrap input[type="file"] {
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
}
.file-input-wrap input[type="file"]::file-selector-button {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 4px 10px;
    margin-right: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
}
.file-input-wrap input[type="file"]::file-selector-button:hover {
    background: #30363d;
}
.file-info {
    color: #8b949e;
    font-size: 0.78rem;
}

/* ── Parameter inputs ─────────────────────────────────── */
.param-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.param-group label {
    color: #8b949e;
    font-size: 0.78rem;
    white-space: nowrap;
}
.param-group input[type="number"] {
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 4px 8px;
    width: 70px;
    font-size: 0.82rem;
    font-family: inherit;
}

/* ── Events list ──────────────────────────────────────── */
.events-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: #0d1117;
}
.events-list-item {
    padding: 8px 12px;
    font-size: 0.78rem;
    color: #c9d1d9;
    cursor: pointer;
    border-bottom: 1px solid #21262d;
    transition: background 0.1s;
}
.events-list-item:last-child { border-bottom: none; }
.events-list-item:hover { background: #161b22; }
.events-list-item.selected {
    background: #161b22;
    border-left: 3px solid #58a6ff;
    padding-left: 9px;
}
.events-list-item .rank {
    color: #58a6ff;
    font-weight: 600;
    margin-right: 6px;
}
.events-list-item .intensity {
    color: #fbbf24;
    font-weight: 600;
}

/* ── Chart grids ──────────────────────────────────────── */
.chart-grid {
    display: grid;
    gap: 14px;
    margin-top: 12px;
    margin-bottom: 14px;
    transform: translateX(-36px);
}
.chart-grid-2x2 { grid-template-columns: 1fr 1fr; }
.chart-grid-1x2 { grid-template-columns: 1fr 1fr; }
.chart-grid .chart-cell {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 8px;
    min-height: 280px;
}

/* ── Stats display ────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px 12px;
}
.stat-card .stat-label {
    color: #8b949e;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.stat-card .stat-value {
    color: #c9d1d9;
    font-size: 1rem;
    font-weight: 600;
}
.stat-card .stat-value.highlight { color: #58a6ff; }
.stat-card .stat-sub {
    color: #8b949e;
    font-size: 0.7rem;
    margin-top: 2px;
}

/* ── IDF / data tables ────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    color: #c9d1d9;
}
.data-table th {
    background: #21262d;
    color: #8b949e;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #30363d;
}
.data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #21262d;
}
.data-table tr:hover td { background: rgba(88,166,255,0.04); }

/* ── Events grid layout ───────────────────────────────── */
.events-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
    margin-top: 12px;
}

/* ── Satellite map ────────────────────────────────────── */
.satellite-container {
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    height: 450px;
}
.satellite-container .leaflet-container {
    background: #0d1117;
}

/* ── Progress / processing ────────────────────────────── */
.processing-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13,17,23,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.processing-spinner {
    color: #58a6ff;
    font-size: 0.9rem;
    text-align: center;
}
.processing-spinner::before {
    content: '';
    display: block;
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    border: 3px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Export controls ──────────────────────────────────── */
.export-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

/* ── Tool cards on landing page ───────────────────────── */
.tool-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: #c9d1d9;
    transition: border-color 0.15s, transform 0.15s;
    display: block;
}
.tool-card:hover {
    border-color: #58a6ff;
    transform: translateY(-2px);
}
.tool-card h2 {
    color: #58a6ff;
    font-size: 1rem;
    margin: 0 0 8px 0;
    font-weight: 600;
}
.tool-card p {
    color: #8b949e;
    font-size: 0.82rem;
    margin: 0;
    line-height: 1.5;
}

/* ── Guide dropdown ──────────────────────────────────── */
.guide-dropdown {
    position: fixed;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 6px 0;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    min-width: 180px;
}
.guide-dropdown a {
    display: block;
    padding: 8px 14px;
    color: #c9d1d9;
    text-decoration: none;
    font-size: 0.82rem;
    white-space: nowrap;
}
.guide-dropdown a:hover { background: #21262d; }

/* ── Per-tab help icon ───────────────────────────────── */
.tab-help {
    color: #8b949e;
    text-decoration: none;
    font-size: 0.72rem;
    margin-left: 4px;
    opacity: 0.85;
    transition: opacity 0.15s, color 0.15s;
}
.tab-help:hover { opacity: 1; color: #58a6ff; }

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .tool-tabs { gap: 3px; flex-wrap: wrap; }
    .tool-tab { padding: 5px 10px; font-size: 0.72rem; }
    .chart-grid { transform: none; }
    .chart-grid-2x2, .chart-grid-1x2 { grid-template-columns: 1fr; }
    .chart-grid .chart-cell { min-height: 220px; overflow: hidden; }
    .chart-grid .chart-cell > div { max-width: 100%; }
    .tab-content { overflow-x: hidden; }
    .panel { overflow-x: hidden; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .stat-card { padding: 8px; }
    .stat-card .stat-value { font-size: 0.88rem; }
    .events-list { max-height: 200px; }
    .events-grid { grid-template-columns: 1fr; }
    .satellite-container { height: 300px; }
    .param-group input[type="number"] { width: 55px; }
    .data-table { font-size: 0.68rem; }
    .data-table th, .data-table td { padding: 5px 6px; }
}
