/* DARK MODE SWITCH */
.dark-mode-toggle {
  cursor: pointer;
  position: absolute;
  top: 100px;
  right: 150px;
  border: none;
  background: transparent;
}

body:not(.user-is-tabbing) .dark-mode-toggle:focus {
  outline: none;
}

.dark-mode-toggle .moon {
  padding: 10px;
}

.dark-mode-toggle .sun {
  padding: 5px;
}

body .dark-mode-toggle .moon {
  display: none;
}

body .dark-mode-toggle .sun {
  display: inline-block;
}

body.dark .dark-mode-toggle .moon {
  display: inline-block;
}

body.dark .dark-mode-toggle .sun {
  display: none;
}

/* Switch */
.switch-toggle {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  width: 44px;
  height: 24px;
  border-radius: 20px;
  background-color: #e0e0e0;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-light .switch-toggle {
  background-color: #d1d1d1;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-toggle div {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-toggle:has(input:checked) {
  background-color: #1a73e8;
}

.switch-toggle input:checked+div {
  transform: translateX(20px);
}

body.theme-light .switch-toggle:has(input:checked) {
  background-color: #1a73e8;
}

@media (max-width: 768px) {
  .dark-mode-toggle {
    right: 10px;
  }
}

/* POPUP, DRAW AND PDF-PREVIEW  */
.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: #000;
  z-index: 999999;
  color: #ddd;
  padding: 100px;
  display: none;
}

.popup-container.show {
  display: block;
}

.popup-container .close-button {
  position: fixed;
  top: 0px;
  right: 0px;
  padding: 20px 30px;
  cursor: pointer;
  color: #ddd;
  background-color: transparent;
  border: none;
  font-size: 50pt;
  font-weight: bold;
}

.popup-container .close-button:hover {
  color: #fff;
  transition: color 0.5s ease;
}

.draw-container {
  font-family: var(--font-family-primary);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 99999;
  background-color: var(--bg-color);
  color: var(--font-color-primary);
}

.draw-container.show {
  display: flex !important;
}

.draw-container .output-header {
  margin-bottom: 3rem;
  text-align: center;
}

#diagram-canvas {
  cursor: crosshair;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.draw-container .buttons-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  padding: 0 40px;
}

.draw-container button {
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: #222;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  min-width: 220px;
}

.draw-container button:hover {
  background-color: #333;
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

#add-to-paper-button {
  background-color: #fff !important;
  color: #000 !important;
  border: none !important;
}

#add-to-paper-button:hover {
  background-color: #f0f0f0 !important;
}

#clear-draw-canvas {
  background-color: #ff3b30 !important;
  color: white !important;
  border: none !important;
  margin-top: 20px;
}

#clear-draw-canvas:hover {
  background-color: #ff2d55 !important;
}

.draw-container .close-button {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 2.5rem;
  background: none;
  border: none;
  color: var(--font-color-primary);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  width: auto;
  min-width: auto;
  padding: 10px;
}

.draw-container .close-button:hover {
  opacity: 1;
  transform: none;
  background: none;
}

.contributor-profile {
  display: inline-block;
  margin: 10px 5px;
  text-align: center;
  background-color: var(--elevation-background);
  color: var(--font-color-primary);
  padding: 10px;
  width: 130px;
  overflow: hidden;
  border-radius: 4px;
  height: 170px;
  box-shadow: 4px 3px 16px -3px #0009;
}

img.contributor-avatar {
  width: 100%;
}

.contributor-profile a {
  text-decoration: none;
  color: var(--font-color-primary);
  font-weight: bold;
  display: block;
  font-size: 10pt;
}

.contributor-username {
  margin-top: 7px;
}