html, body {
  background-color:#ffffff;
}

#apainter-ui {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  display: block !important;
}

#apainter-ui * {
  pointer-events: auto;
}

.woxcreate-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: rgba(25, 25, 25, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  box-sizing: border-box;
  color: #fff;
  border-bottom: 1px solid #333;
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.icon-button {
  background: none;
  border: none;
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s, background-color 0.2s;
  border-radius: 4px;
}

.icon-button.small {
  font-size: 14px;
  padding: 2px 5px;
  opacity: 0.7;
}

.icon-button.small:hover {
  opacity: 1;
  background-color: rgba(255,255,255,0.1);
}

.icon-button:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.icon-button.active {
  color: #fff;
  background-color: #ef2d5e; /* Distinct active color */
}

.icon-button.disabled {
  opacity: 0.3;
  pointer-events: none;
}

#painting-name {
  font-weight: 500;
  font-size: 14px;
}

.color-preview {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
}

.woxcreate-side-controls {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(40, 40, 40, 0.8);
  padding: 15px 5px;
  border-radius: 20px;
  width: 30px;
  height: 150px;
}

.slider-container input[type=range] {
  writing-mode: bt-lr; /* IE */
  -webkit-appearance: slider-vertical; /* WebKit */
  width: 8px;
  height: 110px;
  padding: 0 5px;
}

.slider-label {
  font-size: 9px;
  color: #aaa;
  margin-top: 5px;
  text-transform: uppercase;
}

.undo-redo-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.undo-redo-container button {
  background: rgba(40, 40, 40, 0.8);
  border: none;
  color: #fff;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}

.popover {
  position: absolute;
  background: #222;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  z-index: 2000;
}

.popover.hidden, #color-popover.hidden, #brush-popover.hidden, #gallery-popover.hidden, #brush-settings-popover.hidden {
  display: none !important;
}

#color-popover {
  top: 60px;
  right: 15px;
  width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.color-wheel-container {
    width: 220px;
    height: 220px;
    margin-bottom: 10px;
}

#color-wheel-canvas {
    border-radius: 50%;
    cursor: crosshair;
}

.brightness-slider-container {
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.brightness-slider-container input[type=range] {
    width: 100%;
}

#brush-popover {
  top: 60px;
  right: 15px;
  max-height: 500px;
  overflow-y: auto;
  width: 280px;
  background: #1c1c1e;
  border-radius: 12px;
}

#layers-popover {
  top: 60px;
  right: 15px;
  width: 280px;
  background: #1c1c1e;
  border-radius: 12px;
}

.layer-item {
    transition: background-color 0.2s;
}
.layer-item:hover {
    background-color: #333;
}

#brush-settings-popover {
  top: 60px;
  right: 310px; /* To the left of brush popover */
  width: 200px;
  background: #1c1c1e;
}

#gallery-popover {
  top: 60px;
  left: 15px;
  width: 200px;
  background: #1c1c1e;
}

.gallery-item {
  padding: 15px;
  color: #fff;
  cursor: pointer;
  border-bottom: 1px solid #2c2c2e;
  text-align: center;
  font-size: 14px;
}

.gallery-item:hover {
  background: #2c2c2e;
}

.gallery-item:last-child {
  border-bottom: none;
}

.brush-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  color: #fff;
  cursor: pointer;
  border-bottom: 1px solid #2c2c2e;
  transition: background 0.2s;
}

.brush-item:last-child {
  border-bottom: none;
}

.brush-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #333;
  object-fit: cover;
}

.brush-item span {
  font-size: 14px;
  font-weight: 400;
  text-transform: capitalize;
}

.brush-item:hover {
  background: #2c2c2e;
}

.brush-item.active {
  background: #3a3a3c;
}

.brush-item.active span {
  color: #ef2d5e;
}

#apainter-ui .progress {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  padding: 10px 20px;
  border-radius: 10px;
  color: #ef2d5e;
}

#apainter-ui .bar {
  height: 3px;
  background: #ef2d5e;
  width: 0%;
  transition: width 0.3s;
}

#apainter-ui .hide {
  display: none !important;
}

#woxcreate-logo {
  position: fixed;
  bottom: 15px;
  left: 15px;
  height: 54px;
  width: 226px; /* 252px; for logo with author */
  background-image: url(../assets/images/woxcreate-banner.png);
}

#woxcreate-logo.hidden, #woxcreate-author.hidden{
  display: none;
}

#woxcreate-author {
  position: fixed;
  bottom: 28px;
  left: 268px;
  display: inline-block;
  font: 18px arial, sans-serif;
  color: #e42b5a;
}

/* Color Palette */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  width: 150px; /* Adjust as needed */
  justify-content: center;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #555;
  transition: transform 0.1s, border-color 0.2s;
}

.color-swatch:hover {
  transform: scale(1.1);
  border-color: #fff;
}

/* Transform Bottom Bar */
.transform-bottom-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(25, 25, 25, 0.95);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #444;
    display: flex;
    gap: 10px;
    z-index: 2000;
}

.transform-bottom-bar.hidden {
    display: none !important;
}

.text-button {
    background: none;
    border: 1px solid #555;
    color: #ccc;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.text-button:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.text-button.active {
    background: #ef2d5e;
    color: #fff;
    border-color: #ef2d5e;
}