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

*,
*::before,
*::after {
    max-width: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: white;
    min-height: 100vh;
    line-height: 1.5;
}

html, body {
  overscroll-behavior: none;
  overflow-x: hidden;
  max-width: 100%;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
  position: fixed;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  header {
    padding: 1rem;
  }
}

header h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 300;
}

.logo {
  color: black;
  font-family: 'DM Sans', sans-serif;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

nav button {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  background: none;
  border: none;
  color: black;
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s ease;

}

nav button:hover {
  transform: scale(1.1);
  text-decoration: underline;
}

#home-section h2 {
  font-size: 5rem;
  text-align: center;
}

#manual-section {
  text-align: left;
  font-size: 30px;
}

#analytics-section {
  text-align: left;
  font-size: 30px;
}

#about-section {
  text-align: left;
  font-size: 30px;
}

#about-section p {
  font-size: 20px;
  padding-top: 40px;
}

#dashboard-section {
  text-align: left;
  font-size: 30px;
}

.github-button {
  background-color: black;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  cursor: pointer;
  display: inline-block;
  transition: all 0.3s ease;
  transform: scale(1);
}

.github-button:hover {
  background-color: #1cd760;
  transform: scale(1.1);
}

.gauges-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 2rem auto;
  flex-wrap: wrap;
}

.gauge-wrapper {
  flex: 1;
  min-width: 300px;
  max-width: 400px;
}

#phGaugeChart, #tdsGaugeChart, #waterLevelGaugeChart {
  width: 100%;
  height: 300px;
}

#lineChart {
  width: 100%;
  max-width: 1200px;
  height: 400px;
  margin: 2em auto;
}

@media (max-width: 768px) {
  .gauges-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .gauge-wrapper {
    min-width: 280px;
  }
  
  #phGaugeChart, #tdsGaugeChart, #waterLevelGaugeChart {
    height: 250px;
  }
  
  #lineChart {
    height: 300px;
  }
}

.page-section {
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

.page-section h2 {
  margin-bottom: 1rem;
  color: black;
}

.cursor {
  animation: blink 1s infinite;
  color: black;
  font-size: 5rem;
  font-weight: 300;
}

spline-viewer {
  width: 100%;
  max-width: 400px;
  height: 500px;
  border-radius: 10px;
  margin: 45px auto;
  display: block;
}

.about-image {
  max-width: 75%;
  height: auto;
  border-radius: 10px;
  margin: 2rem auto;
  display: block;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ==========================================
   MANUAL TEST CONTROLS STYLING
   ========================================== */

.test-controls-container {
  max-width: 900px;
  margin: 3rem auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 2px dashed rgba(255, 193, 7, 0.3);
}

.test-controls-container h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.test-warning {
  color: #ff9800;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  font-weight: 500;
}

.control-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.control-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.control-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.control-card h4 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #333;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.control-btn {
  flex: 1;
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.control-btn.loading {
  animation: pulse 1.5s infinite;
}

.pump-on, .spray-on {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
}

.pump-on:hover:not(:disabled), .spray-on:hover:not(:disabled) {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: scale(1.05);
}

.pump-off, .spray-off {
  background: linear-gradient(135deg, #f44336, #da190b);
  color: white;
}

.pump-off:hover:not(:disabled), .spray-off:hover:not(:disabled) {
  background: linear-gradient(135deg, #da190b, #c41408);
  transform: scale(1.05);
}

.btn-icon {
  font-size: 1.2rem;
}

.status-indicator {
  text-align: center;
  padding: 0.5rem;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #666;
}

.status-indicator span {
  font-weight: 600;
  margin-left: 0.3rem;
}

.status-indicator .status-on {
  color: #4CAF50;
}

.status-indicator .status-off {
  color: #666;
}

.status-indicator .status-error {
  color: #f44336;
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
  z-index: 10000;
  max-width: 300px;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  border-left: 4px solid #4CAF50;
  color: #4CAF50;
}

.notification-error {
  border-left: 4px solid #f44336;
  color: #f44336;
}

.notification-info {
  border-left: 4px solid #2196F3;
  color: #2196F3;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Responsive design */
@media (max-width: 768px) {
  .control-group {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  .notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Single control card (centered) */
.control-card-single {
  max-width: 500px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.control-card-single:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.control-card-single h4 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #333;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
  text-align: center;
}

.control-card-single .button-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.control-card-single .status-indicator {
  font-size: 1rem;
}

/* ==========================================
   SYSTEM ALERTS STYLING
   ========================================== */

.alerts-container {
  max-width: 900px;
  margin: 3rem auto;
  padding: 2rem;
}

.alerts-container h3 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.alert-placeholder {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  border-left: 5px solid #4CAF50;
  padding: 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #2E7D32;
  font-weight: 600;
}

.alert-placeholder .checkmark {
  font-size: 2rem;
  margin-right: 1rem;
  color: #4CAF50;
}

.alert {
  display: flex;
  align-items: flex-start;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-out;
  border-left: 5px solid;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-critical {
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
  border-left-color: #D32F2F;
}

.alert-warning {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border-left-color: #F57C00;
}

.alert-info {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  border-left-color: #1976D2;
}

.alert-icon {
  font-size: 2.5rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #333;
}

.alert-critical .alert-title {
  color: #C62828;
}

.alert-warning .alert-title {
  color: #E65100;
}

.alert-info .alert-title {
  color: #0D47A1;
}

.alert-message {
  font-size: 1rem;
  color: #555;
  line-height: 1.5;
}

/* Pulse animation for critical alerts */
.alert-critical {
  animation: slideIn 0.3s ease-out, pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
  }
  50% {
    box-shadow: 0 4px 25px rgba(211, 47, 47, 0.6);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .alerts-container {
    padding: 1rem;
  }

  .alert {
    flex-direction: column;
    text-align: center;
  }

  .alert-icon {
    margin-bottom: 1rem;
  }

  .alert-title {
    font-size: 1.1rem;
  }

  .alert-message {
    font-size: 0.9rem;
  }
}
