/* WebBlox: A Web-Based 3D Creation & Gaming Platform - style.css */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #1a1a1a;
  color: #e0e0e0;
  display: flex;
  font-size: 14px;
  line-height: 1.6;
}

/* Updated ID from #ui-panel to #editor-panel to match script.js's expectation */
#editor-panel {
  width: 280px;
  background-color: #2a2a2a;
  border-right: 1px solid #3a3a3a;
  padding: 15px;
  box-sizing: border-box;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 15px; /* Adjusted gap between sections */
}

#editor-panel h2 {
  font-size: 1.4em;
  color: #f0f0f0;
  margin-top: 0;
  margin-bottom: 10px;
}

#editor-panel h3 { /* Styling for section headers like "Object Creation" */
  font-size: 1.2em;
  color: #f0f0f0;
  margin-top: 15px;
  margin-bottom: 5px;
  border-bottom: 1px solid #3a3a3a;
  padding-bottom: 5px;
}

#editor-panel h4 { /* Styling for sub-section headers like "Selected Object Properties" */
  font-size: 1.1em;
  color: #f0f0f0;
  margin-top: 15px;
  margin-bottom: 10px;
}

/* Global button styling */
button,
input[type="button"],
input[type="submit"] {
  background-color: #007bff;
  color: #ffffff;
  border: none;
  padding: 8px 15px;
  margin: 0; /* Reset margin for global buttons */
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s ease;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
  background-color: #0056b3;
}

button:active,
input[type="button"]:active,
input[type="submit"]:active {
  background-color: #004085;
}

/* Specific styling for buttons inside the editor panel */
#editor-panel button {
  width: 100%; /* Make buttons take full width within the panel */
  margin-bottom: 8px; /* Spacing between buttons */
  box-sizing: border-box; /* Include padding and border in the width */
}

/* Specific styling for the toggle mode button to make it stand out */
#toggle-mode-btn {
  background-color: #28a745; /* Green color for mode toggle */
  color: #ffffff;
  font-weight: bold;
  padding: 10px 15px;
  margin-bottom: 15px; /* More space below it */
}

#toggle-mode-btn:hover {
  background-color: #218838;
}

#toggle-mode-btn:active {
  background-color: #1e7e34;
}

#properties-panel {
  flex-grow: 1;
}

#properties-panel p { /* Targets the "No object selected." message */
  color: #aaaaaa;
  font-style: italic;
  text-align: center;
  margin-top: 20px;
}

#object-props {
  /* This div's display is controlled by script.js */
}

#viewport-container {
  flex: 1;
  position: relative;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Updated ID from #three-canvas to #render-canvas to match script.js's expectation */
#render-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

input[type="text"],
input[type="number"],
input[type="color"],
select {
  background-color: #3a3a3a;
  color: #e0e0e0;
  border: 1px solid #555555;
  padding: 8px;
  margin: 5px 0;
  border-radius: 4px;
  width: calc(100% - 18px); /* 100% - (2*padding + 2*border) = 100% - (2*8px + 2*1px) */
  box-sizing: border-box;
  font-size: 13px;
}

input[type="color"] {
  padding: 4px;
  height: 30px;
  width: calc(100% - 10px); /* 100% - (2*padding + 2*border) = 100% - (2*4px + 2*1px) */
  box-sizing: border-box;
  vertical-align: middle;
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  color: #bbbbbb;
  font-size: 13px;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  /* Updated ID from #ui-panel to #editor-panel */
  #editor-panel {
    width: 100%;
    height: 250px;
    border-right: none;
    border-bottom: 1px solid #3a3a3a;
    order: 2; /* Place UI panel below viewport on mobile */
    padding: 10px;
  }

  #viewport-container {
    height: calc(100vh - 250px); /* Viewport takes remaining height */
  }

  /* Buttons inside editor panel will stack due to flex-direction: column on #editor-panel */
  #editor-panel button {
    width: 100%;
    margin-bottom: 8px;
  }
}