/* =========================================
   Imports
   ========================================= */
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
@import url("./imports/classes.css");
@import url("./imports/lib-rewrite.css");

/* =========================================
   Global Styles
   ========================================= */
html {
  scroll-behavior: auto;
}

body {
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
  background: #282024;
}

img {
  max-width: 100%;
}

p,h2 {
  overflow-wrap: break-word;
}

span:has(img, a) {
  display: inline-block;
}

/* =========================================
   Layout Sections
   ========================================= */
header {
  background: #2d1f24 url(../assets/triangles.png) left bottom / cover no-repeat;
}

main #canvas {
  min-width: 25%;
  max-width: 100%;
  width: 100%;
  position: relative;
  color: #fff;
  background: #382e32;
  margin: auto;
}

footer {
  background: #221c1f;
}

/* =========================================
   Modal Styles
   ========================================= */

em-emoji-picker {
  width: 100%;
  height: 100%;
  contain: strict;
}

#text-editor-toolbar {
  background: #42353c;
}

#text-editor-toolbar .link-form {
  position: absolute;
  width: 200px;
  max-width: 100%;
  top: 60%;
  left: 145px;
  z-index: 100;
}

#text-editor-toolbar .gradient-form,
#text-editor-toolbar .assets-form,
#text-editor-toolbar #emoji-picker-container {
  position: absolute;
  width: 200px;
  max-width: 100%;
  max-height: 400px;
  top: 100%;
  right: 0;
  z-index: 100;
}

#text-editor-toolbar .assets-form {
  right: 8%;
  max-height: unset;
}

#text-editor-toolbar #emoji-picker-container {
  width: 300px;
  height: 300px;
  right: 0 !important;
}

#text-editor-toolbar .gradient-form .pickr .pcr-button {
  width: 100%;
  border-radius: unset;
}

.assets-form img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* =========================================
   Spacing Preview
   ========================================= */
#spacing-preview {
  --spacing-level: 1;
  position: relative;
  text-align: center;
  height: calc(var(--spacing-level) * 17px);
  overflow: hidden;
}

#spacing-preview::before {
  content: "Spacing";
  text-transform: uppercase;
  letter-spacing: 10px;
  word-break: break-all;
  position: absolute;
  font-size: 12px;
  top: 50%;
  left: 50%;
  color: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%);
}

/* =========================================
   Flag Editor
   ========================================= */
.country-input-wrapper {
  position: relative;
}

.country-input-wrapper ._auto-complete {
  width: 100%;
  height: 150px;
  top: 100%;
  position: absolute;

  z-index: 2;
  background-color: rgb(90 78 85);
}

.country-input-wrapper ._auto-complete ._item {
  cursor: pointer;
}

/* .country-input-wrapper ._auto-complete ._item img {
  width: 16px;
  height: 11px;
} */

.country-input-wrapper ._auto-complete ._item:hover,
.flag-item-content.active {
  background-color: rgba(0, 0, 0, 0.25) !important;
}

.flag-item-content {
  cursor: pointer;
}

/* =========================================
   Image Map Editor
   ========================================= */
#imgmap-edit-container {
  max-width: 100%;
  width: max-content;
  height: max-content;
  position: relative;
  margin: auto;
  overflow: hidden;
}

#imgmap-edit-container img {
  user-select: none;
}

#imgmap-edit-container .imgmap-edit-item {
  display: block;
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px dashed white;
  box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.25);
  width: 80px;
  height: 80px;
  top: 10px;
  left: 10px;
  text-align: center;
  overflow: hidden;
  cursor: grab;
}

#imgmap-edit-container .imgmap-edit-item.active {
  background-color: rgba(255, 0, 144, 0.5);
}

#imgmap-edit-container .imgmap-edit-item::before {
  content: attr(data-title);
  text-shadow: 2px 2px rgba(0, 0, 0, 0.5);
}

/* =========================================
   Element List Section
   ========================================= */
#element-list-section {
  --menu-pinned-spacing: 16px;
  transition:
    padding 0.25s ease-in-out,
    0.15s ease-out;
}

#element-list-section.pinned {
  position: sticky;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  bottom: var(--menu-pinned-spacing);
  padding: var(--menu-pinned-spacing);
  width: calc(100% - var(--menu-pinned-spacing) * 2);
  margin: auto;
  border-radius: var(--bs-border-radius);
  z-index: 5;
}

#element-list-section.pinned h2 {
  text-shadow: 2px 2px rgba(0, 0, 0, 0.5);
}

#element-list-section #canvas-element-list {
  min-height: 69px;
}

/* =========================================
   Canvas Item
   ========================================= */
.canvas-item {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-bottom-width: 0;
}

