/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #2D3E40; background: #F5F5F5; line-height: 1.6; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ========== Hero ========== */
.hero {
    background: #FFFFFF;
    color: #2D3E40; padding: 60px 0 40px; text-align: center;
}
.hero h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: 2px; }
.hero .accent { color: #2E8B57; }
.hero-sub { font-size: 1.1rem; color: #8A9997; margin-top: 14px; max-width: 520px; margin-left: auto; margin-right: auto; }
.hero-image { margin-top: 28px; text-align: center; }
.hero-image img { max-width: 560px; width: 88%; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* ========== Section Title ========== */
.section-title { text-align: center; font-size: 1.7rem; font-weight: 700; margin-bottom: 8px; color: #2D3E40; }
.section-desc { text-align: center; color: #8A9997; margin-bottom: 32px; font-size: 0.95rem; }

/* ========== Devices ========== */
.devices { padding: 50px 0 40px; }
.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.loading { text-align: center; color: #aaa; padding: 40px; font-size: 1rem; width: 100%; }

/* ========== Device Card ========== */
.device-card {
    background: #FFFFFF; border-radius: 16px; padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s; cursor: pointer;
    min-width: 0;
}
.device-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(46,139,87,0.12); }
.device-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.device-name { font-size: 1.1rem; font-weight: 600; color: #2D3E40; }
.device-product { font-size: 0.82rem; color: #8A9997; margin-top: 2px; }
.device-status { font-size: 0.78rem; padding: 3px 10px; border-radius: 12px; font-weight: 500; }
.device-status.online { background: #E8F5E9; color: #2E7D32; }
.device-status.offline { background: #F0F0F0; color: #999; }

/* 3x2 Data Grid (sensors + actuators unified) */
.data-grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 18px 4px; border-radius: 10px; background: #EAF2EE;
    min-height: 90px;
}
.grid-item.active { background: #D4E8DF; }
.grid-header { display: flex; align-items: center; margin-bottom: 2px; }
.grid-icon { font-size: 0.85rem; margin-right: 2px; }
.grid-label { font-size: 0.72rem; color: #6A9B89; }
.grid-status { font-size: 0.72rem; color: #6A9B89; }
.grid-row { display: flex; width: 100%; justify-content: center; gap: 8px; }
.grid-val { font-size: 0.92rem; font-weight: 700; color: #2D3E40; line-height: 1.3; }
.grid-val.on { color: #6A9B89; }
.grid-sub { font-size: 0.62rem; color: #8A9997; flex: 1; text-align: center; }

/* Care Score (used in radar card header) */
.care-score-value { font-size: 1.1rem; font-weight: 700; }
.care-score-value.good { color: #2E7D32; }
.care-score-value.ok { color: #EF6C00; }
.care-score-value.bad { color: #C62828; }

/* Radar card (in device grid) */
.radar-card { display: flex; flex-direction: column; }
.radar-card canvas { max-height: 260px; margin-top: 8px; }

.snapshot-time { font-size: 0.72rem; color: #C8D8D0; margin-top: 8px; text-align: right; }

/* ========== Chart Section ========== */
.chart-section { padding: 50px 0 60px; background: #FFFFFF; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-card { background: #F9F7F1; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; min-width: 0; }
.chart-card h3 { font-size: 0.88rem; color: #8A9997; margin-bottom: 12px; text-align: center; }
.chart-card canvas { max-height: 220px; width: 100%; }
.chart-card.radar { text-align: center; }

/* ========== About ========== */
.about { padding: 50px 0; background: #FFFFFF; }
.about-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 24px; }
.about-card { padding: 24px 20px; border-radius: 14px; background: #F9F7F1; }
.about-card h3 { font-size: 1.05rem; margin-bottom: 8px; color: #2D3E40; }
.about-card p { font-size: 0.88rem; color: #8A9997; line-height: 1.6; }
.about-image { text-align: center; margin-top: 28px; }
.about-image img { max-width: 420px; width: 80%; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

/* ========== Footer ========== */
.footer { background: #2D3E40; color: rgba(255,255,255,0.6); text-align: center; padding: 24px; font-size: 0.85rem; }

/* ========== Responsive ========== */
@media (max-width: 800px) {
    .hero h1 { font-size: 1.8rem; }
    .hero-sub { font-size: 1rem; }
    .device-grid,
    .chart-grid { grid-template-columns: 1fr; max-width: 540px; margin-left: auto; margin-right: auto; }
    .about-content { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .about-content { grid-template-columns: 1fr; }
}
