/* Cottage Temperature Monitor
   Light Dashboard V1.0
   November 8, 2026 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px;
    background: #f4f7fb;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Arial, sans-serif;
}

.dashboard {
    max-width: 1000px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.eyebrow {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

h1 {
    font-size: 30px;
    margin: 8px 0;
}

.subtitle {
    margin: 0;
    color: #64748b;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 0 4px #dcfce7;
}

.status-dot.offline {
    background: #94a3b8;
}

.status-dot.warning {
    background: #ef4444;
    box-shadow: 0 0 0 4px #fee2e2;
}

.temperature-card,
.stat-card,
.chart-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.temperature-card {
    text-align: center;
    padding: 42px 20px;
    margin-bottom: 20px;
}

.card-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.temperature-reading {
    font-size: clamp(72px, 12vw, 120px);
    font-weight: 700;
    letter-spacing: -5px;
    line-height: 1.25;
    color: #0f172a;
}

.degree {
    font-size: 0.4em;
    vertical-align: top;
    letter-spacing: 0;
}

.temperature-status {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
}

.temperature-status.normal {
    background: #dcfce7;
    color: #166534;
}

.temperature-status.warning {
    background: #fee2e2;
    color: #991b1b;
}

.last-update {
    margin-top: 18px;
    color: #64748b;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 25px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-top: 10px;
}

.chart-card {
    padding: 28px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.chart-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.chart-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.period-selector {
    display: flex;
    gap: 5px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 10px;
}

.period {
    border: none;
    background: transparent;
    padding: 10px 14px;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
}

.period.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.period:hover {
    color: #2563eb;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 320px;
}

canvas {
    display: block;
    width: 100%;
}

.chart-message {
    position: absolute;
    top: 45%;
    width: 100%;
    text-align: center;
    color: #94a3b8;
    pointer-events: none;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 5px;
    color: #94a3b8;
    font-size: 12px;
}

@media (max-width: 650px) {

    body {
        padding: 14px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    h1 {
        font-size: 25px;
    }

    .temperature-card {
        padding: 30px 10px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 18px 5px;
    }

    .stat-value {
        font-size: 25px;
    }

    .chart-card {
        padding: 18px 10px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .period-selector {
        width: 100%;
    }

    .period {
        flex: 1;
        padding: 10px 5px;
        font-size: 12px;
    }

    footer {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}