/* 
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
*/

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

.controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  align-items: center;
  padding: 0 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.form-container {
  margin-bottom: 20px;
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #eaedfa;
  border-radius: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin: 0 10px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #2196f3;
}

input:focus + .toggle-slider {
  box-shadow: 0 0 1px #2196f3;
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  font-weight: bold;
}

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

.form-group {
  margin-bottom: 10px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input[type="text"],
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #2980b9;
}

#add-transition-button {
  background-color: #2ecc71;
}

#add-transition-button:hover {
  background-color: #27ae60;
}

#reset-button {
  background-color: #e74c3c;
}

#reset-button:hover {
  background-color: #c0392b;
}

#show-path-button {
  background-color: #9c27b0;
}

#show-path-button:hover {
  background-color: #7b1fa2;
}

.node-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

select {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 14px;
}

#cy-container {
  width: 100%;
  height: 600px;
  background-color: white;
  border-radius: 4px;
  border: 1px solid #eee;
  overflow: hidden;
}

.legend {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.legend h2 {
  font-size: 18px;
  margin-bottom: 15px;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

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

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 10px;
}

.legend-start {
  background-color: #4caf50;
}

.legend-action {
  background-color: #2196f3;
}

.legend-decision {
  background-color: #9c27b0;
}

.legend-end {
  background-color: #f44336;
}

/* Tooltip styles */
.tooltip {
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  position: absolute;
  z-index: 1000;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Status message styles */
.status-message {
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 4px;
  display: none;
}

.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Responsiveness */
@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

.plan-title-container {
  text-align: center;
  margin-bottom: 15px;
}

#plan-title {
  font-size: 1.5rem;
  color: #333;
  margin: 0;
  padding: 5px 10px;
  display: inline-block;
}
