@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #000000;
}

 ::selection {
   background: #1d4ed8;
   color: #fff;
 }
 
 ::-moz-selection {
   background: #1d4ed8;
   color: #fff;
 }

.divider {
  height: 2px;
  background-color: #222;
  margin: 20px 0;
}

*::-webkit-scrollbar {
  width: 16px;
}

*::-webkit-scrollbar-track {
  background: #000000;
}

*::-webkit-scrollbar-thumb {
  background-color: #777;
  border-radius: 10px;
  border: 4px solid #000000;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

.container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  max-width: 2000px;
  width: 100%;
  background: #000000;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.edit-mode .container {
  border: 2px solid red;
}

.title {
  color: #ccc;
}

.tools-board {
  flex: 1 1 270px;
  max-width: 270px;
  padding: 20px;
  background: #000000;
  border: 2px solid #242424;
  border-radius: 10px;
}

.tools-board .row {
  margin-bottom: 20px;
}

.row .options {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.option {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 15px;
  background: none;
  border: none;
  padding: 10px;
  border-radius: 5px;
  transition: background 0.3s;
}

.option:hover,
.option.active {
  background: #1d1d1d;
}

.option img {
  filter: invert(100%);
}

.option span, .option label {
  color: #ccc;
  cursor: pointer;
  padding-left: 10px;
}

#fill-color {
  cursor: pointer;
  height: 18px;
  width: 18px;
}

#fill-color:checked ~ label {
  color: #fff;
}

#size-slider {
  width: 100%;
  height: 5px;
  background-color: #222;
  appearance: none;
  border-radius: 5px;
  transition: background-color 0.3s;
}

#size-slider:hover {
  background-color: #a1a1a1;
}

#size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  background-color: #bbb;
  border-radius: 50%;
  cursor: pointer;
}

#size-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background-color: #bbb;
  border-radius: 50%;
  cursor: pointer;
}

.colors .options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.colors .option {
  height: 30px;
  width: 30px;
  border-radius: 50%;
  margin-top: 3px;
  margin-right: 10px;
  position: relative;
  border: 2px solid #444;
  cursor: pointer;
  transition: transform 0.3s;
}

.colors .option:hover {
  transform: scale(1.2);
}

.colors .option:nth-child(1) { background-color: #FFFFFF; }
.colors .option:nth-child(2) { background-color: #FF5252; }
.colors .option:nth-child(3) { background-color: #FFD740; }
.colors .option:nth-child(4) { background-color: #4CAF50; }
.colors .option:nth-child(5) { background-color: #2196F3; }
.colors .option:nth-child(6) { background-color: #FF4081; }
.colors .option:nth-child(7) { background-color: #FF9800; }
.colors .option:nth-child(8) { background-color: #00BCD4; }
.colors .option:nth-child(9) { background-color: #9C27B0; }
.colors .option:nth-child(10) { background-color: #FFC107; }

.colors .option.selected::before {
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  height: 22px;
  width: 22px;
  background: inherit;
  border-radius: inherit;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
}

.option #color-picker {
  opacity: 0;
  cursor: pointer;
}

.buttons button {
  width: 100%;
  color: #fff;
  border: none;
  outline: none;
  padding: 12px 0;
  font-size: 1.0rem;
  margin-bottom: 15px;
  background: #4a90e2;
  user-select: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.buttons button:hover {
  background: #357abd;
  transform: translateY(-3px);
}

.buttons .clear-canvas {
  background-color: #555;
  border: 2px solid transparent;
}

.buttons .clear-canvas:hover {
  background-color: #e73636;
  border: 2px solid transparent;
}

.buttons .resize-board {
  display: inline-block;
  background-color: #555;
  border: 2px solid transparent;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

.buttons .resize-board:hover {
  background-color: #444;
}

.buttons .resize-input {
  width: 100px;
  padding: 5px;
  border: 2px solid #777;
  background-color: #555;
  color: #fafafa;
  border-radius: 5px;
  font-size: 14px;
  margin-left: 5%;
}

.buttons .resize-input {
  display: none;
}

.buttons .resize-board.edit-mode .resize-input {
  display: inline-block;
}

.buttons .refresh-board, .buttons .save-img {
  background: #fafafa;
  color: #0d0d0d;
}

.buttons .refresh-board:hover, .buttons .save-img:hover {
  background: #ccc;
}

.drawing-board {
  position: relative;
  flex: 1;
  overflow: hidden;
  background-color: #000;
  border: 2px solid #242424;
  border-radius: 7px;
}

.drawing-board canvas {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  display: block;
}

@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }
  
  .tools-board {
    flex: 1 1 100%;
    max-width: 100%;
    order: 2;
  }

  .drawing-board {
    flex: 1 1 100%;
    max-width: 100%;
    order: 1;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .tools-board {
    padding: 15px;
  }
  
  .buttons button {
    font-size: 0.9rem;
    padding: 10px 0;
  }
}