/* =====================================================================
   hive.css — shared stylesheet for all HiveMonitor pages
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+3:wght@300;400;600&display=swap');

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────────────── */
body {
    font-family: 'Source Sans 3', Arial, sans-serif;
    background: #1C1410;
    color: #F0E8D8;
    padding: 20px;
}

h1 {
    font-family: 'Playfair Display', serif;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 6px;
    color: #F0E8D8;
}

h2 { text-align: center; margin-bottom: 12px; }

.no-data { color: #666; }

/* ── Site header with logo ──────────────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    border-bottom: 3px solid #E8A020;
    padding-bottom: 12px;
}

.site-header a.logo-link {
    flex-shrink: 0;
    display: block;
    line-height: 0;
}

.site-header img.site-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.site-header .header-title {
    flex: 1;
    text-align: center;
    /* offset the logo width so title appears visually centered */
    padding-right: 76px;
}

/* ── Chart (shared by hivemonitor + hivehistory) ────────────────────── */
#chart_div { width: 100%; min-height: 360px; }

/* ── Dashboard — hivemonitor.php ────────────────────────────────────── */
.timestamp {
    text-align: center;
    color: #B0A898;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.countdown {
    text-align: center;
    font-size: 1.1rem;
    color: #E8A020;
    margin-bottom: 16px;
}

/* Timeframe selector */
.timeframe-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tf-btn {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    background: #2A1F14;
    color: #B0A898;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid #5a4a38;
    transition: background 0.2s, color 0.2s;
}

.tf-btn:hover  { background: #3a2a1c; color: #F0E8D8; }
.tf-btn.active { background: #E8A020; color: #2C1A0E; border-color: #E8A020; font-weight: bold; }

/* Environment cards row */
.env-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.card-env {
    background: #2A1F14;
    border-radius: 12px;
    padding: 24px 40px;
    text-align: center;
    min-width: 160px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.card-env .label { font-size: 1rem; color: #B0A898; margin-bottom: 8px; }
.card-env .temp  { font-size: 3rem; font-weight: bold; }

/* Hive card grid */
.hive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.card-hive {
    background: #2A1F14;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.card-env.active,
.card-hive.active {
    border-color: #E8A020;
    background: #3a2a0e;
}

.card-env:hover,
.card-hive:hover {
    border-color: #5a4a38;
}

.card-hive .hive-logo {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin: 0 auto 8px;
}

.card-hive .hive-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 14px;
    color: #F0E8D8;
    border-bottom: 1px solid #4a3a28;
    padding-bottom: 10px;
}

.card-hive .sensor-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 6px 0;
}

.card-hive .sensor-label { color: #B0A898; font-size: 0.85rem; }
.card-hive .sensor-val   { font-size: 1.5rem; font-weight: bold; }

/* Chart section heading */
#chart-section h3 {
    text-align: center;
    color: #B0A898;
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 8px;
}

/* View mode selector (above chart) */
.viewmode-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.vm-label {
    color: #B0A898;
    font-size: 0.8rem;
    margin-right: 4px;
}

.vm-btn {
    padding: 4px 14px;
    border-radius: 14px;
    background: #2A1F14;
    color: #B0A898;
    border: 1px solid #5a4a38;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.vm-btn:hover  { background: #3a2a1c; color: #F0E8D8; }
.vm-btn.active { background: #E8A020; color: #2C1A0E; border-color: #E8A020; font-weight: bold; }

/* ── Diagnostics table — hivediag.php ───────────────────────────────── */
table { border-collapse: collapse; width: 100%; }

th {
    background: #2A1F14;
    padding: 6px 8px;
    text-align: left;
    position: sticky;
    top: 0;
    border-bottom: 2px solid #E8A020;
}

td { padding: 4px 8px; border-bottom: 1px solid #3a2a1c; }

tr:hover td { background: #2A1F14; }
