* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, sans-serif;
}

body {
  background: linear-gradient(to bottom right, #d4fc79, #96e6a1);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background-color: #ffffff;
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 100%;
  max-width: 520px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  position: relative;
}

.info-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.4rem;
  color: #777;
  cursor: pointer;
  transition: color 0.3s;
}

.info-icon:hover {
  color: #2e7d32;
}

.title {
  font-size: 2.7rem;
  color: #2563eb;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #555;
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form input {
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: 0.2s border-color;
  outline: none;
}

.form input:focus {
  border-color: #38b000;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  padding: 0.9rem 1.3rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-green {
  background-color: #38b000;
  color: white;
}
.btn-green:hover {
  background-color: #2e7d32;
}

.btn-blue {
  background-color: #0091d5;
  color: white;
}
.btn-blue:hover {
  background-color: #006da4;
}

.btn-red {
  background-color: #e63946;
  color: white;
  margin-top: 1.5rem;
}
.btn-red:hover {
  background-color: #c62828;
}

.btn-copy {
  background-color: #6c63ff;
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
}
.btn-copy:hover {
  background-color: #5548e0;
}

.result {
  display: none;
  margin-top: 2rem;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.4s ease-in-out;
}

.result input {
  padding: 0.8rem;
  border-radius: 0.75rem;
  border: 1px solid #ccc;
  font-size: 1rem;
  text-align: center;
  background-color: #f4f4f4;
  font-weight: bold;
}

footer {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.9rem;
  color: #333;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
  position: relative;
}

.modal-content h2 {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  color: #2f7e4d;
  text-align: center;
}

.close {
  position: absolute;
  top: 0;
  right: 10px;
  font-size: 2.5rem;
  color: #888;
  cursor: pointer;
  font-weight: bold;
}

/* Riwayat Tautan */
.history-list {
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  background: #f7f7f7;
  padding: 1rem;
  border-radius: 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
}

.history-item .label {
  font-weight: 600;
  color: #333;
}

.history-item a {
  color: #0077cc;
  text-decoration: none;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.history-item a:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 2rem;
  }

  .title {
    font-size: 2.2rem;
  }

  .subtitle {
    font-size: 1.3rem;
  }

  .form input,
  .result input {
    font-size: 0.95rem;
  }

  .button-group {
    flex-direction: column;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .modal-content h2 {
    margin-top: 1.1rem;
  }

  .btn-copy,
  .btn-green,
  .btn-blue,
  .btn-red {
    width: 100%;
  }
}
