/* RESET */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f4f6fb;
  color: #333;
}

/* LAYOUT */
.app {
  display: flex;
  height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: #ffffff;
  padding: 20px;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar h2 {
  margin: 0;
  font-size: 20px;
}

/* CARD */
.card {
  background: #fafafa;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #eee;
}

.card h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #555;
}

/* INPUT */
input, select {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 13px;
}

/* BUTTON */
button {
  margin-top: 8px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: 0.2s;
}

button.primary {
  background: #6c5ce7;
  color: white;
}

button.primary:hover {
  background: #5a4bdc;
}

button.secondary {
  background: #00b894;
  color: white;
}

button.secondary:hover {
  background: #00a383;
}

/* MAIN */
.main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* HEADER */
.header {
  margin-bottom: 10px;
}

.header h3 {
  margin: 0;
}

/* PREVIEW */
.preview-box {
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

canvas {
  border-radius: 12px;
  max-width: 100%;
}

/* RESULT GRID */
#result {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

/* RESULT CARD */
.result-item {
  background: white;
  padding: 10px;
  border-radius: 14px;
  box-shadow: 0 5px 12px rgba(0,0,0,0.05);
  text-align: center;
}

.result-item canvas {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.result-item button {
  margin-top: 10px;
  background: #0984e3;
  color: white;
}

.result-item button:hover {
  background: #0873c4;
}

/* SCROLL */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 10px;
}