/* Add at the top to test if CSS is loading */
body {
  /*background: #f1eeea;
  font-family: var(--font-family);*/
}

/* Basic reset */
html,
body {
 /* margin: 0;
  padding: 0;*/
}

canvas {
  display: block;
  background-color: #f1eeea;
}

/* Logo styling */
.logo {
  position: fixed;
  top: 20px;
  left: 20px;
  font-family: var(--font-family);
  font-size: 48px;
  color: black;
  line-height: 0.95;
  text-align: left;
  background-color: #f1eeea; /* Match the background color */
}

.logo .light {
  font-weight: 400;
  font-size: 41px;
}

.logo .bold {
  font-weight: 700;
  font-style: italic;
}

/* Controls sidebar */
.toggle-container {
  width: 360px;
  flex-shrink: 0;
  overflow-y: auto;
  background-color: #f1eeea;
  border-left: 1px solid black;
  z-index: 10;
}

/* panel-toggle removed */

/* Controls: 2-column grid inside the sidebar */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  /*border: 1px solid black;*/
  border-right: none;
  border-left: none;
  box-sizing: border-box;
  width: 100%;
}

/* Ensure all control pairs have right borders */
.control-pair {
  display: flex;
  flex-direction: column;
  border-right: 1px solid black;
  flex: 1 1 auto;
  box-sizing: border-box;
}

/* Right column in the 2-col grid has no right border */
.control-pair:nth-child(even) {
  border-right: none;
}

/* Color column styling */
.color-column {
  display: flex;
  flex-direction: column;
  border-right: none;
}

.color-column .color-cell {
  flex: 1;
  height: 40px;
  border-bottom: 1px solid black;
  cursor: pointer;
  position: relative;
}

.color-column .color-cell:last-child {
  border-bottom: none;
}

/* Add active indicator for color cells */
.color-cell {
  position: relative;
}

.color-cell::before {
  content: "off";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #f1eeea;
  font-family: var(--font-family);
  font-size: 11.34px;
  font-weight: 700;
  text-transform: lowercase;
  z-index: 2;
  pointer-events: none;
}

.color-cell.active::before {
  content: "on";
}

/* Remove old checkmark styling */
.color-cell.active::after {
  display: none;
}

/* Remove horizontal color controls styling */
.color-controls {
  display: none;
}

/* Each control group is a self-contained unit with flex */
.slider-group,
.toggle-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  flex: 1;
  /* Use flex to ensure consistent height */
  height: calc(100% / 2);
  box-sizing: border-box;
}

/* Label row styling - adjust padding */
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 15px; /* Slightly increased padding for readability */
  border-bottom: 1px solid black;
  box-sizing: border-box;
  background-color: #f1eeea;
}

/* Ensure all slider containers have consistent borders */
.slider-container {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #f1eeea;
  /*border-bottom: 1px solid black;*/
  box-sizing: border-box;
  margin-top:5px;
}

/* Toggle groups need each element to have border */
.toggle-group .label-row {
  border-bottom: 1px solid black;
}

.toggle-group .slider-container {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #f1eeea;
  border-bottom: 1px solid black;
  box-sizing: border-box;
  margin-top:5px;
}

#generator-finish{
  max-width:1100px;
  margin:0 auto;
  padding:20px;
}

/* Input styling */
input[type="range"],
input[type="range"].toggle {
  -webkit-appearance: none;
  width: 100%;
  height: 40px;
  background: transparent;
  border-radius: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

/* Make slider thumb width relative to container width */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: calc(100% / 6);
  height: 40px;
  background: black;
  border-radius: 0;
  cursor: pointer;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: calc(100% / 6);
  height: 40px;
  background: black;
  border-radius: 0;
  cursor: pointer;
  border: none;
}

/* Toggle-specific styling */
input[type="range"].toggle::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 50%; /* Half of the container width */
  height: 40px;
  background: black;
  border-radius: 0;
  cursor: pointer;
  border: none;
  position: relative;
}

input[type="range"].toggle::-moz-range-thumb {
  width: 50%; /* Half of the container width */
  height: 40px;
  background: black;
  border-radius: 0;
  cursor: pointer;
  border: none;
  position: relative;
}

/* Remove the existing on/off text indicators */
.toggle-group::before,
.toggle-group::after {
  display: none;
}

