/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 16px;
    background-color: #ffffff;
    color: #333333;
}

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

/* Top bar header (forecast page) */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.location-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.location-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.location-title a {
    color: inherit;
    text-decoration: none;
}

.update-time {
    font-size: 0.75rem;
    font-style: italic;
    color: #888888;
}

.top-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

#use-location-link {
    color: #0066cc;
    text-decoration: none;
}

#use-location-link:hover {
    text-decoration: underline;
}

.zip-form-inline {
    display: inline;
}

.zip-form-inline input {
    width: 140px;
    padding: 6px 10px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.forecast-main {
    /* Main content area */
}

/* Home page prompt */
.home-prompt {
    text-align: center;
    color: #666666;
    margin-top: 48px;
}

/* Forecast table */
table.forecast {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

table.forecast th,
table.forecast td {
    position: relative;
    margin: 0;
    padding: 8px;
    vertical-align: top;
    text-align: center;
    border: 1px solid #dddddd;
}

table.forecast th:first-child,
table.forecast td:first-child {
    text-align: left;
}

table.forecast th {
    font-weight: normal;
    border: none;
    border-bottom: 1px solid #dddddd;
}

.column-name {
    display: none;
}

@media (min-width: 800px) {
    .column-name {
        display: inline-block;
        padding-left: 8px;
    }
}

.new-day {
    font-weight: bold;
}

table.forecast td.past {
    color: #888888;
}

table.forecast td.current {
    background-color: #f9f9f9;
    color: #000000;
}

table.forecast td.future {
    /* keep */
}

table.forecast time i {
    display: none;
}

@media (min-width: 450px) {
    table.forecast time i {
        display: inline-block;
        padding-right: 8px;
    }
}

table.forecast td.angle {
    text-align: center;
    font-size: 150%;
}

/* Histogram bar */
.histogram {
    position: absolute;
    display: block;
    left: 0;
    top: 0;
    bottom: 0;
    background-color: #f4f4f4;
}

.value {
    position: relative;
}

/* Precipitation accumulation display */
.value .delta {
    font-size: 0.75em;
    opacity: 0.6;
}

/* Stacked histogram for accumulation */
.histogram.delta {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: #e8e8e8;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .zip-form-inline input {
        background-color: #2a2a2a;
        border-color: #444444;
        color: #e0e0e0;
    }

    table.forecast th,
    table.forecast td {
        border-color: #444444;
    }

    table.forecast td.past {
        color: #666666;
    }

    table.forecast td.current {
        background-color: #2a2a2a;
        color: #ffffff;
    }

    .histogram {
        background-color: #333333;
    }

    .histogram.delta {
        background-color: #505050;
    }

    .update-time {
        color: #777777;
    }

    .home-prompt {
        color: #888888;
    }
}
