/* main.css */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #dff7df, #fff6e5);
  color: #333;
}

.container {
  width: 95%;
  max-width: 950px;
  margin: 30px auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

header {
  text-align: center;
  margin-bottom: 25px;
}

header h1 {
  margin: 0;
  font-size: 32px;
  color: #2c3e50;
  font-weight: 700;
}

.subtitle {
  font-size: 18px;
  color: #16a085;
  margin-top: 8px;
  font-weight: 700;
}

.card {
  background: #f7f9fc;
  border: 1px solid #d1e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
}

.card h2 {
  margin-top: 0;
  color: #e67e22;
  font-weight: 700;
}

#instructions p {
  font-size: 16px;
  line-height: 1.6;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.point-options label,
.parameters label {
  margin-right: 10px;
  font-size: 16px;
  font-weight: 700;
}

.point-options input {
  margin-right: 5px;
}

.action-buttons {
  margin: 10px 0;
}

button {
  padding: 10px 18px;
  margin: 5px;
  font-size: 16px;
  border: none;
  background-color: #2980b9;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 700;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: #3498db;
  transform: scale(1.03);
}

.parameters input[type="range"] {
  vertical-align: middle;
  margin: 0 10px;
}

canvas {
  display: block;
  margin: 25px auto;
  max-width: 100%;
  height: auto;
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  background-color: #ecf0f1;
}

#iterationDisplay {
  text-align: center;
  font-weight: 700;
  font-size: 20px;
  margin-top: 15px;
  color: #d35400;
}

/* Add styles for the legend */
.legend {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  gap: 30px;
}

.legend-item {
  display: flex;
  align-items: center;
  font-weight: 600;
}

.color-box {
  width: 20px;
  height: 10px;
  margin-right: 8px;
  border-radius: 2px;
}

.color-box.current {
  background-color: #2ecc71;
}

.color-box.best {
  background-color: #9b59b6;
  border: 1px dashed #000;
}

/* Make the buttons more distinguishable */
#showBestBtn {
  background-color: #9b59b6;
}

#showBestBtn:hover {
  background-color: #8e44ad;
}

#resetBtn {
  background-color: #e74c3c;
}

#resetBtn:hover {
  background-color: #c0392b;
}

#startBtn {
  background-color: #2980b9;
}

#startBtn:hover {
  background-color: #3498db;
}

#stepBtn {
  background-color: #f39c12;
}

#stepBtn:hover {
  background-color: #f1c40f;
}

#autoBtn {
  background-color: #27ae60;
}

#autoBtn:hover {
  background-color: #2ecc71;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    width: 95%;
    margin: 15px auto;
    padding: 15px;
  }
  
  header h1 {
    font-size: 24px;
  }
  
  .subtitle {
    font-size: 16px;
  }
  
  .card {
    padding: 15px;
  }
  
  #controls {
    display: block;
  }
  
  .action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  button {
    padding: 8px 14px;
    font-size: 14px;
  }
  
  .parameters {
    margin: 15px 0;
  }
  
  .legend {
    flex-wrap: wrap;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    width: 98%;
    margin: 10px auto;
    padding: 10px;
  }
  
  header h1 {
    font-size: 20px;
  }
  
  .subtitle {
    font-size: 14px;
  }
  
  .card {
    padding: 10px;
  }
  
  #instructions p {
    font-size: 14px;
  }
  
  button {
    padding: 7px 12px;
    font-size: 13px;
    margin: 3px;
  }
  
  .point-options label,
  .parameters label {
    font-size: 14px;
  }
  
  #iterationDisplay {
    font-size: 16px;
  }
}
