/* ============================================================
   California Carbohydrate Observatory — Stylesheet
   Color palette & feel matched to PISA-CA irrigation scheduler
   ============================================================ */

body {
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    color: #333;
    background: #fff;
    margin: 0;
}

/* === HEADER (compact, PISA-CA style) === */
.app-header {
    background-color: #2c6e49;
    color: white;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 200;
}
.app-header img {
    height: 50px;
    border-radius: 4px;
    flex-shrink: 0;
}
.app-header h1 {
    font-size: 1.2rem;
    margin: 0 0 2px 0;
    color: white;
}
.app-header p {
    font-size: 0.80rem;
    margin: 0;
    opacity: 0.85;
    max-width: 700px;
    line-height: 1.45;
}
.app-header .header-support {
    font-size: 0.72rem;
    opacity: 0.72;
    margin-top: 2px;
}

/* === TABS === */
.nav-tabs {
    border-bottom: 2px solid #2c6e49;
    padding: 0 16px;
    background: #f4f4f4;
}
.nav-tabs .nav-link {
    color: #555;
    font-weight: 600;
    font-size: 0.90rem;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 8px 20px;
    border-radius: 0;
    margin-bottom: -2px;
}
.nav-tabs .nav-link:hover {
    color: #2c6e49;
    border-bottom: 3px solid #a8d5b5;
    background: none;
}
.nav-tabs .nav-link.active {
    color: #2c6e49;
    border-bottom: 3px solid #2c6e49;
    background: white;
    font-weight: 700;
}
.tab-content {
    padding: 16px 16px;
}

/* === SIDE PANEL === */
.side-panel {
    background: #f4f4f4;
    border-radius: 6px;
    padding: 0;
    min-height: 580px;
    border: 1px solid #ddd;
    overflow: visible;
}
.panel-section {
    padding: 10px 14px;
    border-bottom: 1px solid #ddd;
}
.panel-section:last-child {
    border-bottom: none;
}
.panel-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2c6e49;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #ddd;
    margin: 0 0 8px 0;
    padding: 0 0 4px 0;
}

/* === OVERVIEW TABLE === */
.overview-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 18px 3px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.80rem;
    position: relative;
}
.overview-row:last-child { border-bottom: none; }
.overview-key {
    color: #666;
    flex-shrink: 0;
    margin-right: 8px;
}
/* Push info dots to far-right edge in panel rows (PISA-CA style) */
.overview-row .info-dot {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
/* In farm cards: dots sit inline, pushed right by flex */
.farm-card .info-dot {
    position: static;
    margin-left: auto;
    flex-shrink: 0;
}
/* Inline info dots in controls and chart headers */
.control-label .info-dot,
.mini-charts .info-dot {
    position: relative;
    margin-left: 3px;
}
.overview-val {
    font-weight: 700;
    color: #2c6e49;
    text-align: right;
    font-size: 0.82rem;
}

/* === FARM CARDS === */
.farm-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    position: relative;
}
.farm-card-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}
.farm-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid white;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.farm-name {
    font-weight: 700;
    font-size: 0.78rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.farm-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #555;
    margin-top: 2px;
}
.farm-val-measured { font-weight: 700; color: #2c6e49; }
.farm-val-estimated {
    font-weight: 700;
    color: #c05000;
    font-style: italic;
}
.farm-date { color: #999; font-size: 0.70rem; }
.farm-above  { color: #cc0000; font-weight: 600; }
.farm-below  { color: #1a5c2e; font-weight: 600; }
.farm-near   { color: #777; }
.farm-estimated-note {
    font-size: 0.68rem;
    color: #c05000;
    margin-top: 3px;
    font-style: italic;
}
.stat-divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}
.no-farms-msg { color: #aaa; font-size: 0.80rem; font-style: italic; }

/* === CONTROLS === */
.control-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    display: block;
}
.controls-row {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
    position: relative;
    z-index: 50;
}

/* === GRAPH === */
.graph-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px;
}

/* === FOOTER (matches PISA-CA) === */
.app-footer {
    background: #f0f4fa;
    border-top: 2px solid #245a3c;
    padding: 10px 20px;
    font-size: 0.72rem;
    color: #555;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.app-footer strong {
    color: #245a3c;
}
.footer-logos {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.footer-logo {
    height: 32px;
    opacity: 0.85;
}

/* === INFO BUTTON (PISA-CA circle style) === */
.info-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.20) !important;
    border: 1px solid rgba(255,255,255,0.50) !important;
    color: white !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    padding: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s;
}
.info-btn:hover {
    background: rgba(255,255,255,0.35) !important;
    color: white !important;
}

/* Modal section headings */
.info-section-title {
    color: #2c6e49;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Disclaimer box (PISA-CA style) */
.disclaimer-box {
    background: #fff8f0;
    border-left: 4px solid #c05000;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 18px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #555;
}
.disclaimer-box strong {
    color: #333;
}

/* === INFO DOT (PISA-CA muted sage style) === */
.info-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #b0c4b8;
    color: white;
    font-size: 9px;
    font-weight: 700;
    font-style: normal;
    cursor: default;
    vertical-align: middle;
    flex-shrink: 0;
    user-select: none;
}
/* Tooltip handled by tooltip.js (PISA-CA style fixed positioning) */

/* === GRAPH CAPTIONS (PISA-CA style) === */
.graph-caption {
    font-size: 0.70rem;
    color: #888;
    line-height: 1.4;
    border-top: 1px solid #eee;
    padding: 5px 6px 3px 6px;
    margin-top: 2px;
}
.graph-caption p { margin: 1px 0; }
.graph-caption strong { color: #555; }

/* Panel section info text */
.panel-caption {
    font-size: 0.68rem;
    color: #999;
    line-height: 1.4;
    border-top: 1px solid #eee;
    padding-top: 5px;
    margin-top: 6px;
}
.panel-caption p { margin: 1px 0; }
.panel-caption strong { color: #666; }

/* === GRAPH === */
.main-graph { height: 520px !important; }

/* === RESPONSIVE — tablet === */
@media (max-width: 992px) {
    .main-graph { height: 400px !important; }
    .side-panel { min-height: auto; margin-top: 12px; }
}

/* === RESPONSIVE — mobile === */
@media (max-width: 768px) {
    .app-header {
        flex-wrap: wrap;
        padding: 6px 12px;
        gap: 8px;
    }
    .app-header h1 { font-size: 1.0rem; }
    .app-header img { height: 44px; }
    .app-header p { font-size: 0.78rem; }
    .nav-tabs { padding: 0 6px; overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; }
    .nav-tabs .nav-link { padding: 7px 14px; font-size: 0.85rem; }
    .controls-row { padding: 10px 12px; }
    .main-graph { height: 360px; }
    .app-footer { flex-direction: column; gap: 6px; padding: 8px 12px; }
    .footer-logos { display: none; }
    .mini-charts { flex-direction: column !important; }
    .mini-charts > div { width: 100% !important; }
    .info-dot { width: 18px; height: 18px; font-size: 11px; }
}
