/* Hurpedia Månresa-kalkylator v1.0.0 */
/* Egen namnrymd .mr- */

.mr-root {
    --mr-bg: #ffffff;
    --mr-bg-soft: #f7f9fc;
    --mr-text: #1a2332;
    --mr-text-soft: #4a5568;
    --mr-text-muted: #6b7280;
    --mr-accent: #4338ca;
    --mr-accent-soft: #eef2ff;
    --mr-real: #059669;
    --mr-real-soft: #d1fae5;
    --mr-hypothetical: #d97706;
    --mr-hypothetical-soft: #fef3c7;
    --mr-physics: #7c3aed;
    --mr-physics-soft: #f3e8ff;
    --mr-border: #e2e8f0;
    --mr-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --mr-radius: 12px;
    --mr-radius-sm: 8px;

    box-sizing: border-box;
    color: var(--mr-text);
    line-height: 1.55;
    margin: 1.5em 0;
    max-width: 100%;
}

.mr-root *,
.mr-root *::before,
.mr-root *::after {
    box-sizing: border-box;
}

/* === KORT === */
.mr-card {
    background: var(--mr-bg);
    border: 1px solid var(--mr-border);
    border-radius: var(--mr-radius);
    box-shadow: var(--mr-shadow);
    margin-bottom: 16px;
    padding: clamp(16px, 3vw, 22px);
}

