:root {
  --panel-bg: #2c2c2c;
  --canvas-bg: #1e1e1e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
}

main {
  width: 100%;
  height: 100%;
}

.app {
  display: flex;
  width: 100%;
  height: 100%;
}

.canvas {
  position: relative;
  flex: 1;
  background-color: #1e1e1e;
  overflow: hidden;
}

.canvas-element {
  position: absolute;
  cursor: pointer;
  transform-origin: center center;
}

.tools { 
  position: absolute; 
  bottom: 12px; 
  left: 50%; 
  transform: translateX(-50%); 
  display: flex; 
  gap: 10px; 
  padding: 8px 12px; 
  background: #2c2c2c; 
  border-radius: 8px; 
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); 
  z-index: 100;
}

.tools button {
  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: none;
  border-radius: 8px;

  color: #cfcfcf;
  font-size: 18px;
  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.tools button:hover {
  background: #2f2f2f;
  color: #ffffff;
}

.tools button.active {
  background: #0d99ff;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(13, 153, 255, 0.6);
}

.tools button:active {
  transform: scale(0.94);
}

.canvas-content {
  position: absolute;
  inset: 0;
  background-color: #1e1e1e;
}

.canvas-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.left-panel {
  width: 300px;
  min-width: 260px;
  height: 100%;
  display: flex;
  background-color: #2c2c2c;
  border-right: 1px solid #3a3a3a;
}

.right-panel {
  width: 280px;
  min-width: 260px;
  height: 100%;
  background-color: #2c2c2c;
  border-left: 1px solid #3a3a3a;
  display: flex;
}

.sidebar-icons {
  width: 56px;
  background-color: #252525;
  border-right: 1px solid #3a3a3a;

  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 6px;
}

.icon-item {
  width: 40px;
  height: 44px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;

  color: #cfcfcf;
  font-size: 11px;
  cursor: pointer;

  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-item i {
  font-size: 18px;
}

.icon-item:hover {
  background-color: #2f2f2f;
  color: #ffffff;
}

.icon-item.active {
  background-color: #3a3a3a;
  color: #ffffff;
}

.icon-item.logo {
  height: 40px;
  /* font-weight: 100; */
}

.icon-item.logo i {
  font-size: 20px;
  font-weight: 100;
}

.icon-item span {
  font-size: 10px;
  line-height: 1;
}

.icon-divider {
  width: 24px;
  height: 1px;
  background-color: #3a3a3a;
  margin: 6px 0;
}


.sidebar-icons {
  width: 48px;
  background-color: #252525;
  border-right: 1px solid #3a3a3a;
}

.sidebar-elements {
  flex: 1;
  display: flex;
  flex-direction: column;
  color: #eaeaea;
  font-family: system-ui, sans-serif;
}

.title {
  padding: 12px 16px;
  border-bottom: 1px solid #3a3a3a;
}

.title h2 {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.pages {
  padding: 12px 16px;
  border-bottom: 1px solid #3a3a3a;
}

.pages h3 {
  font-size: 12px;
  font-weight: 600;
  color: #bdbdbd;
  margin-bottom: 8px;
}

.page {
  height: 36px;
  background-color: #353535;
  border-radius: 6px;
  cursor: pointer;
  padding: 7px 10px;
  font-weight: 400;
}

.page p{
  font-size: 14px;
}

.page:hover {
  background-color: #3f3f3f;
}

.rectangle{
    width: 200px;
    height: 120px;
    background-color: #d9d9d9;
}

.text-content {
    min-width: 160px;
    min-height: 40px;
    padding: 6px;
    color: #ffffff;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    outline: none;
}

.text-content:empty::before {
    content: attr(data-placeholder);
    color: rgba(255,255,255,0.4);
    pointer-events: none;
}

.canvas-element.selected {
  outline: 2px solid #4da3ff;
  outline-offset: -2px;
}

/* Resize handles */
.resize-handle {
  width: 6px;
  height: 6px;
  background-color: #ffffff;
  border: 1px solid #4da3ff;
  position: absolute;
}

.resize-handle.top-left {
  top: -4px;
  left: -4px;
  cursor: nwse-resize;
}

.resize-handle.top-right {
  top: -4px;
  right: -4px;
  cursor: nesw-resize;
}

.resize-handle.bottom-left {
  bottom: -4px;
  left: -4px;
  cursor: nesw-resize;
}

.resize-handle.bottom-right {
  bottom: -4px;
  right: -4px;
  cursor: nwse-resize;
}

.rotate-handle {
  width: 10px;
  height: 10px;
  background: #4da3ff;
  border-radius: 50%;
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  cursor: grab;
}

/* Layers-Panel */

.layers-panel {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  padding: 10px;
  color: #fff;
  font-size: 14px;
}

.layers-panel h3 {
  font-size: 12px;
  font-weight: 600;
  color: #bdbdbd;
  margin-bottom: 8px;
}

#layer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#layer-list li {
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

#layer-list li:hover {
  background-color: #3f3f3f;
}

.layers-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.layer-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  background: #2f2f2f;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.layer-item.active {
  background: #4da3ff;
}

.layer-controls button {
  margin-left: 4px;
  cursor: pointer;
}

/* Properties-Panel */

.props-panel {
  font-size: 14px;
  width: 100%;
  padding: 12px 16px;
  color: #eaeaea;
  font-family: system-ui, sans-serif;
  display: none;
}

.props-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.props-panel h3 {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 14px;
}

.prop-group {
  gap: 6px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.prop-group label {
  margin-bottom: 4px;
  opacity: 0.8;
  font-size: 12px;
  color: #bdbdbd;
}

.prop-group input,
.prop-group textarea {
  background-color: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 6px 8px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
}

.textOnly {
  display: none;
}

.prop-group input[type="number"] {
  height: 32px;
}

.prop-group input[type="color"] {
  padding: 0;
  height: 32px;
  cursor: pointer;
}

.prop-group textarea {
  resize: none;
  font-family: inherit;
}

.prop-group input:focus,
.prop-group textarea:focus {
  border-color: #4a90e2;
}

.textOnly {
  display: none;
}

.text-element-selected .textOnly {
  display: flex;
}

.upBtn,
.downBtn {
  width: 22px;
  height: 22px;

  background: transparent;
  border: none;
  border-radius: 4px;

  color: #9e9e9e;
  cursor: pointer;

  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.08s ease;
}

.upBtn:hover,
.downBtn:hover {
  background-color: #2f2f2f;
  color: #ffffff;
}

.upBtn:active,
.downBtn:active {
  transform: scale(0.92);
}
