/* ============================================================
   GLOBAL
   ============================================================ */

body {
  background: #f5f5f5;
  color: #222;
  transition: background 0.3s, color 0.3s;
}

.dark-mode {
  background: #1e1e1e !important;
  color: #e0e0e0 !important;
}

.dark-mode .card {
  background: #2c2c2c !important;
  color: #e0e0e0 !important;
}

.dark-mode .navbar {
  background: #111 !important;
}

.dark-mode input,
.dark-mode select,
.dark-mode textarea {
  background: #333 !important;
  color: #fff !important;
  border-color: #555 !important;
}

.dark-mode input::placeholder {
  color: #aaa;
}

/* ============================================================
   DASHBOARD GRID
   ============================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 120px;
  gap: 10px;
  width: 100%;
  min-height: 600px;
  background: #e9ecef;
  padding: 10px;
  border-radius: 8px;
}

.dark-mode .dashboard-grid {
  background: #2a2a2a;
}

/* ============================================================
   DASHBOARD TILE
   ============================================================ */

.dashboard-item {
  background: white;
  border-radius: 8px;
  padding: 10px;
  cursor: grab;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #ddd;
  transition: background 0.2s, border 0.2s;
}

.dashboard-item:active {
  cursor: grabbing;
}

.dark-mode .dashboard-item {
  background: #333;
  border-color: #555;
}

/* ============================================================
   TILE HEADER
   ============================================================ */

.tile-header {
  font-weight: bold;
  font-size: 16px;
  background: #e9ecef;
  padding: 5px 8px;
  border-radius: 5px;
  text-align: center;
}

.dark-mode .tile-header {
  background: #444;
  color: #fff;
}

/* ============================================================
   TILE VALUE
   ============================================================ */

.tile-value {
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  margin-top: 10px;
  color: #333;
}

.dark-mode .tile-value {
  color: #fff;
}

/* ============================================================
   MQTT LOG
   ============================================================ */

#log {
  background: #000;
  color: #0f0;
  padding: 10px;
  height: 250px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  border-radius: 5px;
}

.dark-mode #log {
  background: #111;
  color: #0f0;
}

/* ============================================================
   BUTTONS / LISTEN
   ============================================================ */

#buttonList div,
#displayList div {
  padding: 5px 0;
  border-bottom: 1px solid #ddd;
}

.dark-mode #buttonList div,
.dark-mode #displayList div {
  border-color: #444;
}

/* ============================================================
   FORMS
   ============================================================ */

input,
select,
textarea {
  border-radius: 5px !important;
}

button.btn {
  border-radius: 5px !important;
}

/* ============================================================
   DARK MODE BUTTON COLORS
   ============================================================ */

.dark-mode .btn-primary {
  background: #0066cc;
}

.dark-mode .btn-danger {
  background: #cc0000;
}

.dark-mode .btn-warning {
  background: #cc8800;
}

.dark-mode .btn-success {
  background: #009933;
}
