/* style.css */
:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --light: #ecf0f1;
    --dark: #333;
    --white: #fff;
    --success: #27ae60;
    --warning: #f39c12;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; }

body { background: var(--light); color: var(--dark); }

/* --- GRID LAYOUT (The Core Task) --- */
.grid-container {
    display: grid;
    height: 100vh;
    /* MOBILE LAYOUT (Default) */
    grid-template-columns: 1fr;
    grid-template-rows: 70px auto 1fr 50px;
    grid-template-areas: 
        "header"
        "sidebar"
        "main"
        "footer";
}

/* --- GRID AREAS --- */
.header {
    grid-area: header;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar {
    grid-area: sidebar;
    background: #34495e;
    color: #bdc3c7;
    padding: 15px;
    overflow-y: auto;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.main-content {
    grid-area: main;
    padding: 20px;
    overflow-y: auto;
}

.footer {
    grid-area: footer;
    background: var(--primary);
    color: #bdc3c7;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
}

/* --- RESPONSIVE DESKTOP LAYOUT (Media Query) --- */
@media (min-width: 768px) {
    .grid-container {
        /* Sidebar on Left (260px), Main Content on Right */
        grid-template-columns: 260px 1fr;
        grid-template-rows: 70px 1fr 50px;
        grid-template-areas: 
            "header header"
            "sidebar main"
            "footer footer";
    }
    .sidebar { border-right: 1px solid rgba(255,255,255,0.1); border-bottom: none; }
}

/* --- COMPONENT STYLES --- */
h2 { margin-bottom: 15px; color: var(--primary); }

/* Sensor Selection List in Sidebar */
.sensor-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sensor-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: 0.2s;
}

.sensor-option:hover { background: rgba(255,255,255,0.1); }
.sensor-option input { cursor: pointer; transform: scale(1.2); }

/* Buttons */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-nav { background: var(--accent); color: white; text-decoration: none; font-size: 0.9rem; }
.btn-nav:hover { background: #2980b9; }

/* Dashboard Cards Grid */
.dashboard-grid {
    display: grid;
    /* Auto-fit magic for responsive cards */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-top: 4px solid var(--accent);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s;
}

.card:hover { transform: translateY(-3px); }

.card-header { display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
.card-value { font-size: 1.8rem; font-weight: bold; color: var(--dark); }
.card-status { font-size: 0.85rem; padding: 3px 8px; border-radius: 10px; background: #eee; }

/* Info Page Specifics */
.info-grid {
    display: grid;
    gap: 20px;
}
.info-item {
    background: white;
    padding: 20px;
    border-left: 5px solid var(--success);
    border-radius: 5px;
}