/* Hurpedia Stegkalkylator v1.0.0 */
/* Egen namnrymd .stk- för att inte krocka med tema eller andra plugins */

.stk-root {
    --stk-bg: #ffffff;
    --stk-bg-soft: #f7f9fc;
    --stk-text: #1a2332;
    --stk-text-soft: #4a5568;
    --stk-text-muted: #6b7280;
    --stk-accent: #059669;
    --stk-accent-soft: #ecfdf5;
    --stk-accent-2: #0284c7;
    --stk-border: #e2e8f0;
    --stk-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --stk-radius: 12px;
    --stk-radius-sm: 8px;

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

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

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

.stk-section-title {
    color: var(--stk-text);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 14px;
}

/* === SETTINGS === */
.stk-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.stk-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.stk-field label {
    color: var(--stk-text-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

.stk-input {
    appearance: none;
    -webkit-appearance: none;
    background: var(--stk-bg);
    border: 2px solid var(--stk-border);
    border-radius: var(--stk-radius-sm);
    color: var(--stk-text);
    font-family: inherit;
    font-size: 1rem;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Custom select dropdown */
select.stk-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%236b7280' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px;
}

.stk-input:focus {
    outline: none;
    border-color: var(--stk-accent);
    box-shadow: 0 0 0 3px var(--stk-accent-soft);
}

.stk-input-big {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    min-height: 56px;
    padding: 14px 12px;
}

.stk-stride-info {
    background: var(--stk-accent-soft);
    border-radius: var(--stk-radius-sm);
    color: var(--stk-text);
    font-size: 0.95rem;
    margin: 0;
    padding: 12px 14px;
    text-align: center;
}

.stk-stride-info strong {
    color: var(--stk-accent);
    font-weight: 700;
}

/* === TABS === */
.stk-tabs {
    border-bottom: 2px solid var(--stk-border);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
}

.stk-tab {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--stk-text-muted);
    cursor: pointer;
    flex: 1 1 auto;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: -2px;
    min-height: 44px;
    padding: 10px 14px;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.stk-tab:hover {
    color: var(--stk-text);
}

.stk-tab-active {
    border-bottom-color: var(--stk-accent);
    color: var(--stk-accent);
}

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

.stk-tab-panels {
    margin-bottom: 18px;
}

.stk-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stk-panel label {
    color: var(--stk-text-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

/* === RESULTAT === */
.stk-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.stk-result-cell {
    background: var(--stk-bg-soft);
    border: 1px solid var(--stk-border);
    border-radius: var(--stk-radius-sm);
    min-width: 0;
    padding: 16px 10px;
    text-align: center;
}

.stk-result-cell:first-child {
    background: var(--stk-accent-soft);
    border-color: var(--stk-accent);
}

.stk-result-num {
    color: var(--stk-text);
    display: block;
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stk-result-cell:first-child .stk-result-num {
    color: var(--stk-accent);
}

.stk-result-label {
    color: var(--stk-text-muted);
    display: block;
    font-size: 0.875rem;
    margin-top: 4px;
}

.stk-time-info,
.stk-calories-info {
    color: var(--stk-text-soft);
    font-size: 0.95rem;
    margin: 0 0 6px;
    padding: 0 4px;
}

.stk-time-info strong,
.stk-calories-info strong {
    color: var(--stk-text);
}

/* === STEGMÅL-TABELL === */
.stk-goals-table {
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 0;
    width: 100%;
}

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

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

.stk-goals-table tbody tr:last-child td {
    border-bottom: none;
}

.stk-goals-table tbody tr:nth-child(2) {
    background: var(--stk-accent-soft);
}

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

/* Responsiv tabell — kort på mobil */
@media (max-width: 540px) {
    .stk-goals-table thead {
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        white-space: nowrap;
        width: 1px;
    }
    .stk-goals-table tbody tr {
        background: var(--stk-bg);
        border: 1px solid var(--stk-border);
        border-radius: var(--stk-radius-sm);
        display: block;
        margin-bottom: 10px;
        padding: 6px 0;
    }
    .stk-goals-table tbody tr:nth-child(2) {
        background: var(--stk-accent-soft);
        border-color: var(--stk-accent);
    }
    .stk-goals-table tbody td {
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        padding: 6px 12px;
        text-align: right;
    }
    .stk-goals-table tbody td::before {
        color: var(--stk-text-muted);
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
    }
    .stk-goals-table tbody td:first-child {
        background: transparent;
        border-bottom: 1px solid var(--stk-border);
        color: var(--stk-text);
        font-weight: 700;
        margin-bottom: 4px;
        padding-bottom: 8px;
    }
    .stk-goals-table tbody td:first-child::before {
        display: none;
    }
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
    .stk-root {
        --stk-bg: #1a2332;
        --stk-bg-soft: #232f44;
        --stk-text: #f1f5f9;
        --stk-text-soft: #cbd5e1;
        --stk-text-muted: #94a3b8;
        --stk-accent: #34d399;
        --stk-accent-soft: #1e3a25;
        --stk-accent-2: #38bdf8;
        --stk-border: #334155;
    }
    select.stk-input {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%2394a3b8' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
    }
}
