body {
  margin: 10px;
  padding: 0;
  background-image: url(images/background.png);
  color: white;
  font-family: 'Patrick Hand', cursive;
  overflow-x: hidden;
}

.canvas-container {
  justify-content: space-evenly;
  text-align: center;
  margin: auto;
  margin-top: 65px;
  z-index: 999;
  transition: margin-top 0.3s ease-in-out;
}

.colors, .strokeWidth {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap; 
}

#canvas {
  max-width: 100%;  /* Maximum width to fit the screen */
  min-width: 100px; /* Minimum width to maintain usability */
  width: auto;      
  height: auto;    
  margin: auto;    
  box-sizing: border-box;
  box-shadow: none;
  border: 5px solid #666;
  border-radius: 8px;
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
  touch-action: manipulation !important;
  -ms-touch-action: none !important;
  user-select: none !important;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Media Query for landscape orientation */
@media screen and (orientation: landscape) {
  #canvas {
    height: 80vh !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  .canvas-container {
    margin-top: 45px;
    width: 100%;
  }
}

/* Media Queries for smaller screens */
@media only screen and (max-width: 768px) {
  #canvas {
    max-width: 95%;
    touch-action: none; /* Prevents default touch actions */
  }
  
  #drawingMode {
    width: 90%;
    font-size: 14px;
    padding: 8px;
    margin: 5px auto;
  }
  
  .colors, .strokeWidth {
    justify-content: center;
    gap: 5px;
    padding: 5px;
  }
  
  .strokeColor, .strokeWidth {
    width: 25px;
    height: 25px;
    margin: 2px;
  }
  
  button {
    padding: 6px;
    font-size: 12px;
    margin: 5px 2px;
    min-width: 60px;
  }

  input[type="range"] {
    width: 80%;
    margin: 10px auto;
  }
  
  select {
    max-width: 90%;
    overflow-x: hidden;
  }
  
  optgroup {
    font-size: 13px;
  }
  
  option {
    padding: 8px;
  }
  
  #drawingMode {
    width: 90%;
    font-size: 16px;
  }
  
  .colors, .strokeWidth {
    justify-content: center;
  }
  
  .strokeColor, .strokeWidth {
    width: 30px;
    height: 30px;
    margin: 3px;
  }
  
  button {
    padding: 8px;
    font-size: 14px;
    margin: 8px 3px;
  }
  
  #header {
    font-size: 30px;
  }
}

@media only screen and (max-width: 480px) {
  .strokeColor, .strokeWidth {
    width: 25px;
    height: 25px;
    margin: 2px;
  }
  
  button {
    padding: 6px;
    font-size: 12px;
  }
  
  #header {
    font-size: 24px;
  }
}




#resize {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 999999;
}

.top-icons {
  position: absolute;
  top: 20px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 999999;
}

#toggleCanvas {
  color: white;
  font-size: 24px;
  cursor: pointer;
}

#add {
  width: 25px;
  height: 25px;
  cursor: pointer;
}

input[type="color"] {
  cursor: pointer;
}


.tool-buttons {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  margin: 10px 0;
}

.tool-icon {
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.2s;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
  padding: 8px;
  color: white;
}

.tool-icon:hover {
  transform: scale(1.1);
}

#color {
  height: 32px;
  width: 32px;
  padding: 2px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

.strokeColor {
  width: 40px;
  height: 40px;
  margin: 5px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  border: 2px solid white;
}

.strokeWidth {
  width: 30px;
  height: 30px;
  font-size: 20px;
  margin: 5px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  border: 2px solid white;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
}

footer {
  text-align: center;
  margin-top: 20px;
}

footer p {
  font-size: 20px;
  color: white;
}

#drawingMode,#fontSelector {
  height: 40px;
  background-color: black;
  color: white;
  text-align: center;
  border: none;
  border-radius: 5px;
  width: auto;
  font-size: 20px;
}

#header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 40px;
  z-index: 1000;
}

