/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e5e7eb;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Styles */
.header {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.header h1 {
  color: #22d3ee;
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header h1 i {
  color: #10b981;
}

.status-indicator {
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(34, 211, 238, 0.3);
}

/* Control Panel Styles */
.control-panel {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(34, 211, 238, 0.1);
}

.control-panel h2 {
  color: #22d3ee;
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.relay-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.relay-card {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  transition: all 0.3s ease;
}

.relay-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 211, 238, 0.1);
}

.relay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.relay-header h3 {
  color: #e5e7eb;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.relay-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  color: #94a3b8;
  font-size: 0.9rem;
}

.relay-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  min-width: 100px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-on {
  background: linear-gradient(135deg, #10b981, #059669);
}

.btn-on:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-off {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-off:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Data Dashboard Styles */
.data-dashboard {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(34, 211, 238, 0.1);
}

.data-dashboard h2 {
  color: #22d3ee;
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 100%;
}

.card {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22d3ee, #10b981);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 211, 238, 0.1);
}

.card h3 {
  color: #22d3ee;
  font-size: 1.1rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.value {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-align: center;
  background: rgba(34, 211, 238, 0.1);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  flex-shrink: 0;
}

iframe {
  width: 100%;
  height: 250px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  flex: 1;
  min-height: 200px;
}

/* Status States */
.onstate {
  color: #10b981;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.offstate {
  color: #ef4444;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .relay-controls {
    grid-template-columns: 1fr;
  }
  
  .relay-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .relay-buttons {
    width: 100%;
  }
  
  .btn {
    flex: 1;
  }
  
  .dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .card {
    padding: 16px;
  }
  
  .value {
    font-size: 1.6rem;
    padding: 10px;
  }
  
  iframe {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5rem;
  }
  
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 12px;
  }
  
  .value {
    font-size: 1.4rem;
    padding: 8px;
  }
  
  iframe {
    height: 180px;
  }
}
