html,
body,
svg {
  padding: 0;
  margin: 0;
  font-family:
    Liberation sans,
    sans-serif;
}

#canvas {
  transform-origin: 0 0;
}

#loadingMessage {
  font-size: 1.5em;
  background: #eee linear-gradient(#eeeeee, #cccccc);
  padding: 20px;
  width: 40%;
  line-height: 50px;
  text-align: center;
  border-radius: 10px;
  position: fixed;
  top: 40%;
  left: 30%;
  z-index: 1;
  box-shadow: 0 0 2px #333333;
  transition: 1s;
}

#loadingMessage.hidden {
  display: none;
  opacity: 0;
  z-index: -1;
}

#loadingMessage::after {
  content: "...";
}

/* -------------------------MENU--------------------------------------- */
/* -------------------------MENU--------------------------------------- */
/* -------------------------MENU--------------------------------------- */
/* -------------------------MENU--------------------------------------- */
/* -------------------------MENU--------------------------------------- */
/* -------------------------MENU--------------------------------------- */
/* -------------------------MENU--------------------------------------- */
/* -------------------------MENU--------------------------------------- */
/* -------------------------MENU--------------------------------------- */
  #menu {
            position: fixed;
            top: 50%;
            transform: translate(-50%, -50%);
            left: 3%; 
            max-height: calc(100vh - 40px);
            /* width: 70px;  */
            /* background: white; */
            border-radius: 16px;
            /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);  */
            padding: 12px;
            display: flex;
            flex-direction: column;
            align-items: center;
            z-index: 1000;
            outline: none;
            /* overflow-y: auto; */
        }

        #menuItems {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }

        ul.tools {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
            background-color: #f3f3f6;
            border-radius: 12px;
            padding: 6px 8px;
        }

        .curTool{
            background-color: #b8bfd1!important;
            color: #fff;
            border: 1px solid #333;
        }

        .tool {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 46px;
            height: 46px;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.15s ease;
            position: relative;
            outline: none;
            /* background: transparent; */
            border: 2px solid transparent;
        }

        /* #menu .tool:hover {
            background-color: #f8fafc;
            border-color: #e2e8f0;
        } */

        .tool.active {
            background: #3b82f6;
            border-color: #3b82f6;
        }

        .tool-icon {
            width: 32px;
            height: 32px;
            object-fit: contain;
        }

        .tool.active .tool-icon {
            filter: brightness(0) invert(1);
        }

        /* Pen tool - active with blue background */
        .tool.pen-active {
            background: #1e40af;
            color: white;
        }

/* Tooltip */
.tool-name {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #2b2b2b;
    padding: 12px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    white-space: nowrap;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        visibility 0s linear 0.35s; /* delay hide until fade-out is done */
}

.tool:hover .tool-name {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0px);
    pointer-events: auto; /* allow clicking */
}

/* Range slider inside tooltip */
.rangeChooser {
    -webkit-appearance: none;
    appearance: none;
    width: 120px; /* adjust to fit tooltip */
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
    margin-top: 6px;
    margin-bottom: 4px;
    cursor: pointer;
}

/* Track styling (Chrome/Edge/Safari) */
.rangeChooser::-webkit-slider-runnable-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* Thumb styling (Chrome/Edge/Safari) */
.rangeChooser::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    background: #fff;
    border-radius: 50%;
    border: 2px solid #0d47c3;
    margin-top: -5px; /* center on track */
    transition: background 0.2s ease, transform 0.2s ease;
}
.rangeChooser::-webkit-slider-thumb:hover {
    background: #041a62;
    transform: scale(1.15);
}

/* Track styling (Firefox) */
.rangeChooser::-moz-range-track {
    height: 6px;
    background: rgba(119, 119, 119, 0.63);
    border-radius: 3px;
}

/* Thumb styling (Firefox) */
.rangeChooser::-moz-range-thumb {
    height: 16px;
    width: 16px;
    background: #fff;
    border-radius: 50%;
    border: 2px solid #0d47c3;
    transition: background 0.2s ease, transform 0.2s ease;
}
.rangeChooser::-moz-range-thumb:hover {
    background: #00007b;
    transform: scale(1.15);
}

        .secondaryIcon {
            position: absolute;
            bottom: 0px;
            right: -2px;
            width: 14px;
            height: 14px;
            border: 2px solid white;
            border-radius: 50%;
        }

        .tool.has-secondary .secondaryIcon {
            display: block;
        }

        .tool.noSecondary .secondaryIcon {
            display: none;
        }

        .sub-items .tool{
          width: 38px !important;
          height: 38px !important;
          margin: 5px;
          padding: 1px;
        }
    

        /* Color picker tool */
        .tool.color-tool #chooseColor {
            width: 32px;
            height: 32px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            cursor: pointer;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background: transparent;
        }

        .tool.color-tool #chooseColor::-webkit-color-swatch-wrapper {
            padding: 0;
        }

        .tool.color-tool #chooseColor::-webkit-color-swatch {
            border: none;
            border-radius: 6px;
        }

        .tool.color-tool:hover #chooseColor {
            border-color: #3b82f6;
        }

        /* Size and opacity tools with compact sliders */
        .tool.slider-tool {
            height: 60px;
            flex-direction: column;
            padding: 6px;
            gap: 4px;
        }

        .tool.slider-tool .tool-icon {
            width: 20px;
            height: 20px;
        }

        .slider-label {
            font-size: 8px;
            color: #64748b;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin: 0;
        }

        .rangeChooser {
            width: 50px;
            height: 2px;
            -webkit-appearance: none;
            appearance: none;
            background: #819ee6;
            border-radius: 2px;
            outline: none;
        }

        .rangeChooser::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 15px;
            height: 15px;
            border-radius: 50%;
            background: #3b82f6;
            cursor: pointer;
            border: 2px solid white;
            /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); */
        }

.drawer.drawer--dark
{
  margin-left: .5rem ;
}
.color-picker-item {
  position: relative;
    display: flex;       /* Keep presets close horizontally */
  align-items: center
}

.colorPicker-wrapper {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 48px;
  cursor: pointer;
}

.colorPicker-wrapper img {
 width: 30px;
  height: 30px;
}

.colorPicker-wrapper input[type="color"] {
  position: absolute;
    top: 31%;
    left: 50%;
    width: 65%;
    height: 40%;
  transform: translate(-50%, -50%);
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.colorPicker-wrapper input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.colorPicker-wrapper input::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

/* Side presets (hidden by default) */
.colorPresets-side {
  position: absolute;
  left: 40px; /* space from main icon */
  top: -20px;
  background: #2b2b2b;
  padding: 12px;
  border-radius: 20px;
  display: flex;
  flex-direction: row;
  gap: 6px;
opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.colorPresetButton {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

.colorPresetButton:hover {
  transform: scale(1.2);
}

.color-picker-item:hover .colorPresets-side {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}


.color-picker-item.open .colorPresets-side {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