.mr-section-title {
    color: var(--mr-text);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.mr-help {
    color: var(--mr-text-muted);
    font-size: 0.9rem;
    margin: 0 0 14px;
}

/* === DISTANCE TABS === */
.mr-distance-help {
    color: var(--mr-text-soft);
    font-size: 0.9rem;
    margin: 0 0 12px;
}

.mr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.mr-tab {
    appearance: none;
    background: var(--mr-bg-soft);
    border: 2px solid var(--mr-border);
    border-radius: var(--mr-radius-sm);
    color: var(--mr-text);
    cursor: pointer;
    flex: 1 1 auto;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 42px;
    padding: 8px 14px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.mr-tab:hover {
    background: var(--mr-accent-soft);
    border-color: var(--mr-accent);
}

.mr-tab-active {
    background: var(--mr-accent);
    border-color: var(--mr-accent);
    color: #ffffff;
}

.mr-tab:focus-visible {
    outline: 3px solid var(--mr-accent-soft);
    outline-offset: 2px;
}

.mr-distance-current {
    color: var(--mr-text);
    font-size: 1rem;
    margin: 0;
    text-align: center;
}

.mr-distance-current strong {
    color: var(--mr-accent);
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

/* === FOCUS CARD === */
.mr-focus-card {
    background: linear-gradient(135deg, var(--mr-accent) 0%, #1e1b4b 100%);
    border-color: var(--mr-accent);
    color: #ffffff;
}

.mr-focus-eyebrow {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.mr-focus-name {
    color: #ffffff;
    font-size: clamp(1.3rem, 4vw, 1.7rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 16px;
}

.mr-focus-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.mr-stat {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--mr-radius-sm);
    padding: 12px;
    text-align: center;
}

.mr-stat-primary {
    background: rgba(255, 255, 255, 0.22);
}

.mr-stat-label {
    color: rgba(255, 255, 255, 0.78);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.mr-stat-num {
    color: #ffffff;
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.mr-stat-primary .mr-stat-num {
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
}

.mr-focus-note {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--mr-radius-sm);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    padding: 12px;
}

/* === VEHICLE GRID === */
.mr-vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.mr-vehicle-btn {
    appearance: none;
    background: var(--mr-bg-soft);
    border: 2px solid var(--mr-border);
    border-radius: var(--mr-radius-sm);
    color: var(--mr-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    min-height: 64px;
    padding: 8px 12px;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.mr-vehicle-btn:hover {
    border-color: var(--mr-accent);
    transform: translateY(-1px);
}

.mr-vehicle-btn-active {
    background: var(--mr-accent-soft);
    border-color: var(--mr-accent);
}

.mr-vehicle-btn:focus-visible {
    outline: 3px solid var(--mr-accent-soft);
    outline-offset: 2px;
}

.mr-vehicle-icon {
    display: block;
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 4px;
}

.mr-vehicle-name {
    display: block;
    font-weight: 700;
    line-height: 1.2;
}

.mr-vehicle-time {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 2px;
    color: var(--mr-text-muted);
}

.mr-vehicle-btn-active .mr-vehicle-time {
    color: var(--mr-accent);
    font-weight: 600;
}

/* Färgkodning baserat på typ */
.mr-vehicle-btn[data-type="real"] {
    border-left: 4px solid var(--mr-real);
}
.mr-vehicle-btn[data-type="hypothetical"] {
    border-left: 4px solid var(--mr-hypothetical);
}
.mr-vehicle-btn[data-type="physics"] {
    border-left: 4px solid var(--mr-physics);
}

/* === TABELL === */
.mr-list-table {
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 0;
    width: 100%;
}

.mr-list-table thead th {
    background: var(--mr-bg-soft);
    border-bottom: 2px solid var(--mr-border);
    color: var(--mr-text);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 10px 12px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mr-list-table tbody td {
    border-bottom: 1px solid var(--mr-border);
    padding: 10px 12px;
    vertical-align: middle;
}

.mr-list-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.mr-list-table tbody tr:hover {
    background: var(--mr-bg-soft);
}

.mr-list-table tbody tr.mr-row-focus {
    background: var(--mr-accent-soft);
    font-weight: 600;
}

.mr-list-table tbody tr.mr-row-focus td:first-child {
    border-left: 3px solid var(--mr-accent);
}

.mr-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mr-type-badge[data-type="real"] {
    background: var(--mr-real-soft);
    color: var(--mr-real);
}
.mr-type-badge[data-type="hypothetical"] {
    background: var(--mr-hypothetical-soft);
    color: var(--mr-hypothetical);
}
.mr-type-badge[data-type="physics"] {
    background: var(--mr-physics-soft);
    color: var(--mr-physics);
}

.mr-source-note {
    color: var(--mr-text-muted);
    font-size: 0.825rem;
    font-style: italic;
    margin: 12px 0 0;
}

/* === RESPONSIV — KORT PÅ MOBIL === */
@media (max-width: 540px) {
    .mr-list-table thead {
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        white-space: nowrap;
        width: 1px;
    }
    .mr-list-table tbody tr {
        background: var(--mr-bg);
        border: 1px solid var(--mr-border);
        border-radius: var(--mr-radius-sm);
        display: block;
        margin-bottom: 8px;
        padding: 6px 0;
    }
    .mr-list-table tbody tr.mr-row-focus {
        border-color: var(--mr-accent);
    }
    .mr-list-table tbody td {
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        padding: 6px 12px;
        text-align: right;
    }
    .mr-list-table tbody td::before {
        color: var(--mr-text-muted);
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
    }
    .mr-list-table tbody td:first-child {
        background: transparent;
        border-bottom: 1px solid var(--mr-border);
        color: var(--mr-text);
        font-weight: 700;
        margin-bottom: 4px;
        padding-bottom: 8px;
    }
    .mr-list-table tbody td:first-child::before {
        display: none;
    }
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
    .mr-root {
        --mr-bg: #1a2332;
        --mr-bg-soft: #232f44;
        --mr-text: #f1f5f9;
        --mr-text-soft: #cbd5e1;
        --mr-text-muted: #94a3b8;
        --mr-accent: #818cf8;
        --mr-accent-soft: #2c2e5a;
        --mr-real: #34d399;
        --mr-real-soft: #1e3a25;
        --mr-hypothetical: #fbbf24;
        --mr-hypothetical-soft: #3a2e0e;
        --mr-physics: #a78bfa;
        --mr-physics-soft: #2e1d4a;
        --mr-border: #334155;
    }
}
