* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f7f9fc;
  color: #333;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.container {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: #fff;
  box-shadow: none;
  border-radius: 0;
}

.sidebar {
  width: 300px;
  background: #f0f4f8;
  padding: 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e1e4e8;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}

input, textarea {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.button-group {
  display: flex;
  gap: 10px;
}

button {
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

button:hover { background-color: #0056b3; }
button.secondary { background-color: #6c757d; }
button.secondary:hover { background-color: #5a6268; }

#status-text {
  text-align: center;
  margin-top: auto;
  font-size: 14px;
  color: #666;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* prevent overflow if canvas is larger */
  background-color: #ffffff;
}

#canvas-container {
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.presets-section {
  margin-top: 20px;
  border-top: 1px solid #ccc;
  padding-top: 15px;
}

.presets-section h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #555;
}

.presets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.preset-btn {
  background: #fff;
  border: 1px solid #007bff;
  color: #007bff;
  padding: 6px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: #007bff;
  color: #fff;
}

#canvas-container {
  position: relative; 
}

#btn-save {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #333;
  color: #333;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

#btn-save:hover {
  background: #333;
  color: #fff;
}