/* Activator Toolkit for SOTA — Frontend block styles
 * Static layout/structural rules; dynamic color overrides are added via wp_add_inline_style().
 */

/* ── Typography ──────────────────────────────────────────────────────────────
 * Applied only within plugin elements; does not bleed into theme typography.
 * Falls back to the site's body font when sota_use_theme_font is checked.
 */
.sota-main-container,
.sota-modal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Callsigns and technical values get mono treatment */
.sota-table td:nth-child(3),
.sota-table th:nth-child(3) {
    font-family: ui-monospace, 'SFMono-Round', 'SF Mono', Menlo, Consolas, monospace;
    letter-spacing: 0.03em;
}

.sota-main-container {
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
}
.sota-main-container h3 {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 9px;
}
.sota-main-container h3 svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* GPX Statistics Grid */
.sota-gpx-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0 0 20px 0;
    padding: 20px;
    border-radius: 8px;
    border-width: 1px;
    border-style: solid;
}
.sota-stat-box {
    text-align: center;
    padding: 15px;
    border-radius: 6px;
}
.sota-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    opacity: 0.75;
}
.sota-stat-icon svg {
    width: 100%;
    height: 100%;
}
.sota-stat-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}
.sota-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.65;
}
.sota-stat-secondary {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.7;
}

/* Responsive table wrapper */
.sota-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}
.sota-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}
.sota-table th {
    border-bottom-width: 2px;
    border-bottom-style: solid;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.6;
}
.sota-table td {
    padding: 10px 12px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.5;
}
.sota-table td:last-child {
    white-space: normal;
    word-wrap: break-word;
    max-width: 300px;
}
.s2s-row td {
    font-weight: bold;
}
.s2s-badge {
    color: white;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-left: 5px;
    text-transform: uppercase;
}

/* GPX map + elevation chart */
.sota-gpx-map {
    width: 100%;
    height: 400px;
    border-radius: 8px 8px 0 0;
    background: #e8e8e8;
}
.sota-gpx-chart-wrap {
    width: 100%;
    height: 140px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    position: relative;
    padding: 4px 4px 8px 4px;
    box-sizing: border-box;
}

/* Stats help modal */
.sota-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
}
.sota-modal-backdrop.sota-modal-open {
    display: flex;
}
.sota-modal {
    background: #ffffff;
    color: #1e1e1e;
    border-radius: 12px;
    padding: 30px 32px;
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    position: relative;
    font-family: sans-serif;
}
.sota-modal h2 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0073aa;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sota-modal .sota-modal-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0 0 22px 0;
}
.sota-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
}
.sota-modal-close:hover { color: #333; }
.sota-modal-section {
    border-top: 1px solid #eeeeee;
    padding: 14px 0;
}
.sota-modal-section:first-of-type { border-top: none; padding-top: 0; }
.sota-modal-section h3 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #1e1e1e;
    display: flex;
    align-items: center;
    gap: 7px;
    border: none;
    padding: 0;
}
.sota-modal-section h3 svg {
    opacity: 0.7;
    flex-shrink: 0;
}
.sota-modal-section p {
    margin: 0;
    font-size: 13px;
    color: #444;
    line-height: 1.7;
    text-wrap: pretty;
}
.sota-modal-section p + p { margin-top: 6px; }
.sota-modal-note {
    margin-top: 20px;
    padding: 12px 14px;
    background: #f0f7ff;
    border-left: 3px solid #0073aa;
    border-radius: 4px;
    font-size: 12px;
    color: #444;
    line-height: 1.7;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-wrap: pretty;
}
.sota-modal-note svg {
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.65;
}
.sota-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid currentColor;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    opacity: 0.55;
    color: inherit;
    font-family: inherit;
    vertical-align: middle;
    transition: opacity 0.15s;
}
.sota-help-btn:hover { opacity: 0.9; }
.sota-help-btn svg { flex-shrink: 0; }
.sota-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 8px 0;
}
.sota-stats-header-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.55;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

/* Block width: wide / full
 * Block themes (Twenty Twenty-Five etc.) handle .alignwide/.alignfull natively
 * via their layout grid. The rules below are fallbacks for classic themes.
 */
.sota-main-container.alignwide {
    width: calc(100% + 20vw);
    max-width: 1200px;
    margin-left: max(-10vw, calc(50% - 600px));
    margin-right: max(-10vw, calc(50% - 600px));
    box-sizing: border-box;
}
.sota-main-container.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .sota-main-container {
        padding: 15px;
    }
    .sota-gpx-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    .sota-stat-icon {
        width: 30px;
        height: 30px;
    }
    .sota-stat-value {
        font-size: 20px;
    }
    .sota-table {
        font-size: 14px;
    }
    .sota-table th,
    .sota-table td {
        padding: 8px;
    }
}
