/* Global Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  padding: 20px;
  margin: 0;
  text-align: center;
}

/* Section Styling */
main section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin: 20px auto;
  max-width: 800px;
  text-align: left;
}

main h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

h3 {
  color: #444;
  margin-top: 0;
}

/* Upload and Canvas Styling */
input[type="file"] {
  margin-top: 10px;
  display: block;
}

#templatePreviewContainer {
  margin-top: 15px;
}

#templatePreview {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #ccc;
}

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

#positionCanvas {
  width: 800px;               
  height: auto;               
  max-width: 100%;            
  border: 1px solid #ccc;
  display: block;
  margin: 10px auto;
  cursor: grab;               
}


/* Buttons */
button {
  padding: 10px 20px;
  margin: 10px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background-color: #007bff;
  color: #fff;
  transition: background-color 0.3s ease;
}

button:hover:not(:disabled) {
  background-color: #0056b3;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Certificate Thumbnails */
#certificates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding: 10px 0;
}

.certificate-wrapper {
  display: inline-block;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  padding: 5px;
  max-width: 200px;
}

.thumb {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  transition: transform 0.2s ease;
}

.thumb:hover {
  transform: scale(1.05);
}

/* Modal */
#modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
}

#fullImage {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.closeModal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  font-weight: bold;
}

/* Responsive Design */
@media screen and (max-width: 600px) {
  main section {
    padding: 15px;
  }

  button {
    width: 100%;
    margin: 10px 0;
  }

  #positionCanvas {
    height: 300px;
  }
}
