/* Default Font Family and Basic Setup */
* {
  font-family: "Kanit", sans-serif;
  color: #333;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Lottery Image */
#lotteryImage {
  width: 100%; /* Default to 100% width to fit container */
  max-width: 800px; /* Ensures it doesn't exceed 800px on larger screens */
  height: auto;
  margin: 20px auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Navbar */
.custom-navbar {
  background: linear-gradient(to right, #02265c, #680034);
  padding: 10px 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-navbar a {
  color: #fff;
  font-size: 1.2rem;
  padding: 10px 15px;
  text-decoration: none;
  transition: color 0.3s;
}

.custom-navbar a:hover {
  color: #ffcccb;
}

/* Gradient Button */
.gradient-button {
  background: linear-gradient(45deg, #02265c, #680034);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  transition: 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.gradient-button:hover {
  background: linear-gradient(45deg, #2e66b9, #a3316a);
  transform: translateY(-2px);
}

/* Side Navigation */
.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background: #111;
  overflow-x: hidden;
  transition: 0.5s;
  padding-top: 60px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

.sidenav a {
  padding: 10px 30px;
  font-size: 1.5rem;
  color: #bfbfbf;
  display: block;
  transition: color 0.3s;
}

.sidenav a:hover {
  color: #f1f1f1;
  background: #333;
  border-radius: 4px;
}

.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
}

@media (max-height: 450px) {
  .sidenav {
    padding-top: 15px;
  }
  .sidenav a {
    font-size: 1.2rem;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .custom-navbar a {
    font-size: 1rem;
    padding: 8px 10px;
  }
  .gradient-button {
    font-size: 1rem;
    padding: 10px 20px;
  }
  #lotteryImage {
    width: 80%; /* Adjust to 80% width on tablets or small desktops */
    max-width: 100%; /* Ensure it doesn’t exceed 100% of container */
    height: auto;
  }
}

@media (max-width: 576px) {
  .custom-navbar {
    padding: 5px 15px;
  }
  #lotteryImage {
    width: 70%; /* Smaller width for mobile devices */
    height: auto;
  }
  .gradient-button {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
  .sidenav a {
    font-size: 1.25rem;
  }
}

/* Custom Container */
.custom-container {
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.custom-container:hover {
  transform: translateY(-2px); /* เพิ่มเอฟเฟกต์เล็กน้อยเมื่อ hover */
}

/* Header Styling */
.custom-container .header .list-group-item {
  background-color: #02265c;
  color: #fff;
  font-weight: 600;
  border: none;
  text-align: left;
  font-size: 1.1rem;
  padding: 10px;
  border-radius: 8px;
}

/* List Item Styling */
.custom-container .list-group li {
  padding: 8px 15px;
  margin-bottom: 5px;
  background-color: #f9f9f9;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.custom-container .list-group li:hover {
  background-color: #e8e8e8;
}

/* Button Styling */
.custom-btn {
  background: linear-gradient(45deg, #02265c, #680034);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.custom-btn:hover {
  background: linear-gradient(45deg, #2e66b9, #a3316a);
  transform: translateY(-2px);
}

.result-container {
  width: 100%; /* Make sure the container can take the full width of its parent */
  height: auto; /* Allow height to adjust based on content */
  position: relative; /* Establish a positioning context */
}

.canvas-wrapper {
  position: relative; /* Create a positioning context for the canvas */
  width: 100%; /* Set wrapper to full width of parent */
  height: 100%; /* Allow wrapper to take the full height */
}

canvas {
  position: absolute; /* Position the canvas absolutely within the wrapper */
  top: 0;
  left: 0;
  width: 100%; /* Make canvas width 100% of the wrapper */
  height: 100%; /* Make canvas height 100% of the wrapper */
  image-rendering: pixelated; /* Ensure pixelated rendering for crisp edges */
}
