@import url("reset.css");
@import url('https://fonts.googleapis.com/css2?family=Agbalumo&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Gabarito:wght@400..900&display=swap');

/* This is to reset all default browser CSS to none.*/

/* Also, I stored all the colors in a separate file. This is because I was originally gonna add theming but it wasn't working out unfortunately. I kept them separate because no way am I adding them all back. */

/*----------------------------------------------*/

:root {
  --color-primary: #F7EDE2;
  --color-secondary: #432818;
  --color-accent: #F6BD60;
  --color-background: #84A59D;
  --color-text: #222222;
  --color-headings: #DDA15E;
  --color-shadow: #432818;
}

/* General HTML stylings */

/* Make headers nice and bold */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
}

h1 {
  font-family: "Agbalumo", system-ui;
  font-weight: 400;
  font-style: normal;
}

h2,
button,
#page-header a,
#page-subheader a {
  font-family: "Gabarito", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

html {
  background-color: var(--color-background);
  scrollbar-color: var(--color-primary) var(--color-secondary);
  /* Fancy scrollbar stylings */
  image-rendering: pixelated;
  /* We are working with art assets, so we want the page to look pixelated even on zoom-in so the images will not blur. This also helps with canvas rendering (now for real because of my custom html2canvas fork). */
  scroll-behavior: smooth;
  /* To scroll slowly while dragging, rather than shifting quickly all over the place */
  touch-action: initial;
}

/*General body styles. Change to your own colors! */
body {
  margin: 0 !important;
  overscroll-behavior: none;
  /* Prevents pull-to-refresh on mobile */
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  background: none;
  font-size: 12px;
  align-items: center;
}

/*------------------------------------------------*/

/* Page header and sub-header styling */
#header {
  background-image: url(/page/patternBg.png);
  background-repeat: repeat;
  background-size: 10%;
  padding-top: 4em;
  padding-bottom: 10em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#page-header {
  background-color: var(--color-primary);
  color: var(--color-headings);
  border: 1px solid var(--color-secondary);
  border-radius: 2em;
  text-align: center;
  width: 500px;
  padding: 0em 1em 1em 1em;
  margin-bottom: 2em;
  box-shadow: 3px 6px var(--color-shadow);
  z-index: 2;
}

#page-subheader,
#page-subheader a {
  color: var(--color-secondary);
  font-size: 1.2em;
}

#page-subheader a {
  color: var(--color-headings);
  transition: 0.3s;
  font-size: 1.2em;
}

#page-subheader a:hover {
  color: var(--color-accent);
}

/* Specific stylings for page header */

#page-header a,
#page-subheader a {
  text-decoration: none;
}



/* Stylings for buttons */
button {
  color: var(--color-secondary);
  background-color: var(--color-primary);
  border: 1px solid var(--color-secondary);
  border-radius: 5em;
  text-align: center;
  transition: 0.3s;
  /* Fancy button transitions */
  font-size: 17px;
  cursor: pointer;
  display: inline;
  padding: 0.4em 1em 0.4em 1em;
}

button:hover {
  background-color: var(--color-accent);
  box-shadow: 3px 6px var(--color-shadow);

}

.icon-btn {
  border-radius: 100%;
  width: 30px;
  height: 30px;
 padding: 0.1em;
}

.layerBtn.active, .rootbtn.active {
  background: var(--color-accent);
  /* attivo */
  color: var(--color-text);
  box-shadow: 3px 6px var(--color-shadow);

}

.layerBtn.locked {
  background: #eac6a0;
  color: var(--color-secondary);
  box-shadow: 3px 6px var(--color-shadow);
}

.layerBtn.locked::after {
  content: "";
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.35em;
  vertical-align: -0.1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2M9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2M9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Under Maker*/
#underMaker {
  display: flex;
  align-items: center;
  gap: 1em;
  justify-content: space-between;
}

#quickActions {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
  margin: 0.8em 0 1.2em;
}

.quick-action-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0.2em 0.55em;
  font-size: 18px;
  line-height: 1;
  border-radius: 0.8em;
}

.quick-action-btn.danger {
  background-color: #f5d4cd;
}

#layerLevelIndicator {
  text-align: center;
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.1;
  margin: 0.4em 0 0.7em;
  position: relative;
  z-index: 2;
}

/*Stylings Input Field */

.inputField {
  width: 15em;
  border-radius: 50px;
  padding: 0.7em;
  color: var(--color-text);
  background-color: var(--color-primary);
  border: 1px solid var(--color-secondary);
}

.inputField::placeholder {
  color: #43281871;
}

#inputDimension {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  justify-content: center;
  z-index: 2;
  margin-bottom: 1em;
}

/*------------------------------------------------*/

/* Dollmaker Container Style*/

#dollmaker_container {
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  line-height: 1em;
  background-color: transparent;
  margin: 0em auto;
  /* auto = centrato orizzontalmente */
  align-items: stretch;
}

