/* UK Calculator – theme (distinct from NZ, AU, CA). */

:root {
    --primary-color: #0369a1;
    --primary-hover: #0284c7;
    --primary-rgb: 3, 105, 161;
}

.subtitle-line2 {
    display: block;
    margin-top: 0.35em;
}

/* Long tooltip: above icon, left-aligned, wraps */
.tooltip-icon-long:hover::after {
    left: 0;
    right: auto;
    transform: none;
    white-space: normal;
    max-width: min(280px, calc(100vw - 2rem));
    width: max-content;
}

.tooltip-icon-long:hover::before {
    left: 12px;
    transform: none;
}

/* UK results card – same fill style as NZ, AU, CA (gradient + white overlay) */
.results-section .results-card {
    padding: 20px;
}

.results-section .total-cost {
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.results-section .total-cost-monthly-first .total-primary-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #fff;
}

.results-section .total-cost-monthly-first .total-primary-amount {
    display: block;
    font-size: 2.15rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
    letter-spacing: -0.02em;
}

.results-section .total-cost-monthly-first .total-secondary-label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2px;
}

.results-section .total-cost-monthly-first .total-secondary-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.results-section .total-monthly-label {
    display: block;
    font-size: 0.9rem;
    margin-top: 4px;
    margin-bottom: 2px;
}

.results-section .total-monthly-amount {
    font-size: 1.4rem;
    font-weight: 700;
}

.results-section .breakdown {
    gap: 8px;
    margin-bottom: 16px;
}

.results-section .results-note {
    margin: 16px 0 0 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.35;
}

.content-section .content-assumptions {
    margin: 1rem 0 1.5rem 0;
    padding: 12px 14px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #475569;
}

.content-section .content-assumptions h4 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

.content-section .content-assumptions p {
    margin: 0;
    line-height: 1.5;
}

.results-section .breakdown-item {
    padding: 10px 12px;
    font-size: 0.9rem;
    flex-wrap: nowrap;
    color: #fff;
}

.results-section .breakdown-item-label,
.results-section .breakdown-item-value {
    white-space: nowrap;
    color: inherit;
}

.results-section .income-comparison {
    margin-top: 16px;
    padding-top: 16px;
}

.results-section .comparison-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    flex-wrap: nowrap;
    color: #fff;
}

.results-section .comparison-item > span {
    white-space: nowrap;
}

.results-section .comparison-item:not(.highlight) > span {
    color: inherit;
}

.results-section .comparison-item.highlight {
    font-size: 0.95rem;
}

.results-section .comparison-item.highlight.positive {
    color: #047857;
}

.results-section .comparison-item.highlight.negative {
    color: #b45309;
}

.results-section .currency-disclaimer {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.95);
}

/* Income guidance */
.income-guidance {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-left: 3px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 0 6px 6px 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #64748b;
}

/* ===== UK content page: cards, table, chart ===== */

/* Cost category cards grid */
.cost-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.cost-card {
    background: #f8fafc;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cost-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

.cost-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.cost-card-icon svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cost-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
    color: var(--primary-color);
    border: none;
    padding: 0;
}

.cost-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary, #64748b);
}

/* City comparison table */
.city-comparison-wrap {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.city-comparison-table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.city-comparison-table th,
.city-comparison-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.city-comparison-table th {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-color);
    font-weight: 600;
}

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

.city-comparison-table tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.04);
}

.city-comparison-table .cost-range {
    font-weight: 600;
    color: var(--text-primary);
}

/* Spending chart - horizontal bars */
.spending-chart {
    margin: 24px 0;
    padding: 24px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.spending-chart h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.spending-chart-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.spending-chart-row:last-child {
    margin-bottom: 0;
}

.spending-chart-label {
    flex: 0 0 100px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.spending-chart-bar-wrap {
    flex: 1;
    min-width: 0;
    height: 28px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    overflow: hidden;
}

.spending-chart-bar {
    height: 100%;
    border-radius: 6px;
    min-width: 2px;
    transform-origin: left;
    animation: uk-chart-scale 0.6s ease-out forwards;
}

@keyframes uk-chart-scale {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.spending-chart-bar.housing { background: linear-gradient(90deg, #0369a1, #0ea5e9); }
.spending-chart-bar.groceries { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.spending-chart-bar.transport { background: linear-gradient(90deg, #0891b2, #06b6d4); }
.spending-chart-bar.utilities { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.spending-chart-bar.lifestyle { background: linear-gradient(90deg, #b45309, #f59e0b); }

.spending-chart-pct {
    flex: 0 0 auto;
    min-width: 5.5em;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Mode cards (Simple / Detailed) – align to top so Simple card doesn’t stretch */
.mode-intro {
    margin-bottom: 4px;
}

/* Mode flow: Simple → Detailed with icons and connector */
.mode-flow {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 20px 0;
    flex-wrap: wrap;
}

.mode-node {
    flex: 1 1 200px;
    min-width: 0;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mode-node .mode-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: #fff;
}

.mode-simple .mode-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0ea5e9 100%);
}

.mode-detailed .mode-icon {
    background: linear-gradient(135deg, #0c4a6e 0%, var(--primary-color) 100%);
}

.mode-node h4 {
    margin: 0 0 8px 0;
    padding: 0;
    border: none;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.mode-node p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.mode-node p:last-of-type:not(.mode-advanced-label) {
    margin-bottom: 0;
}

.mode-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    min-width: 60px;
}

.mode-connector-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    margin-bottom: 4px;
}

.mode-arrow {
    color: var(--primary-color);
    opacity: 0.8;
}

.mode-advanced-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-top: 4px;
    margin-bottom: 8px !important;
}

.mode-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mode-chip {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

@media (max-width: 640px) {
    .mode-flow {
        flex-direction: column;
        align-items: stretch;
    }

    .mode-connector {
        flex-direction: row;
        padding: 8px 0;
        min-width: auto;
    }

    .mode-connector-label {
        margin-bottom: 0;
        margin-right: 8px;
    }

    .mode-arrow {
        transform: rotate(-90deg);
    }
}

/* Formula callout */
.formula-callout {
    display: block;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0ea5e9 100%);
    color: #fff;
    border-radius: 10px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 16px 0;
}

/* Data sources compact list */
.data-sources-list {
    list-style: none;
    padding-left: 0;
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.data-sources-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-sources-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.data-sources-list a {
    font-size: 0.9rem;
    word-break: break-all;
}

/* In-content interlinking (compare countries) */
.content-section .compare-cta {
    margin-top: 24px;
    padding: 14px 18px;
    background: rgba(var(--primary-rgb), 0.06);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Guides section – interlink to Salary Guide & Compare */
.guides-section {
    margin-top: 28px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 16px;
}

.guides-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.guides-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guides-icon svg {
    width: 24px;
    height: 24px;
}

.guides-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.guides-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.guide-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.12);
    transform: translateY(-2px);
}

.guide-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.guide-card-content {
    flex: 1;
    min-width: 0;
}

.guide-card-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.guide-card-desc {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.guide-card-arrow {
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.guide-card:hover .guide-card-arrow {
    opacity: 1;
    transform: translateX(4px);
}

@media (min-width: 640px) {
    .guides-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .guide-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }

    .guide-card-icon {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }

    .guide-card-arrow {
        display: none;
    }
}

