@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700&display=swap');

:root {
    --bg: #fff;
    --text: #000;
    --panel-border: #444;
    --panel-bg: rgba(0,0,0,0.1);
}

td.nowrap { white-space: nowrap; }

#title {
    font-size: 35px;
    font-weight: 400;
    font-family: 'Roboto Condensed';
    color: black;
}

#logo {
    position: absolute;
    top: 15px;
    left: 20px;
}

#stats { color: black; }

#capture {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    line-height: normal;
}

#container, .highcharts-legend-item {
    font-family: 'Roboto Condensed', sans-serif;
}

/* Controls */
#controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 1.2em;
    align-items: center;
    padding: 20px;
    background: rgba(0,0,0,0.05);
    border-bottom: 1px solid #ddd;
}

select, input[type='month'], input[type='number'] {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
    font-family: 'Roboto Condensed', sans-serif;
}

.view-toggle {
    display: flex;
    background: #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle label {
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.view-toggle input { display: none; }

.view-toggle input:checked + span {
    background: #0078d7;
    color: white;
}

.view-toggle span {
    display: block;
    padding: 0.4rem 1rem;
}

button {
    padding: 0.4rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    background: #0078d7;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Roboto Condensed', sans-serif;
}
button:hover { background: #005a9e; }

.water-year-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Table Styling */
@media print {
    .climate-table-wrapper { overflow: visible !important; }
    .climate-table {
        transform: scale(0.90);
        transform-origin: top left;
    }
}

.climate-table-wrapper {
    overflow-x: auto;
    width: 960px;
}

.climate-table {
    width: 100%;
    font-size: 11pt;
    margin-top: 990px;
    border-collapse: collapse;
    font-family: 'Roboto Condensed', sans-serif;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.climate-table th {
    padding: 5px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #000;
}

.climate-table td {
    padding: 5px;
    border: 1px solid #000;
    text-align: center;
}

.observed { font-weight: 700; }
.month-high { color: #f0f; font-weight: 700; }
.month-low { color: #08f; font-weight: 700; }

.hc-icon-high { color: #f0f; font-size: 0.85em; position: absolute; }
.hc-icon-low { color: #08f; font-size: 0.85em; position: absolute; }
.hc-icon-highmin { color: #f0f; font-size: 0.78em; position: absolute; }
.hc-icon-lowmax { color: #08f; font-size: 0.78em; position: absolute; }

.positive { color: rgba(255, 0, 255, 1); }
.negative { color: rgba(0, 136, 255, 1); }
.positive-pcpn { color: rgba(0, 255, 200, 1); }
.negative-pcpn { color: rgba(255, 0, 255, 1); }

.rechi-cell { background-color: rgba(255, 0, 0, 0.2) !important; }
.reclo-cell { background-color: rgba(0, 0, 255, 0.2) !important; }
.normal-cell { background-color: rgba(0, 0, 0, 0.1) !important; }
.precip-cell { background-color: rgba(0, 255, 0, 0.2) !important; }
.snow-cell { background-color: rgba(0, 100, 255, 0.2) !important; }
.depth-cell { background-color: rgba(160, 0, 255, 0.2) !important; }

.stat-value {
    display: inline-block;
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 15px;
    font-family: 'Roboto Condensed', sans-serif;
}

.stat-departure {
    display: inline-block;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: bold;
    text-shadow: none;
}

/* Yearly view specific */
#yearly-view { line-height: normal; }
.wrap { width: 960px; margin: 0 auto; padding-top: 20px; padding-bottom: 50px; font-family: 'Roboto Condensed'; }
.wrap h2 { margin: 0 0 12px; font-size: 24px; font-weight: 700; text-align: center; }
.hc { width: 960px; margin-bottom: 40px; }
#yearlyTempChart { height: 600px; }
.envChart { height: 300px; }

/* Yearly Monthly Summary Table */
.yearly-summary { width: 960px; margin: 10px auto 0; }
.yearly-summary h3 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    text-align: left;
}
.yearly-summary table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.yearly-summary th {
    padding: 4px 3px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #000;
    white-space: nowrap;
    line-height: 1.2;
}
.yearly-summary td {
    padding: 3px 3px;
    text-align: center;
    border: 1px solid #000;
    white-space: nowrap;
}
.yearly-summary .month-label { text-align: left; font-weight: 700; background: rgba(0,0,0,0.06); }
.yearly-summary .annual-row td { font-weight: 700; background: rgba(0,0,0,0.10); border-top: 2px solid #000; }
.yearly-summary .dep-pos { color: #f0f; font-weight: 700; }
.yearly-summary .dep-neg { color: #08f; font-weight: 700; }
.yearly-summary .dep-pos-p { color: #00aa00; font-weight: 700; }
.yearly-summary .dep-neg-p { color: #aa5100; font-weight: 700; }
.yearly-summary .hdr-temp { background: rgba(255,0,0,0.12); }
.yearly-summary .hdr-precip { background: rgba(0,200,0,0.12); }
.yearly-summary .hdr-snow { background: rgba(0,100,255,0.12); }
.yearly-summary .hdr-extreme { background: rgba(200,0,200,0.12); }
.yearly-summary .sub-hdr { font-size: 13px; font-weight: 400; }

/* Frequency distribution tables - equal columns */
.yearly-summary .freq-table { table-layout: fixed; }
.yearly-summary .freq-table th,
.yearly-summary .freq-table td { overflow: hidden; }

/* Records log table */
.yearly-summary .rec-type-hi { background: rgba(255,0,0,0.15); font-weight: 700; }
.yearly-summary .rec-type-lo { background: rgba(0,80,255,0.15); font-weight: 700; }
.yearly-summary .rec-type-himin { background: rgba(255,0,0,0.10); }
.yearly-summary .rec-type-lomax { background: rgba(0,80,255,0.10); }
.yearly-summary .rec-type-pcpn { background: rgba(0,200,0,0.12); font-weight: 700; }
.yearly-summary .rec-type-snow { background: rgba(0,100,255,0.12); font-weight: 700; }
.yearly-summary .rec-type-snowd { background: rgba(0,60,180,0.12); font-weight: 700; }
.yearly-summary .no-records { padding: 12px; text-align: center; color: #666; font-style: italic; }

/* Temperature frequency table */
.yearly-summary .freq-table td.count { font-weight: 700; }
.yearly-summary .freq-table td.zero { color: #ccc; }
.yearly-summary .freq-table .bin-hot { background: rgba(255,0,0,0.08); }
.yearly-summary .freq-table .bin-warm { background: rgba(255,160,0,0.08); }
.yearly-summary .freq-table .bin-cool { background: rgba(0,120,255,0.08); }
.yearly-summary .freq-table .bin-cold { background: rgba(0,0,200,0.12); }

/* Streaks & milestones */
.yearly-summary .streaks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}
.yearly-summary .streak-section h4 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.08);
    border-left: 4px solid #0078d7;
}
.yearly-summary .streak-table { width: 100%; }
.yearly-summary .streak-table td { text-align: left; padding: 3px 6px; border: none; border-bottom: 1px solid #ddd; }
.yearly-summary .streak-table td:last-child { text-align: right; font-weight: 700; }
.yearly-summary .streak-table tr:last-child td { border-bottom: none; }

#loading {
    text-align: center;
    display: none;
    padding: 20px;
    font-size: 1.5em;
    color: #666;
}

.highcharts-tooltip span {
    font-family: 'Roboto Condensed', sans-serif;
}