/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
  padding: 2rem;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  background-color: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  text-align: center;
  font-size: 1rem;
  color: #777;
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sample-btn {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.sample-btn:hover {
  background-color: #5a6268;
}

textarea {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  margin-bottom: 1rem;
  background-color: #fafafa;
}

/* 出力エリアのtextarea */
#outputText {
  margin-bottom: 0.5rem;
}

textarea:focus {
  outline: none;
  border-color: #007acc;
  background-color: #fff;
}

.button-area {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

button {
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
  background-color: #007acc;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #005fa3;
}

.output-area {
  margin-top: 1rem;
}

.output-wrapper {
  position: relative;
}

.copy-btn-container {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  position: relative;
}

.copy-btn {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.copy-btn:hover {
  background-color: #218838;
}

.set-input-btn {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  background-color: #17a2b8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.set-input-btn:hover {
  background-color: #138496;
}

.toast {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  background-color: #333;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.9rem;
  color: #777;
}

.footer a {
  color: #007acc;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .input-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .sample-btn {
    align-self: flex-end;
  }
  body {
    padding: 1rem;
  }

  .container {
    padding: 1.5rem;
    border-radius: 8px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  textarea {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  button {
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
  }

  .copy-btn, .set-input-btn {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
  }

  .toast {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  footer {
    margin-top: 2rem;
    font-size: 0.85rem;
  }
}

/* 小さいモバイルデバイス対応 */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.3rem;
  }

  .subtitle {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  textarea {
    rows: 5;
    min-height: 100px;
  }

  .button-area {
    margin-bottom: 1rem;
  }
}
