:root {
    --bg-color: #fcfcfc;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --border-color: #e5e5e5;
    --card-bg: #f5f5f4;
    --card-red-bg: #fee8e9;
    --red-text: #b02026;
    --pill-bg: #ffffff;
    --pill-border: #e5e5e5;
    --pill-active-bg: #f0f0f0;
    --pill-active-border: #1a1a1a;
    --slider-track: #e5e5e5;
    --slider-thumb: #ffffff;
    --slider-thumb-border: #cccccc;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding: 40px 20px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    margin-bottom: 40px;
}

.supertitle {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.subtitle {
    font-size: 16px;
    color: var(--text-main);
}

.controls {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        gap: 24px;
    }
}

.control-group {
    flex: 1;
}

.control-header {
    margin-bottom: 12px;
}

.control-header label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.input-with-symbol {
    display: flex;
    align-items: baseline;
    margin-bottom: 16px;
}

.symbol {
    font-size: 24px;
    color: var(--text-muted);
    margin-right: 8px;
}

.input-with-symbol input {
    font-size: 28px;
    font-weight: 600;
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-family);
    color: var(--text-main);
    width: 100%;
}

.unit {
    font-size: 16px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* Range Sliders */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--slider-track);
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--slider-thumb);
    border: 2px solid var(--slider-thumb-border);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input[type=range]:focus::-webkit-slider-thumb {
    border-color: var(--text-main);
}

.slider-wrapper {
    position: relative;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

/* Country Section */
.country-section {
    margin-bottom: 40px;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.country-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pill {
    padding: 10px 16px;
    border: 1px solid var(--pill-border);
    border-radius: 8px;
    background: var(--pill-bg);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
    user-select: none;
}

.pill:hover {
    border-color: #999;
}

.pill.active {
    border-color: var(--pill-active-border);
    background: var(--pill-active-bg);
    font-weight: 500;
}

/* Results */
.results {
    margin-bottom: 40px;
}

.cards-row-main {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .cards-row-main {
        flex-direction: column;
    }
}

.card {
    flex: 1;
    padding: 24px;
    border-radius: 12px;
    background: var(--card-bg);
}

.card.future-card {
    background: var(--card-red-bg);
}

.card-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.future-card .card-label {
    color: var(--red-text);
}

.card-value {
    font-size: 36px;
    font-weight: 700;
}

.red-text {
    color: var(--red-text);
}

.cards-row-stats {
    display: flex;
    gap: 20px;
}

@media (max-width: 600px) {
    .cards-row-stats {
        flex-direction: column;
    }
}

.stat-card {
    flex: 1;
    padding: 24px;
    border-radius: 12px;
    background: var(--card-bg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Chart */
.chart-section {
    margin-bottom: 32px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    height: 300px; /* Important for Chart.js */
}

/* Context */
.context-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

#country-context {
    font-size: 16px;
    color: var(--text-muted);
    font-style: italic;
}

/* Share Button */
.share-section {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--text-main);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.share-button:hover {
    opacity: 0.9;
}

/* Share Card for Image Gen */
.share-card {
    width: 600px;
    height: 315px; /* standard twitter ratio approx */
    background: #fff;
    padding: 30px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 0;
    font-family: 'Inter', sans-serif;
    color: #1a1a1a;
}

.share-header {
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.share-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
}

.share-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.share-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.share-row strong {
    font-size: 36px;
}

.share-footer {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin-top: auto;
}