/* Add the off text */
.toggle-group .slider-container::before {
  content: "off";
  position: absolute;
  left: 25%;
  top: 50%;
  transform: translateY(-50%);
  color: #f1eeea;
  font-family: var(--font-family);
  font-size: 11.34px;
  font-weight: 700;
  text-transform: lowercase;
  z-index: 2;
  pointer-events: none;
  text-align: center;
  width: 20px;
  margin-left: -10px;
}

/* Add the on text */
.toggle-group .slider-container::after {
  content: "on";
  position: absolute;
  right: 25%;
  top: 50%;
  transform: translateY(-50%);
  color: #f1eeea;
  font-family: var(--font-family);
  font-size: 11.34px;
  font-weight: 700;
  text-transform: lowercase;
  z-index: 2;
  pointer-events: none;
  text-align: center;
  width: 20px;
  margin-right: -10px;
}

/* Button styling - use flexbox for consistent sizing */
.print-button {
  width: 100%;
  height: 80px;
  padding: 0;
  margin: 0;
  background: black;
  color: #f1eeea;
  border: none;
  border-radius: 0;
  font-family: var(--font-family);
  font-weight: 900;
  font-size: 12.6px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid black;
  /* Make buttons share space evenly */
  flex: 1;
  box-sizing: border-box;
}

.print-button:last-child {
  border-bottom: none;
}

/* Text styling - ensure proper spacing */
.slider-label,
.toggle-group .slider-label {
  font-family: var(--font-family);
  font-weight: 900;
  font-size: 12.6px;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: left;
  padding-left: 0;
  min-width: 70px; /* Minimum width for labels */
}

.slider-value,
.toggle-group .slider-value {
  font-family: var(--font-family);
  font-weight: 900;
  font-size: 12.6px;
  text-transform: uppercase;
  text-align: right;
  padding-right: 0;
  min-width: 30px; /* Minimum width for values */
}

/* Remove bottom borders for last items */
.control-pair > *:last-child .label-row:last-child,
.control-pair > *:last-child .slider-container:last-child {
  border-bottom: none;
}

/* Rules Overlay */
.rules-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
}

.rules-container .rules-overlay,
.rules-container .rules-close {
  pointer-events: auto;
}

.rules-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 50%;
  height: 100%;
  background-color: rgba(241, 238, 234, 0.95);
  z-index: 1000;
  overflow-y: auto;
  transition: right 0.3s ease-in-out;
  border-left: 1px solid black;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.rules-overlay.active {
  right: 0;
}

.rules-content {
  padding: 60px 40px 40px;
  max-width: 800px;
  margin: 0 auto;
}

/* Update rules typography to use Inter */
.rules-section {
  font-family: "Inter", var(--font-family), sans-serif;
}

.rules-section h3 {
  font-size: 28px;
  margin-bottom: 30px;
  font-weight: 700;
  color: #121212;
}

.rules-section h4 {
  font-size: 22px;
  margin: 25px 0 15px;
  font-weight: 600;
  color: #121212;
}

.rules-section h5 {
  font-size: 18px;
  margin: 20px 0 10px;
  font-weight: 600;
  color: #121212;
}

.rules-section ul {
  padding-left: 25px;
  margin-bottom: 15px;
}

.rules-section li {
  margin-bottom: 8px;
  line-height: 1.5;
  font-size: 16px;
}

.rules-section strong {
  font-weight: 600;
}

/* Update close button to be part of the overlay movement */
.rules-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background-color: #f1eeea;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.rules-close:hover {
  background-color: #e5e2de;
}

.rules-language {
  display: none;
}

.language-button {
  padding: 8px 16px;
  background: black;
  color: white;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 12px;
}

.language-button.active {
  opacity: 0.6;
}

:root {
  --font-family: "IBM Plex Sans", sans-serif;
}

/* FIXED COLOR CELL STYLING */
/* These must be at the end of the file to override other styles */
#color1 {
  background-color: #193f86;
}

#color2 {
  background-color: #db6e53;
}

#color3 {
  background-color: #eebab1;
}

#color4 {
  background-color: #f5c65b;
}

/* Find and update the SVG rect fill */
svg rect {
  fill: #121212 !important; /* Override any inline styles */
}

/* Update any remaining white elements */
.slider-container,
.toggle-group .slider-container,
.label-row {
  background-color: #f1eeea;
}

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