/*------------------------------------------------*/

/* Maker Container Style*/
#makerContainer {
    align-self: center;
}

#makerArea {
  background-color: #fff;
  position: relative;
  width: 1000px;
  height: 300px;
  text-align: center;
  margin-bottom: 1em;
  overflow: hidden;
}



/*------------------------------------------------*/

/* Layer Selectable */

#layerSetWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  width: 100%;
}

#layerSet {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  align-items: center;
  justify-content: center;
}

#layerHelper {
  color: var(--color-primary);
  margin: 0;
  line-height: 1.35;
  text-align: center;
}

/*-------------------------------------------------------------------*/

/*Tools Container settings */

#toolArea {
  display: flex;
  justify-content: center;
  width: 100%;
  height: min-content;
  z-index: 2;
  margin-bottom: 1em;
}

/* individual links for thumbnails */
#toolArea a {
  display: block;
  float: left;
  margin: 2px 2px 7px 2px;
  text-align: center;
  width: 20px;
  height: 20px;
  position: relative;
  transition: 0.3s;
}

/* the title of that area */
#toolArea h3 {
  font-weight: bold;
  clear: both;
  padding: 7px 0 5px 0;
}


/* Instructions for using the dollmaker */
#instructions {
  position: relative;
  padding: 0px 5px;
  display: none;
}

#instructions-list {
  margin: 1em;
  line-height: 1.5em;
  display: list-item;
  list-style-type: disc;
}

/* Sub-bullet styling */
.subBullet {
  display: list-item;
  list-style-type: circle;
  margin-left: 1em;
}

/*-------------------------------------------------------------------*/

.ui-tabs-panel {
  clear: both;
  padding: 5px;
  width: auto;
  max-height: 200px;
  min-height: 200px;
  overflow-y: auto;
}


/*this puts rounded corners around the boxes*/
.ui-corner-all,
.ui-tabs-panel {
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  /* Add defaults for browser compat. I highly recommend that you keep all of these the same for consistency among different browsers. */
  border-radius: 5px;
}

/* this puts rounded corners around the divs*/
.ui-corner-top a {
  -moz-border-radius-topleft: 10px;
  -webkit-border-top-left-radius: 10px;
  -moz-border-radius-topright: 10px;
  -webkit-border-top-right-radius: 10px;
  /* Add defaults for browser compat */
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}





/*-------------------------------------------------------------------*/

/* Draggable pieces CSS */
.ui-draggable {
  user-select: none;
  /* Makes it so that draggable pieces aren't selectable even when not dragged (I personally find it annoying when that happens) */
  cursor: grab;
  /* Add grab cursor on hover */
}

.ui-draggable-dragging {
  cursor: grabbing;
  /* Add grabbing cursor on dragging */
}

#makerArea img.placed.is-selected {
  outline: 2px solid var(--color-accent);
  box-shadow: 0 0 0 2px rgba(67, 40, 24, 0.35);
}

#assetSet {
  display: flex;
  flex-direction: column;
  width: 10%;
  gap: 1em;
}


#assetSelector {
  margin-top: 2em;
  gap: 1em;
  display: flex;
  flex-direction: row;
  width: 100%;
}

/*The area with divs in the middle that contains all the draggable pieces*/
#piecesArea {
  width: 90%;
}

/*Positioning for tabs area*/
#tabsbar {
  text-align: left;
  margin-left: 2em;
  margin-bottom: -0.2em;
  /* This extra space is required for browser compatibility */
  position: relative;
}

/*Allows the tabs to be next to eachother*/
#tabsbar li {
  display: inline;
}

/*Individual tabs. Change to your own colors!*/
/* Note: I wouldn't change the tab bar's font and/or font-size here. Make it the same size as the body font size. If you don't do it like that, your drag & drop positions will get messed up. Yes, really. */
#tabsbar li a {
  margin-left: 0.2em;
  border: 1px solid var(--color-secondary);
  background-color: var(--color-headings);
  color: var(--color-text);
  padding: 4px 10px 3px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
}

/*Selected tab. Change to your own colors!*/
#tabsbar .ui-state-active a {
  border-bottom: 0px solid;
  background-color: var(--color-primary);
  position: relative;
  z-index: 1;

}

#tabsbar a:hover {
  border-bottom: 0px solid;
  background-color: var(--color-accent);
  transition: 0.3s;
}

/*-------------------------------------------------------------------*/

#piecesArea div {
  margin-top: 0.5em;
}

#piecesArea img {
  margin: 0 10px 10px 0;
  cursor: pointer;
  max-width: 126px;
}

#piecesArea {
  position: relative;
}

#assetLoading {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(247, 237, 226, 0.82);
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 1rem;
  z-index: 5;
  border-radius: 1rem;
  text-align: center;
  padding: 1rem;
}

