* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body { 
  font-family: Arial, sans-serif; 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 20px;
  min-height: 100vh;
}

.container { 
  max-width: 1200px; 
  margin: 0 auto; 
}

h1 { 
  text-align: center; 
  margin-bottom: 20px; 
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3); 
}

h2 {
  margin-bottom: 15px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab {
  padding: 12px 24px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.tab:hover { 
  background: rgba(255,255,255,0.2); 
}

.tab.active { 
  background: rgba(255,255,255,0.3); 
  font-weight: bold; 
}

.tab-content { 
  display: none; 
}

.tab-content.active { 
  display: block; 
}

/* Cards */
.card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* Zones */
.zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  margin-bottom: 10px;
}

.zone-name { 
  font-size: 18px; 
  font-weight: bold; 
}

.zone-temp { 
  font-size: 24px; 
  color: #4ade80; 
}

/* Inputs */
input[type="number"], 
input[type="time"] {
  padding: 8px;
  border-radius: 5px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 16px;
  width: 100px;
}

input[type="number"]:focus,
input[type="time"]:focus {
  outline: 2px solid #4ade80;
  background: rgba(255,255,255,0.3);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Buttons */
button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #4ade80;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

button:hover { 
  background: #22c55e; 
  transform: translateY(-2px); 
}

button:active { 
  transform: translateY(0); 
}

button.danger { 
  background: #ef4444; 
  color: #fff; 
}

button.danger:hover { 
  background: #dc2626; 
}

/* Status badges */
.status {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  margin: 5px;
  font-size: 14px;
}

.status.on { 
  background: #4ade80; 
  color: #000; 
}

.status.off { 
  background: #ef4444; 
}

/* Select */
select {
  padding: 8px;
  border-radius: 5px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

select:focus {
  outline: 2px solid #4ade80;
  background: rgba(255,255,255,0.3);
}

select option {
  background: #667eea;
  color: #fff;
}

/* Sensors grid */
.sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.sensor-item {
  background: rgba(255,255,255,0.05);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.sensor-value { 
  font-size: 28px; 
  color: #fbbf24; 
  margin-top: 10px; 
  font-weight: bold;
}

/* Logs */
.log-container {
  max-height: 500px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  padding: 15px;
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.log-entry {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.log-entry:last-child {
  border-bottom: none;
}

/* Schedule */
#scheduleList {
  max-height: 400px;
  overflow-y: auto;
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-bottom: 8px;
}

.schedule-time {
  font-size: 18px;
  font-weight: bold;
  color: #4ade80;
}

.schedule-temp {
  font-size: 16px;
  color: #fbbf24;
}

/* Chart */
.chart-container {
  position: relative;
  height: 400px;
  background: rgba(255,255,255,0.1);
  padding: 15px;
  border-radius: 10px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.5);
}

/* Text / Password inputs */
input[type="text"],
input[type="password"] {
  padding: 8px;
  border-radius: 5px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 16px;
  width: 220px;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: 2px solid #4ade80;
  background: rgba(255,255,255,0.3);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: rgba(255,255,255,0.5);
}

/* Settings form groups */
.form-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.form-group label {
  min-width: 220px;
  margin-right: 0;
}

/* MQTT status badge */
.mqtt-status {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
}

.mqtt-status.on {
  background: #4ade80;
  color: #000;
}

.mqtt-status.off {
  background: #6b7280;
  color: #fff;
}

.mqtt-status.warn {
  background: #fbbf24;
  color: #000;
}

/* Labels */
label {
  font-size: 14px;
  margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .zone {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .tabs {
    justify-content: center;
  }
  
  .sensor-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