.canvas-item:last-of-type {
  border-bottom-width: 2px;
}

.canvas-item ._edit {
  background: #282024;
}

.canvas-item ._edit input {
  font-weight: 700;
  font-size: 1rem;
  text-transform: capitalize;
}

.canvas-item ._edit button[data-bs-toggle="collapse"]::after {
  font-family: "FontAwesome";
  content: "\f070";
  opacity: 0.75;
}

.canvas-item:has(> ._content.show) > ._edit button[data-bs-toggle="collapse"]::after {
  content: "\f06e";
  opacity: 1;
}

body:not(.view-mode) .canvas-item.selected {
  border-color: #ff66ab;
  border-bottom-width: 2px;
  margin-bottom: 2px;
}

body:not(.view-mode) .canvas-item.selected:last-of-type {
  margin-bottom: 0;
}

body.hide-on-move .canvas-item.gu-mirror,
body.hide-on-move .canvas-item.gu-transit {
  height: min-content !important;
  overflow: hidden;
}

body.hide-on-move .canvas-item.gu-mirror ._content,
body.hide-on-move .canvas-item.gu-transit ._content {
  display: none;
}

/* =========================================
   Canvas Wrapper Placeholder
   ========================================= */
body:has(#canvas-wrapper:empty) #canvas-wrapper-ph {
  display: block;
}

#canvas-wrapper-ph {
  display: none;
  width: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* =========================================
   View Mode
   ========================================= */
body.view-mode .canvas-item {
  border: unset;
}

body.view-mode .canvas-item ._edit,
body.view-mode #element-list-section {
  display: none !important;
  pointer-events: none;
}

body.view-mode .canvas-item ._content {
  padding: 0 !important;
}

body.view-mode #undo-canvas-btn,
body.view-mode #redo-canvas-btn,
body.view-mode #clear-canvas-selection-btn,
body.view-mode .canvas-action#expand-all-canvas-btn,
body.view-mode .canvas-action#collapse-all-canvas-btn,
body.view-mode .canvas-action#clear-canvas-btn,
body.view-mode .canvas-action:has(#canvas-menu-sticky-switch),
body:has(#canvas-wrapper:empty) #export-project-btn,
body:has(#canvas-wrapper:empty) .canvas-action#clear-canvas-btn,
body:has(#canvas-wrapper:empty) .canvas-action#expand-all-canvas-btn,
body:has(#canvas-wrapper:empty) .canvas-action#collapse-all-canvas-btn,
body:has(#canvas-wrapper:empty) #copy-to-clipboard,
body:has(#canvas-wrapper:empty) #download-as-text {
  pointer-events: none !important;
  opacity: 0.5 !important;
}

body:not(.logged-in) #clone-template .alert:not(.please-login-alert) {
  display: none;
}

body.logged-in #clone-template .alert.please-login-alert {
  display: none;
}

body:not(.logged-in) #clone-template .modal-body input,
body:not(.logged-in) #clone-template .modal-body button {
  opacity: 0.5;
  pointer-events: none;
}

body.auto-hide-canvas-menu .pinned {
  opacity: 0;
}

body.auto-hide-canvas-menu .pinned:hover {
  opacity: 1;
}

/* =========================================
   Media Queries
   ========================================= */
@media (max-width: 575px) {
  #text-editor-toolbar .link-form {
    top: 55%;
    left: 50%;
    transform: translateX(-50%);
  }

  #canvas-element-list {
    overflow: hidden !important;
  }
}

/* =========================================
   Starting Modal Changelogs
   ========================================= */
#changelog-wrapper > div:first-child > ul > li::after {
  content: "(Still hot)";
  color: #fdf4c0;
  font-size: 12px;
  margin-left: 6px;
  display: inline-block;
}

.clone-box-avatar-overlay {
  background-color: #382e32;
  background-image: url(../assets/triangles.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom;
}

.clone-box-avatar-overlay ._cover {
  height: 116.5px;
  background-color: #4f4046;
}

.clone-box-avatar-overlay ._cover img,
.clone-box-avatar-overlay ._avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.clone-box-avatar-overlay ._avatar {
  width: 100px;
  height: 100px;
  position: relative;
  z-index: 1;
}
.clone-box-avatar-overlay ._avatar::after {
  content: "?";
  font-size: 2.5rem;
  width: max-content;
  height: max-content;
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: -1;
}

.clone-box-avatar-overlay ._avatar img {
  background-color: #382e32;
  border-radius: 50%;
}

strong {
  font-weight: 700;
}

#element-list-btn-order-setting {
  width: max-content;
  height: max-content;
  right: 0;
  top: 0;
}

a {
  cursor: pointer;
}

#faq-text::after {
  content: "FAQ";
}
