/* BackImg editor workspace */

body.backimg-editor {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #f0f3f1;
}

body.backimg-editor .header {
  flex-shrink: 0;
}

#main {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* Sidebar panel */
#GenerateImage {
  width: 300px;
  min-width: 280px;
  max-width: 340px;
  flex-shrink: 0;
  height: 100%;
  padding: 0.85rem 1rem 1.25rem;
  background: #fff;
  border-right: 1px solid #e8ece9;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #c5d9cc transparent;
}

#GenerateImage::-webkit-scrollbar {
  width: 6px;
}

#GenerateImage::-webkit-scrollbar-thumb {
  background: #c5d9cc;
  border-radius: 3px;
}

#GenerateImage hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 0.85rem 0;
}

.setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.25rem;
  padding: 0.35rem 0;
}

.setting > span:first-child {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: #555;
  min-width: 4.25rem;
}

.FormControl {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 140px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  border-radius: 3px;
  border: 1px solid #ddd;
  background: #fff;
  color: #222;
  height: 2rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.FormControl:focus {
  outline: none;
  border-color: #3a9d6c;
  box-shadow: 0 0 0 2px rgba(58, 157, 108, 0.2);
}

input[type="color"].FormControl {
  padding: 0.15rem;
  cursor: pointer;
}

input[type="file"] {
  font-size: 0.75rem;
  max-width: 100%;
}

input[type="checkbox"].FormControl {
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  accent-color: #3a9d6c;
}

.SelectControl,
select#ChangeType {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 140px;
  padding: 0.3rem 0.45rem;
  font-size: 0.8125rem;
  height: 2rem;
  border-radius: 3px;
  border: 1px solid #ddd;
  background: #fff;
  color: #222;
  cursor: pointer;
}

.SelectControl:focus,
select#ChangeType:focus {
  outline: none;
  border-color: #3a9d6c;
  box-shadow: 0 0 0 2px rgba(58, 157, 108, 0.2);
}

/* Button rows */
.btn-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem 0;
}

.btn-row .Option {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 0;
}

button.Option {
  border: 1px solid #3a9d6c;
  padding: 0.45rem 0.5rem;
  color: #fff;
  border-radius: 3px;
  background: #3a9d6c;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s, filter 0.15s;
}

button.Option:hover {
  background: #2d7d55;
  border-color: #2d7d55;
}

button#download {
  background: #3a9d6c;
  border-color: #3a9d6c;
}

button#reset {
  background: #fff;
  color: #a4262c;
  border-color: #f1bbbc;
}

button#reset:hover {
  background: #fdf3f4;
}

#RecommendationColors {
  gap: 0.35rem;
  padding: 0.35rem 0;
}

#footer.setting {
  justify-content: space-between;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid #eee;
  font-size: 0.75rem;
  color: #999;
}

#footer a {
  color: #3a9d6c;
}

#footer a:hover {
  text-decoration: underline;
}

div#footer {
  color: #999;
  margin-top: 0;
}

/* Preview canvas */
div#ImageShow {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 100%;
  margin: 0;
  padding: 1.5rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e8ece9;
  background-image:
    linear-gradient(45deg, #dfe4e1 25%, transparent 25%),
    linear-gradient(-45deg, #dfe4e1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dfe4e1 75%),
    linear-gradient(-45deg, transparent 75%, #dfe4e1 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.ImageItem {
  width: 500px;
  max-width: 100%;
  height: 300px;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid #3a9d6c;
  border-radius: 4px;
  position: relative;
  top: auto;
  transform: none;
  background-color: #96b97d;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

#lb_note {
  position: absolute;
  z-index: 1;
  font-size: 0.875rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.div_ImgContent {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  position: absolute;
}

#ImageBgicon {
  width: auto;
  height: auto;
  z-index: 99;
}

#ImageClone {
  width: 400px;
  height: 300px;
  position: fixed;
  top: 0;
  right: 0;
  z-index: -999;
  opacity: 0;
  overflow: hidden;
}

div#ImageDown {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

span#ImageText {
  font-size: 16px;
  z-index: 99;
}

/* Modals */
#graybackground {
  display: none;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 500;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

#iconurl,
#colorurl {
  display: none;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 600;
  overflow-y: auto;
  padding: 1rem;
}

div#IconForm,
div#ColorForm {
  padding: 0;
  max-width: 720px;
  margin: 2rem auto;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

div#FormTitle {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #f9faf9;
  border-bottom: 1px solid #eee;
  font-weight: 600;
}

div#IconCondition {
  display: flex;
  padding: 1rem 1.25rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.item-ul {
  list-style: none;
  display: flex;
  justify-content: flex-start;
  padding: 0 1rem 1rem;
  margin: 0;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.item-left img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: contain;
  background: #f5f5f5;
}

.item-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 10px;
  font-size: 0.8125rem;
}

.item-a {
  display: flex;
  flex-direction: row;
  align-content: center;
  color: #333;
}

.item-li {
  width: calc(50% - 0.35rem);
  border: 1px solid #e8ece9;
  border-radius: 6px;
  padding: 0.65rem;
  margin: 0;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.item-li:hover {
  border-color: #3a9d6c;
  box-shadow: 0 2px 8px rgba(58, 157, 108, 0.12);
}

.close {
  border: 0;
  background-color: transparent;
  font-size: 1.25rem;
  color: #888;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.close:hover {
  color: #333;
}

div#ImageIconColor {
  overflow: auto;
  max-height: 300px;
  gap: 0.35rem;
  padding: 0.25rem 0;
}

.ThemeColor {
  margin: 2px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
}

.div_WaterMarkText {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  z-index: 999;
}

.p_WaterMarkText {
  padding: 10px;
  margin: 0;
  opacity: 0.3;
}

@media (max-width: 900px) {
  #main {
    flex-direction: column;
  }

  #GenerateImage {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid #e8ece9;
  }

  div#ImageShow {
    min-height: 280px;
    padding: 1rem;
  }
}
