/* ---- THIẾT LẬP CHUNG TRANG ---- */
* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Gluten", cursive;
  display: flex;
  height: 100vh;
  background-color: #f0f2f5;
}

/* ---- PANEL TRÁI (TẠO QR) ---- */

#leftPanel {
  width: 300px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid #e0e0e0;
}

#leftPanel h2 {
  text-align: center;
  margin: 20px 0;
}

/* ---- PANEL PHẢI (HIỂN THỊ QR) ---- */

#rightPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #fafafa;
}

#rightPanel footer {
  font-size: 14px;
  color: #888;
  text-align: center;
  margin-top: 10px;
}

/* ---- CÁC THÀNH PHẦN COLOR PICKER ---- */

.color-picker-container {
  text-align: center;
}

#colorPicker,
#bgColorPicker {
  margin-top: 8px;
  width: 60px;
  height: 40px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* ---- INPUT VÀ BUTTON CHUNG ---- */

input,
button {
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  font-family: "Gluten", cursive;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.3s ease;
}

input:focus,
button:focus {
  border-color: #ff4646;
}

#errorText {
  display: none;
  color: red;
  font-size: 13px;
  text-align: center;
}

/* ---- BUTTONS ---- */

button {
  font-family: "Gluten", cursive;
  background-color: #ff4646;
  color: white;
  cursor: pointer;
  font-weight: 500;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  box-shadow: 0 4px 2px #cc3c3c;
  transition: all 0.15s ease-in-out;
  position: relative;
}

button:hover {
  background-color: #ff4646;
  box-shadow: 0 4px 2px #b83232;
}

button:active {
  top: 2px;
  box-shadow: 0 2px 2px #a62828;
}

.button-group {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.button-group button {
  width: 120px;
}

/* ---- CANVAS ---- */

canvas {
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background-color: #fff;
}

/* ---- LABEL ---- */

label {
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 768px) {
  
  body {
    flex-direction: column;
  }

  #leftPanel {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  #rightPanel {
    flex: 1;
    padding: 10px;
  }

  canvas {
    max-width: 100%;
    height: auto;
  }

  .button-group button {
    width: 40%;
  }

  input[type="color"] {
    width: 50px;
    height: 36px;
  }
}
