/* ========================================
   INDEX PAGE STYLES - Dashboard
   Стилі для головної сторінки (дашборд)
======================================== */

/* ========== HEADER ========== */
header {
  text-align: center;
  padding: 40px 0;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

header p {
  color: #888;
  font-size: 1.1rem;
}

/* ========== LANGUAGE SELECTOR - Override ========== */
.lang-selector {
  position: absolute;
  top: 20px;
  right: 20px;
}

/* ========== STATUS GRID ========== */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

/* ========== METRICS ========== */
.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metric:last-child {
  border-bottom: none;
}

.metric-label {
  color: #888;
  font-size: 0.9rem;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.metric-value.temp {
  color: #ff9f43;
}

.metric-value.humidity {
  color: #54a0ff;
}

.metric-value.users {
  color: #a29bfe;
}

/* ========== MQTT STATUS ========== */
.mqtt-status {
  text-align: center;
  padding: 20px;
  background: rgba(0, 255, 136, 0.1);
  border-radius: 10px;
  margin-top: 20px;
}

.mqtt-status.disconnected {
  background: rgba(255, 68, 68, 0.1);
}

/* ========== DEVICE SELECTOR ========== */
.device-selector {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.device-selector h3 {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-input-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.device-input-group input {
  flex: 1;
  min-width: 200px;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1rem;
}

.device-input-group button {
  padding: 12px 25px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: #000;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.device-input-group button:hover {
  transform: scale(1.05);
}

.current-device {
  margin-top: 15px;
  padding: 10px 15px;
  background: rgba(0, 255, 136, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-device.no-device {
  background: rgba(255, 68, 68, 0.1);
}

/* ========== INSTRUCTIONS ========== */
.instructions {
  background: rgba(0, 136, 204, 0.1);
  border-radius: 10px;
  padding: 15px;
  margin-top: 15px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.instructions code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* ========== FILTER BUTTONS ========== */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.filter-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #888;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-btn.active {
  background: rgba(0, 255, 136, 0.2);
  border-color: #00ff88;
  color: #00ff88;
}

.filter-btn.filter-feed.active {
  background: rgba(255, 159, 67, 0.2);
  border-color: #ff9f43;
  color: #ff9f43;
}

.filter-btn.filter-error.active {
  background: rgba(255, 68, 68, 0.2);
  border-color: #ff4444;
  color: #ff4444;
}

.filter-btn.filter-status.active {
  background: rgba(84, 160, 255, 0.2);
  border-color: #54a0ff;
  color: #54a0ff;
}

.filter-btn.filter-data.active {
  background: rgba(162, 155, 254, 0.2);
  border-color: #a29bfe;
  color: #a29bfe;
}

/* ========== MQTT LOG ========== */
.mqtt-log {
  max-height: 300px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 10px;
}

.mqtt-log-item {
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

.mqtt-log-item.incoming {
  border-left: 3px solid #00ff88;
}

.mqtt-log-item.outgoing {
  border-left: 3px solid #54a0ff;
}

/* ========== REFRESH INFO ========== */
.refresh-info {
  text-align: center;
  color: #666;
  font-size: 0.8rem;
  margin-top: 20px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.8rem;
  }

  .device-input-group {
    flex-direction: column;
  }

  .device-input-group input {
    min-width: 100%;
  }

  .lang-selector {
    position: relative;
    top: 0;
    right: 0;
    justify-content: center;
    margin-bottom: 20px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}
