/* Custom styles for chaos game interactive elements */
.d-flex { display: flex; }
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-content-center { justify-content: center; }
.justify-content-around { justify-content: space-around; }
.p-2 { padding: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

.btn-group {
  display: inline-flex;
  vertical-align: middle;
}

.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background-color: var(--theme);
  color: var(--primary);
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.btn:hover {
  background-color: var(--entry);
  border-color: var(--primary);
}

.btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.btn:not(:first-child):not(:last-child) {
  border-radius: 0;
}

.btn-group .btn + .btn {
  margin-left: -1px;
}

.btn.active {
  background-color: var(--tertiary);
  border-color: var(--primary);
}

.btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.5rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--primary);
  background-color: var(--theme);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary);
  outline: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -5px;
  margin-left: -5px;
  align-items: center;
  gap: 0.5rem;
}

.form-inline {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
}

.input-group-prepend {
  display: flex;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--primary);
  text-align: center;
  white-space: nowrap;
  background-color: var(--entry);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
}


/* Override Bootstrap styles to match theme */
.btn-secondary {
  background-color: var(--theme) !important;
  border-color: var(--border) !important;
  color: var(--primary) !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--entry) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.btn-secondary.active,
.btn-secondary:active {
  background-color: var(--tertiary) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.form-control {
  background-color: var(--theme) !important;
  border-color: var(--border) !important;
  color: var(--primary) !important;
}

.form-control:focus {
  background-color: var(--theme) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25) !important;
}

.input-group-text {
  background-color: var(--entry) !important;
  border-color: var(--border) !important;
  color: var(--primary) !important;
}

/* Custom tooltip styling */
.tooltip .tooltip-inner {
  background-color: var(--entry) !important;
  color: var(--primary) !important;
  border: 1px solid var(--border) !important;
}

.tooltip.bs-tooltip-top .arrow::before {
  border-top-color: var(--border) !important;
}

.tooltip.bs-tooltip-bottom .arrow::before {
  border-bottom-color: var(--border) !important;
}

.tooltip.bs-tooltip-left .arrow::before {
  border-left-color: var(--border) !important;
}

.tooltip.bs-tooltip-right .arrow::before {
  border-right-color: var(--border) !important;
}

