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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #1a1a24;
  color: #eeeeee;
  overflow: hidden;
  height: 100vh;
}

#container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* Left Sidebar styling */
#sidebar {
  width: 320px;
  background-color: #111118;
  border-right: 1px solid #2a2a38;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
  flex-shrink: 0;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 10px;
}

h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #aaaaaa;
  margin: 15px 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

hr {
  border: 0;
  height: 1px;
  background: #2a2a38;
  margin: 15px 0;
}

/* Control elements */
.control-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.control-group label {
  font-size: 0.85rem;
  color: #cccccc;
  margin-bottom: 6px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-header span {
  font-size: 0.85rem;
  font-weight: bold;
  color: #bc243c;
}

/* Inputs and Selects */
select, input[type="range"], input[type="color"] {
  background-color: #1d1d28;
  border: 1px solid #333346;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
}

select:focus {
  border-color: #bc243c;
}

input[type="range"] {
  -webkit-appearance: none;
  background: #222230;
  height: 6px;
  border-radius: 3px;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #bc243c;
  cursor: pointer;
  transition: background 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #d83b53;
}

input[type="color"] {
  height: 38px;
  padding: 2px;
  cursor: pointer;
}

/* Button & File Upload */
button, .button-label {
  background-color: #bc243c;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  text-align: center;
  font-size: 0.9rem;
  transition: background-color 0.15s ease;
  width: 100%;
}

button:hover, .button-label:hover {
  background-color: #d83b53;
}

.button-label {
  display: block;
}

#file-input {
  display: none;
}

/* Checkbox alignment */
.checkbox-group {
  flex-direction: row;
  align-items: center;
  margin-bottom: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  cursor: pointer;
  accent-color: #bc243c;
}

.checkbox-group label {
  margin-bottom: 0;
  cursor: pointer;
}

/* Statistics styling */
#stats {
  background-color: #0b0b10;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #20202e;
}

#stats div {
  font-size: 0.85rem;
  color: #aaaaaa;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

#stats span {
  font-family: monospace;
  color: #ffffff;
}

/* Main Viewport styling */
#viewport {
  flex-grow: 1;
  position: relative;
  height: 100%;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(26, 26, 36, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 500;
  z-index: 100;
  color: #ffffff;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
  #container {
    flex-direction: column;
    height: 100vh;
  }

  #sidebar {
    width: 100%;
    height: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid #2a2a38;
    padding: 8px 12px;
  }

  #viewport {
    flex: 1;
    min-height: 0;
  }

  body {
    overflow: hidden;
  }

  h2 {
    font-size: 1rem;
    margin-bottom: 4px;
  }

  hr {
    margin: 6px 0;
  }

  .control-group {
    margin-bottom: 4px;
  }

  .control-group label {
    font-size: 0.75rem;
    margin-bottom: 2px;
  }

  select, input[type="range"], input[type="color"] {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  input[type="color"] {
    height: 28px;
  }

  button, .button-label {
    padding: 6px;
    font-size: 0.8rem;
  }

  .checkbox-group {
    margin-bottom: 2px;
  }

  .checkbox-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
  }

  /* Hide non-essential sections on mobile */
  #stats, #stats + hr {
    display: none;
  }

  #verification-results {
    display: none !important;
  }
}
