/* Global Styles */
body {
  font-family: "Arial", sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f0f4f8, #d9e3f0);
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Main Container */
.container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 20px;
  max-width: 90%;
  text-align: center;
}

/* Headings */
h1 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #4a4e69;
}

h2 {
  font-size: 20px;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #4a4e69;
}

/* Controls Section */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  background-color: #f4f6fc;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.controls-label {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.controls-input {
  width: 70px;
  padding: 6px;
  font-size: 14px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.controls-input:focus {
  outline: none;
  border-color: #6a82fb;
  box-shadow: 0 0 5px rgba(106, 130, 251, 0.5);
}

.controls-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.controls-buttons button {
  padding: 6px 12px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  background-color: #6a82fb;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.controls-buttons button:hover {
  background-color: #5a72db;
}

.controls-buttons button:active {
  background-color: #4a62cb;
}

/* Grid Section */
.grid-container {
  margin-top: 20px;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  background: #fafafa;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  max-width: 90vw;
  max-height: 80vh;
  margin-top: 10px;
}
.grid {
  display: grid;
  gap: 1px; /* Adjust gap for better appearance with smaller grids */
  margin-top: 10px;
  transition: grid-template-columns 0.3s ease, grid-template-rows 0.3s ease;
}

.grid div {
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  background-color: white;
  user-select: none;
  -webkit-user-drag: none;
  transition: background-color 0.2s ease-in-out, border-color 0.2s;
}

.grid div.active {
  background-color: #6a82fb;
  border-color: #5a72db;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .controls {
    flex-direction: column;
    gap: 8px;
  }

  .controls-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .grid div {
    width: 20px;
    height: 20px;
  }
}

.grid div.active {
  background-color: #6a82fb;
}

/* ASCII Section */
.ascii-container {
  position: relative;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  margin-top: 20px;
  background-color: #f9f9f9;
  font-family: monospace;
  overflow-x: auto;
  white-space: pre;
  max-width: 90vw;
  max-height: 200px;
  text-align: start;
}

.ascii-output {
  padding-right: 30px;
}

.copy-button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 40px;
  height: 40px;
  background-color: #ddd;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-button svg {
  width: 28px;
  height: 28px;
  fill: #333;
}

.copy-button:hover {
  background-color: #ccc;
}

.copy-notification {
  margin-top: 8px;
  font-size: 14px;
  color: #fff;
  background-color: #4caf50;
  text-align: center;
  border-radius: 4px;
  padding: 4px 8px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  max-width: fit-content;
}

.copy-notification.error {
  background-color: #f44336;
}
.footer {
  margin-top: 30px;
  text-align: center;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 14px;
  margin-top: 20px;
}

.github-link svg {
  width: 24px;
  height: 24px;
  fill: #333;
  transition: fill 0.3s ease;
}

.github-link:hover svg {
  fill: #6a82fb;
}

.github-link:hover {
  color: #6a82fb;
}
