/* Storstad Livsstilskostnad - Frontend Styles
 *
 * Storstad-paletten:
 *   Petrol mörk:  #1a4d6b   primärfärg, banner
 *   Petrol djup:  #133a52   hover, dark accent
 *   Guld:         #c9922b   accent, vänsterkant, highlights
 *   Guld ljus:    #f0c674   highlights på mörk bakgrund
 *   Cream:        #f7f5f1   ljus bakgrund
 *   Cream mörk:   #ede9df   borders
 *   Park grön:    #3b6e58   positiva förändringar (billigare)
 *   Tegel röd:    #a13e2a   varnings/dyrare-förändringar
 *   Text mörk:    #1f2937
 *   Text subtle:  #6b7280
 */

.storstad-lk-tool *, .storstad-lk-tool *::before, .storstad-lk-tool *::after {
    box-sizing: border-box;
}

.storstad-lk-tool {
    font-family: inherit;
    color: #1f2937;
    max-width: 100%;
    margin: 2em 0;
}

/* Controls */
.storstad-lk-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    background: #f7f5f1;
    border-left: 4px solid #c9922b;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 700px) {
    .storstad-lk-controls {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    }
}

.storstad-lk-control label {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.storstad-lk-control select,
.storstad-lk-control input[type="number"],
.storstad-lk-control input[type="text"] {
    width: 100%;
    height: 40px;
    line-height: normal;
    padding: 8px 12px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
    font-family: inherit;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box;
    vertical-align: middle;
}

.storstad-lk-control select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath d='M1 1l5 5 5-5' stroke='%23374151' stroke-width='2' fill='none' stroke-linecap='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding: 8px 32px 8px 12px !important;
}

.storstad-lk-control select:focus,
.storstad-lk-control input[type="number"]:focus {
    outline: 2px solid #c9922b;
    outline-offset: 0;
    border-color: #c9922b;
}

.storstad-lk-control .lk-help,
.storstad-lk-control .lk-lifestyle-desc {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Summary banner */
.storstad-lk-summary {
    background: #1a4d6b;
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-size: 1.05rem;
}

.storstad-lk-summary p {
    margin: 0;
    line-height: 1.5;
}

.storstad-lk-summary strong {
    color: #f0c674;
    font-weight: 700;
}

/* Filters */
.storstad-lk-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 700px) {
    .storstad-lk-filters {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.storstad-lk-filters input,
.storstad-lk-filters select {
    width: 100%;
    height: 40px;
    line-height: normal;
    padding: 8px 12px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-family: inherit;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box;
    vertical-align: middle;
}

.storstad-lk-filters select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath d='M1 1l5 5 5-5' stroke='%23374151' stroke-width='2' fill='none' stroke-linecap='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding: 8px 32px 8px 12px !important;
}

/* Results - desktop table */
.storstad-lk-results {
    margin: 1.5rem 0;
}

.lk-loading,
.lk-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    font-size: 1rem;
}

.lk-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95rem;
}

.lk-table thead {
    background: #f7f5f1;
}

.lk-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #374151;
    border-bottom: 2px solid #c9922b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lk-table th.numeric,
.lk-table td.numeric {
    text-align: right;
}

.lk-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.lk-table tr:last-child td {
    border-bottom: none;
}

.lk-table tr.is-home {
    background: #fdf8ec;
}

.lk-table tr.is-home td {
    font-weight: 600;
}

.lk-table .lk-city-name {
    font-weight: 600;
    color: #1a4d6b;
}

.lk-table .lk-city-country {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

.lk-table .lk-cost {
    font-weight: 700;
    color: #1f2937;
}

.lk-table .lk-diff {
    font-size: 0.9rem;
    font-weight: 600;
}

.lk-diff.cheaper { color: #3b6e58; }
.lk-diff.expensive { color: #a13e2a; }
.lk-diff.same { color: #6b7280; }

.lk-table .lk-link a {
    color: #c9922b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.lk-table .lk-link a:hover {
    text-decoration: underline;
}

/* Mobile - card layout (NO horizontal scroll) */
@media (max-width: 700px) {
    .lk-table {
        border: none;
        background: transparent;
    }

    .lk-table thead {
        display: none;
    }

    .lk-table tbody,
    .lk-table tr,
    .lk-table td {
        display: block;
        width: 100%;
    }

    .lk-table tr {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-top: 4px solid #c9922b;
        border-radius: 6px;
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }

    .lk-table tr.is-home {
        background: #fdf8ec;
        border-top-color: #c9922b;
    }

    .lk-table td {
        padding: 0.4rem 0;
        border-bottom: 1px solid #f3f4f6;
        text-align: left !important;
    }

    .lk-table td:last-child {
        border-bottom: none;
    }

    .lk-table td:before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 600;
        margin-bottom: 2px;
    }

    .lk-table td.numeric {
        text-align: left !important;
    }

    .lk-table .lk-stad-cell {
        border-bottom: 2px solid #f3f4f6;
        padding-bottom: 0.5rem;
        margin-bottom: 0.4rem;
    }

    .lk-table .lk-stad-cell::before {
        display: none;
    }
}

/* Footer */
.storstad-lk-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.5;
}

.storstad-lk-footer p {
    margin: 0;
}
