/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
body {
    font-family: Arial, Helvetica, sans-serif;
    padding: 1rem;
}

/* Latest reading card (views/sensor_readings/_latest.html.erb) */
.reading-card {
    max-width: 420px;
    padding: 1.25rem 1.5rem;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.reading-hero {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reading-hero-icon {
    font-size: 2rem;
    line-height: 1;
}

.reading-hero-value {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    color: #222;
}

.reading-hero-unit {
    font-size: 1.25rem;
    font-weight: 500;
    color: #888;
    margin-left: 0.1rem;
}

.reading-stats {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.reading-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.75rem 0.5rem;
    background: #f7f7f8;
    border-radius: 10px;
}

.reading-stat-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.reading-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
}

.reading-stat-unit {
    font-size: 0.8rem;
    font-weight: 500;
    color: #888;
    margin-left: 0.15rem;
}

.reading-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
}

.reading-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: #888;
}

.reading-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .reading-card {
        max-width: none;
    }
}

/* Temperature heatmap (controllers/d3_heatmap_controller.js) */
.heatmap {
    position: relative;
    width: 100%;
    margin: 1rem 0 2rem;
    font-size: 11px;
    color: #444;
}

.heatmap-grid {
    display: grid;
    /* day label + 24 equal-width hour columns */
    grid-template-columns: max-content repeat(24, minmax(0, 1fr));
    gap: 2px;
    align-items: stretch;
}

.heatmap-hour {
    text-align: center;
    align-self: end;
    padding-bottom: 2px;
    color: #888;
}

.heatmap-day {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    white-space: nowrap;
    color: #666;
}

.heatmap-cell {
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    font-size: 9px;
    color: rgba(0, 0, 0, 0.65);
    cursor: crosshair;
    transition: outline-color 0.08s ease;
    outline: 2px solid transparent;
    outline-offset: -1px;
}

.heatmap-cell:hover {
    outline-color: #111;
    position: relative;
    z-index: 1;
}

.heatmap-cell--empty {
    background: #ededed;
    cursor: default;
}

.heatmap-legend {
    max-width: 320px;
    margin-top: 1rem;
}

.heatmap-legend-bar {
    height: 10px;
    border-radius: 2px;
}

.heatmap-legend-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    color: #888;
}

.heatmap-tooltip {
    position: absolute;
    z-index: 10;
    transform: translate(-50%, calc(-100% - 10px));
    background: #111;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
}

.heatmap-tooltip[hidden] {
    display: none;
}

@media (max-width: 768px) {
    .heatmap-cell {
        min-height: 30px;
        font-size: 11px;
    }
}

/* VPD drying conditions plane (controllers/d3_vpd_controller.js) */
.vpd-label {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5rem 0 0.25rem;
}

.vpd-label--fast  { color: #15803d; }
.vpd-label--good  { color: #16a34a; }
.vpd-label--slow  { color: #b45309; }
.vpd-label--none,
.vpd-label--humid { color: #dc2626; }

.vpd-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #555;
}

.vpd-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.vpd-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}