/* Product.css — Refined Green Theme with Loading Spinner & Layout Styles */

/* Base reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f0f2f5;
  color: #333;
}

/* Container card */
.container {
  max-width: 480px;
  margin: 80px auto 40px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(76, 175, 80, 0.2);
  animation: glowingContainer 3s infinite ease-in-out;
  overflow: hidden;
  padding: 32px;
}

@keyframes glowingContainer {
  0% { box-shadow: 0 0 10px rgba(76, 175, 80, 0.4); }
  50% { box-shadow: 0 0 25px rgba(129, 199, 132, 0.4); }
  100% { box-shadow: 0 0 10px rgba(76, 175, 80, 0.4); }
}

/* Title */
h3 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  color: #2c3e50;
  margin-bottom: 24px;
}

/* Link input */
.link-section {
  margin-bottom: 24px;
}

.link-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #444;
}

.link-section input[type="url"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.link-section input[type="url"]:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* Checkbox grid */
.checkbox-container {
  margin-bottom: 24px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fafbfc;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2196F3;
}

/* Submit button */
button[type="submit"] {
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  background-color: #4caf50;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
}

button[type="submit"]:hover {
  background-color: #43a047;
}

button[type="submit"]:active {
  transform: scale(0.98);
}

/* Loading spinner styles */
@keyframes spinner {
  to { transform: rotate(360deg); }
}

button[type="submit"].loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}

button[type="submit"].loading::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  margin-top: -0.5em;
  margin-left: -0.5em;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinner .6s linear infinite;
}

/* Status message */
.copy-status {
  margin-top: 12px;
  text-align: center;
  color: #4caf50;
  font-weight: 600;
}

/* Manual title input */
.name-section {
  display: none;
  margin-top: 16px;
}

.name-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #444;
}

.name-section input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 420px) {
  .container {
    margin: 40px 16px;
    padding: 24px;
  }
  h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }
  .checkbox-container {
    grid-template-columns: 1fr;
  }
}
