body {
  font-family: "Segoe UI", Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #74ebd5 0%, #9face6 100%);
}

.container {
  background: #fff;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  animation: fadeIn 0.6s ease-in-out;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: #333;
  text-align: center;
}

textarea, input {
  width: 100%;
  padding: 0.625rem;
  margin: 0.625rem 0;
  border: 1px solid #ddd;
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border 0.3s;
  display: block;
  box-sizing: border-box;
}

textarea {
  resize: none;
  height: 7.5rem;
}

textarea:focus, input:focus {
  border-color: #6c63ff;
  outline: none;
}

.btn-group {
  display: flex;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 0.9375rem;
}

button {
  flex: 1;
  padding: 0.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: white;
  transition: transform 0.2s, background 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
}

button:hover {
  transform: scale(1.05);
}

#encryptButton {
  background-color: #28a745;
}

#encryptButton:hover {
  background-color: #218838;
}

#decryptButton {
  background-color: #007bff;
}

#decryptButton:hover {
  background-color: #0056b3;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.checkbox-group input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 0.95rem;
  color: #333;
}

#output {
  margin-top: 1.25rem;
  padding: 0.9375rem;
  background: #f8f9fa;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  text-align: left;
  word-wrap: break-word;
  border: 1px solid #ddd;
  max-height: 9.375rem;
  overflow-y: auto;
}

#copyButton {
  margin-top: 0.625rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: white;
  background-color: #6c757d;
  transition: transform 0.2s, background 0.3s;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#copyButton:hover {
  background-color: #5a6268;
  transform: scale(1.05);
}

.error {
  color: #dc3545;
  font-weight: bold;
}

@keyframes fadeIn {
  from {opacity: 0; transform: translateY(-0.625rem);}
  to {opacity: 1; transform: translateY(0);}
}

@media screen and (max-width: 600px) {
  .container {
    padding: 1rem;
    max-width: 90%;
  }

  h1 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  textarea, input {
    padding: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
  }

  textarea {
    height: 6rem;
  }

  .btn-group {
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  button {
    padding: 0.625rem;
    font-size: 0.875rem;
  }

  .checkbox-group {
    margin-top: 0.5rem;
  }

  .checkbox-group label {
    font-size: 0.875rem;
  }

  #output {
    margin-top: 1rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    max-height: 7.5rem;
  }

  #copyButton {
    margin-top: 0.5rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
  }
}