/* Ensure full viewport scrollability */
html, body {
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* Layout Wrapper */
.rods-designer-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  gap: 20px;
}

/* Canvas Column */
.rods-canvas-container {
  flex: 1 1 60%;
  min-width: 320px;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Canvas Box */
.canvas-wrapper,
.canvas-container {
  width: 100%;
  overflow: auto;
  max-height: 80vh;
  display: flex;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
}

/* Canvas Element */
#rods-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid #ccc;
  display: block;
  margin-bottom: 15px;
}

/* Tools Column */
.rods-tools-container {
  flex: 1 1 35%;
  min-width: 280px;
}

/* Typography and Inputs */
.rods-tools-container h3 {
  margin-top: 0;
}

.rods-tools-container button,
.rods-tools-container input,
.rods-tools-container select {
  margin: 5px 0;
  width: 100%;
  padding: 6px;
  box-sizing: border-box;
}

/* Style/Action Buttons */
.rods-style-row,
.rods-action-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.rods-style-row button,
.rods-action-row button {
  flex: 1;
  padding: 6px 0;
  font-weight: bold;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  cursor: pointer;
  transition: background-color 0.3s;
  text-align: center;
}

.rods-style-row button:hover,
.rods-action-row button:hover {
  background-color: #e0e0e0;
}

.rods-style-row input[type="color"] {
  flex: 1;
  height: 36px;
  border-radius: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
  padding: 0;
}

.rods-action-row button i {
  pointer-events: none;
  font-size: 18px;
}

/* Additional Buttons */
.btn-small {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #1e7e34;
}

.btn-icon {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 0;
  text-align: center;
  user-select: none;
}

.btn-icon:hover {
  background-color: #ddd;
}

.small-icon {
  width: 32px !important;
  height: 32px;
  font-size: 18px !important;
  padding: 0;
}

/* Add Text */
#rods-add-text-btn {
  width: 100%;
  padding: 12px 0;
  font-weight: 600;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#rods-add-text-btn:hover {
  background-color: #0056b3;
}

#rods-save-msg {
  color: green;
  margin-top: 10px;
}

/* Responsive Fixes */
@media (max-width: 768px) {
  .rods-designer-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .rods-canvas-container,
  .rods-tools-container {
    max-width: 100%;
    flex: 1 1 100%;
  }

  #rods-canvas {
    width: 100%;
    max-width: 100%;
  }
}
