/* Import Google font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --primary: #2596ff;
  --bgprimary: #eeeeee;
  --bgsecondary: #ffffff;
  --txtpositive: #282828;
  --txtnegative: #fff;
}

.body{
  display: flex;
  background: var(--bgprimary);
}

.main{
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: center;
  padding: 4rem;
  background: var(--bgsecondary);
  margin: 1rem;
  border-radius: .5rem;
  border: 1px dashed #282828;
}

.sidebar{
  background: var(--bgsecondary);
  padding: 1rem;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar ul{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .4rem;
  height: 100%;
}

.top, .bottom{
display: grid;
gap: .5rem;
}

.sidebar ul li{
  padding: 1rem;
  display: grid;
  place-items: center; 
  border-radius: .25rem;
  height: 4rem;
  aspect-ratio: 1;
  cursor: pointer;
}

.sidebar ul .active{
  background: var(--primary);
  z-index: 1;
  color: var(--txtnegative);
}

.inactive {
background: var(--bgprimary);
transition: background 0.3s;
}

.inactive:hover {
background: #ccc;
}

.bottom img {
  width: 100%;
}

a li img{
  width: 100%;
}

.goBack {
  position: absolute; /* Add this line */
  top: 1.2rem; /* Adjust the top distance as needed */
  left: 7rem; /* Adjust the left distance as needed */
  width: 3rem;
  text-decoration: none;
  background: none;
  border: none;
  border-radius: .15rem;
  margin: .8rem .7rem;
  cursor: pointer;
  transition: .6s;
}
.goBack:hover {
  width: 3rem;
  transition: .8s;
  margin: .8rem .7rem;
  padding-right: 1.5rem;
}

.goBack img {
  width: 2rem;
}

.container{
  display: flex;
  width: 100%;
  height: 100%;
  gap: 10px;
  padding: 10px;
  max-width: 1500px;
  max-height: 1200px;
}
section{
  background: var(--bgprimary);
  border-radius: 7px;
}
.tools-board{
  width: 210px;
  padding: 15px 22px 0;
}
.tools-board .row{
  margin-bottom: 20px;
}
.row .options{
  list-style: none;
  margin: 10px 0 0 5px;
}
.row .options .option{
  display: flex;
  cursor: pointer;
  align-items: center;
  margin-bottom: 10px;
}
.option:is(:hover, .active) img{
  filter: invert(17%) sepia(90%) saturate(3000%) hue-rotate(900deg) brightness(100%) contrast(100%);
}
.option :where(span, label){
  color: #5A6168;
  cursor: pointer;
  padding-left: 10px;
}
.option:is(:hover, .active) :where(span, label){
  color: #4A98F7;
}
.option #fill-color{
  cursor: pointer;
  height: 14px;
  width: 14px;
}
#fill-color:checked ~ label{
  color: #4A98F7;
}
.option #size-slider{
  width: 100%;
  height: 5px;
  margin-top: 10px;
}
.colors .options{
  display: flex;
  justify-content: space-between;
}
.colors .option{
  height: 20px;
  width: 20px;
  border-radius: 50%;
  margin-top: 3px;
  position: relative;
}
.colors .option:nth-child(1){
  background-color: #fff;
  border: 1px solid #bfbfbf;
}
.colors .option:nth-child(2){
  background-color: #000;
}
.colors .option:nth-child(3){
  background-color: #E02020;
}
.colors .option:nth-child(4){
  background-color: #6DD400;
}
.colors .option:nth-child(5){
  background-color: #4A98F7;
}
.colors .option.selected::before{
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  height: 12px;
  width: 12px;
  background: inherit;
  border-radius: inherit;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
}
.colors .option:first-child.selected::before{
  border-color: #ccc;
}
.option #color-picker{
  opacity: 0;
  cursor: pointer;
}
.row-buttons button{
  width: 100%;
  color: #000000;
  border: none;
  outline: none;
  padding: 11px 0;
  font-size: 0.9rem;
  margin-bottom: 13px;
  background: none;
  border-radius: 4px;
  cursor: pointer;
}
.row-buttons .clear-canvas{
  color: #6C757D;
  border: 1px solid #6C757D;
  transition: all 0.3s ease;
}
.clear-canvas:hover{
  color: #fff;
  background: #6C757D;
}
.row-buttons .save-img{
  background: #4A98F7;
  border: 1px solid #4A98F7;
  color: #fff;
}
.drawing-board{
  flex: 1;
  overflow: hidden;
}
.drawing-board canvas{
  width: 100%;
  height: 100%;
}

.calculator {
  max-width: 20rem;
  width: 100%;
  border-radius: 12px;
  padding: .5rem;
  background: #fff;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 50px 5px;
  position: absolute;
  transform: translate(-35%, -50%);
  top: 50%;
  left: 50%;
  z-index: 3;
  display: none;
}
.calculator #display {
  height: 80px;
  width: 100%;
  outline: none;
  border: none;
  text-align: right;
  margin-bottom: 10px;
  font-size: 25px;
  color: #000e1a;
}
.calculator .buttons {
  display: grid;
  grid-gap: .5rem;
  grid-template-columns: repeat(4, 1fr);
}
.calculator .buttons button {
  padding: .5rem;
  border-radius: 6px;
  border: none;
  font-size: 20px;
  cursor: pointer;
  background-color: #fff;
  box-shadow: rgba(0, 0, 0, 0.178) 0px 0px 2px .5px;
}
.calculator .buttons button:active {
  transform: scale(0.99);
}
.calculator .operator {
  color: #2f9fff;
}
#equal {
  background-color: #0099ff;
}
#equal:hover {
  background: #4583e7;
}

#btnRed {
  background: #ff0000;
  color: #fff;
}

#btnOrange {
  background: #ffb30e;
}


#overlay {
  position: fixed; /* Sit on top of the page content */
  display: none; /* Hidden by default */
  width: 100%; /* Full width (cover the whole page) */
  height: 100%; /* Full height (cover the whole page) */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5); /* Black background with opacity */
  z-index: 2; /* Specify a stack order in case you're using a different order for other elements */
  cursor: pointer; /* Add a pointer on hover */
}

/* preloader */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}