* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background-color: #1e1e1e;
  color: #ccc;
}
.app-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
}
.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #2b2b2b;
  padding: 1rem;
  width: 250px;
  min-width: 200px;
}
.top-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.preview-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #444;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
#block-preview-canvas {
  width: 90%;
  height: 90%;
}
.item-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.item-name {
  font-weight: bold;
}
.pen-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
}
.bottom-selection {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.twitch-login {
  background-color: #9146ff;
  color: #f5f5f5;
  border: none;
  padding: 0.6rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}
.points-display {
  text-align: center;
  font-size: 1rem;
}
.main-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: #121212;
}
#render-canvas {
  width: 95%;
  height: 95%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background-color: #222;
}
.dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7); /* darker semi-transparent background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.dialog.show {
  opacity: 1;
  visibility: visible;
}
.dialog-content {
  background-color: #1e1e1e;
  border-radius: 12px;
  padding: 20px 25px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.8);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: fadeIn 0.3s ease;
  color: #ccc;
}
#dialog-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #ccc;
  transition: color 0.2s ease;
}
#dialog-close-button:hover {
  color: #ff6b6b;
}
#block-search-input {
  padding: 10px 15px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
  outline: none;
  background-color: #2a2a2a;
  color: #f0f0f0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#block-search-input::placeholder {
  color: #888;
}
#block-search-input:focus {
  border-color: #3399ff;
  box-shadow: 0 0 5px rgba(51,153,255,0.5);
}
#block-search-results {
  list-style: none;
  scrollbar-color: #333 #1e1e1e;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid #333;
}
#block-search-results li {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}
#block-search-results li:hover {
  background-color: #333;
}
.item-properties {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  background-color: #333;
  border-radius: 8px;
  overflow: hidden;
}
.item-properties li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #444;
  position: relative;
}
.item-properties li:last-child {
  border-bottom: none;
}
.property-name {
  font-weight: 500;
  color: #ccc;
}
.property-value {
  color: #ccc;
  cursor: pointer;
}
.property-slider {
  accent-color: #ccc;
}
.property-toggle {
  accent-color: #222;
  background-color: #ccc;
}
.property-string {
  color: #ccc;
  cursor: pointer;
  background-color: #444;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.property-string:hover {
  background-color: #555;
}
.value-options {
    display: flex;
    background: #2b2b2b;
    border: 1px solid #555;
    border-radius: 6px;
    list-style: none;
    margin: 0;
    padding: 4px;
    width: max-content;
    min-width: 100px;
    gap: 4px;                   /* Space between items */
}
.value-options li {
    padding: 4px 8px;
    cursor: pointer;
    color: #ddd;
    white-space: nowrap;
}
.value-options li:hover {
    background: #444;
}
@keyframes fadeIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: auto;
    padding: 0.5rem 1rem;
  }

  .top-selection, .bottom-selection {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .preview-wrapper {
    height: 100%;
    /*width: 60px;
    height: 60px;*/
    aspect-ratio: 1/1;
  }

  .item-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .twitch-login {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }

  .points-display {
    font-size: 0.9rem;
  }
  .value-options {
        flex-direction: column; 
        width: max-content;          
        gap: 0;                 
    }
}