#assetLoading.is-visible {
  display: flex;
}

/* General */

.ui-general-box,
.ui-tabs-panel {
  background-color: var(--color-primary);
  border: 1px solid var(--color-secondary);
  border-radius: 2em;
  box-shadow: 3px 6px var(--color-shadow);
  padding: 2em;
}

/* Footer */
#footer {
  font-size: 0.8em;
    width: 1000px;
    align-self: center;
    text-align: center;
    margin: auto;
    margin-top: 5em;
    margin-bottom: 1em;
}

#shareButtons {
  display: flex;
  justify-content: center;
  column-gap: 1em;
}

@media (max-width: 980px) {
  #dollmaker_container,
  #footer {
    width: min(100%, 1000px);
    max-width: 100%;
    padding: 0 0.8rem;
    box-sizing: border-box;
  }

  #page-header {
    width: min(92vw, 500px);
  }

  #toolArea {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8em;
    width: 100%;
    min-width: 0;
  }

  #layerSet {
    width: 100%;
    min-width: 0;
    gap: 0.5em;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.35rem;
    padding-left: 0.1rem;
    -webkit-overflow-scrolling: touch;
  }

  #makerContainer {
    width: 100%;
    overflow-x: hidden;
  }

  #makerArea {
    width: min(94vw, 1000px);
    max-width: 100%;
  }

  #underMaker {
    flex-direction: column;
    align-items: flex-start;
  }

  #underMaker h6 {
    width: 100% !important;
    line-height: 1.4;
  }

  .inputField {
    width: 11.5em;
  }

  #assetSelector {
    flex-direction: column;
  }

  #assetSet {
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  #piecesArea {
    width: 100%;
  }

  #tabsbar {
    margin-left: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35em;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  #tabsbar li a {
    display: inline-block;
    margin-left: 0;
    white-space: nowrap;
  }

  #underMaker {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.6em;
    justify-content: center;
    align-items: center;
  }

  #underMaker h6 {
    display: none;
  }

  #underMaker #toolButton {
    display: flex;
    gap: 0.5em;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  #inputDimension {
    display: none !important;
  }

  #layerSet .layerBtn,
  #assetSet .rootbtn,
  #tabsbar li {
    flex: 0 0 auto;
  }

  #layerSet,
  #assetSet,
  #tabsbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #layerSet::-webkit-scrollbar,
  #assetSet::-webkit-scrollbar,
  #tabsbar::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 768px) {
  #header {
    padding-top: 2.8em;
    padding-bottom: 7.5em;
  }

  h1 {
    font-size: 2.2em !important;
  }

  #makerArea {
    height: 200px;
    max-height: 420px;
  }

  #quickActions {
    position: sticky;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    z-index: 40;
    background: rgba(247, 237, 226, 0.95);
    border: 1px solid var(--color-secondary);
    border-radius: 1rem;
    padding: 0.45rem;
    box-shadow: 3px 6px var(--color-shadow);
    backdrop-filter: blur(2px);
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    max-width: min(100%, 560px);
  }

  .quick-action-btn {
    min-width: 44px;
    min-height: 44px;
  }

  #underMaker #toolButton {
    width: 100%;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  #underMaker #toolButton .icon-btn {
    flex: 0 0 auto;
  }

  #quickActions .quick-action-btn {
    flex: 0 0 auto;
  }

  #footer {
    margin-bottom: 4.5em;
  }

  .custom-shape-divider-bottom-1755268663 svg {
  position: relative;
  display: block;
  width: calc(800%) !important;
}
}

.instagram-follow-btn {
  color: var(--color-secondary);
  background-color: var(--color-primary);
  border: 1px solid var(--color-secondary);
  border-radius: 5em;
  text-align: center;
  transition: 0.3s;
  /* Fancy button transitions */
  font-size: 17px;
  cursor: pointer;
  display: inline;
  padding: 0.4em 1em 0.4em 1em;
  text-decoration: none;
}

.instagram-follow-btn:hover,
.instagram-follow-btn:focus {
    background-color: var(--color-accent);
  box-shadow: 3px 6px var(--color-shadow);
}

/* Decoration */

.custom-shape-divider-bottom-1755268663 {
  margin-top: -15em;
  margin-bottom: -8em;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.custom-shape-divider-bottom-1755268663 svg {
  position: relative;
  display: block;
  width: calc(160% + 1.3px);
  height: 200px;
}

.custom-shape-divider-bottom-1755268663 .shape-fill {
  fill: var(--color-background);
}

/*-------------------------------------------------------------------*/
/* Anti Right-click */
/* Commented out by default since I don't care for it. Feel free to uncomment it for your own project. */
/* #anti-rightclick {
  display:none;
  width: 170px;
  height:  30px;
  line-height: 1.2;
  padding: 3px 3px 3px 15px;
  position: absolute;
  z-index: 9999;
}
 */
