/* Lokaali fontti */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/poppins-v24-latin-regular.woff2') format('woff2');
}

/* Perusasetukset ja väriteema */
:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #777777;
    --hot-color: #ff6b6b;
    --cold-color: #4facfe;
    --accent-color: #2ecc71;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

/* Otsikko-osion tyylit (toimii molemmilla sivuilla) */
.header {
    display: flex;
    justify-content: center; /* Keskittää etusivulla */
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    text-align: center;
}

.header.historia-header {
    justify-content: space-between; /* Levittää otsikon ja napin reunoille historiasivulla */
    text-align: left;
}

.header h1 {
    margin: 0;
    font-size: 2.5rem;
    color: var(--text-main);
    letter-spacing: 1px;
}

/* Historiasivun paluunappi */
.back-btn {
    text-decoration: none;
    background-color: var(--card-bg);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.back-btn:hover {
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Etusivun korttien asettelu */
.content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Yksittäisen kortin tyylittely */
.grid-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

/* Historiasivun graafikortti */
.chart-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
    height: 60vh;
    min-height: 400px;
}

.card-title {
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.card-title a {
    text-decoration: none;
    color: var(--text-main);
}

.card-title h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.card-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.data-column {
    display: flex;
    flex-direction: column;
}

.card-temp-hot p, .card-temp-cold p, .card-value-big p {
    margin: 5px 0;
    font-weight: 600;
}

.card-temp-hot p, .card-temp-cold p {
    font-size: 1.5rem;
}

.card-temp-hot p { color: var(--hot-color); }
.card-temp-cold p { color: var(--cold-color); }
.card-value-big p { color: var(--accent-color); font-size: 2.5rem; }

.label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}