body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  overflow: hidden; /* Prevent scrolling on the body */
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#panel {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 380px;
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

#panel.route-active .complete-stop-cb {
    display: inline-block;
}

h2 {
  margin-top: 0;
  color: #333;
}

p {
  font-size: 0.9em;
  color: #666;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 0.9em;
}

.input-group input[type="text"] {
  width: calc(100% - 20px);
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.stop-group {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: grab;
  user-select: none;
  padding: 5px;
  border-radius: 4px;
}

.stop-group.dragging {
  opacity: 0.5;
  background: #f0f8ff; /* AliceBlue */
}

.stop-group.completed {
    background-color: #f0fff0; /* Honeydew */
}

.stop-group.completed .stop-input {
    text-decoration: line-through;
    color: #888;
}

.stop-group input.stop-input {
  flex-grow: 1;
  width: auto;
}

.complete-stop-cb {
    display: none;
    margin-right: 5px;
}

button {
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f0f0f0;
  cursor: pointer;
  margin-top: 5px;
}

button:hover {
  background-color: #e0e0e0;
}

.button-primary {
  background-color: #1a73e8;
  color: white;
  border-color: #1a73e8;
  width: 100%;
  margin-top: 10px;
}

.button-primary:hover {
  background-color: #2865c2;
}

.remove-stop-btn {
  padding: 0;
  border: none;
  background: none;
  color: #666;
  cursor: pointer;
}

.remove-stop-btn:hover {
  color: #d32f2f;
}

.remove-stop-btn .material-icons {
  font-size: 20px;
}

#error-display {
  margin-top: 15px;
  color: #d32f2f;
  font-weight: bold;
  display: none;
}

#results-panel {
  margin-top: 20px;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #eee;
}

#results-panel h3 {
  margin-top: 0;
}

#results-panel p {
  margin: 5px 0;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.collapsible-header h3 {
    margin: 0;
    font-size: 1.1em;
}

.toggle-icon {
    color: #666;
}

.collapsible-content {
    overflow-y: auto;
    transition: max-height 0.3s ease-in-out, padding-top 0.3s ease-in-out;
    padding-top: 15px;
    flex-shrink: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
}

#inputs-container {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    #panel {
        width: 100%;
        height: 100%;
        max-height: 100%;
        left: 0;
        top: 0;
        border-radius: 0;
        box-shadow: none;
    }
}
