body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f0f0f, #00ff9d);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 40px;
  border-radius: 24px;
  max-width: 720px;
  width: 100%;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

h1 {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 10px;
}

.subtitle {
  text-align: center;
  font-size: 16px;
  color: #ccc;
  margin-bottom: 30px;
}

textarea {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  resize: vertical;
  margin-bottom: 20px;
  box-sizing: border-box;
}

button {
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#generateBtn {
  width: 100%;
  padding: 16px;
  background-color: #00ff9d;
  color: #000;
  margin-bottom: 24px;
}

#generateBtn:hover {
  background-color: #00e68b;
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mode-switch button {
  background: none;
  border: 2px solid #00ff9d;
  color: #00ff9d;
  padding: 12px 24px;
  border-radius: 30px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.mode-switch button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #00ff9d;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 30px;
  z-index: -1;
}

.mode-switch .active {
  background-color: #00ff9d;
  color: #000;
}

.mode-switch .active::before {
  opacity: 1;
}

#outputBox {
  background-color: rgba(255, 255, 255, 0.06);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  box-sizing: border-box;
  margin-top: 28px; /* <--- Aggiunto margine sopra */
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

#copyBtn {
  font-size: 14px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
}

#output {
  white-space: pre-wrap;
  line-height: 1.6;
  color: #f1f1f1;
  word-break: break-word; 
}

#output code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

.visible {
  display: block;
  opacity: 1;
  animation: fadeIn 0.3s ease-in-out;
}

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

.loader {
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid #00ff9d;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.upload-wrapper {
  margin-bottom: 24px;
  text-align: center;
}

.upload-label {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.upload-label:hover {
  background: rgba(255, 255, 255, 0.2);
}

#excelUpload {
  display: none;
}

.mode-description {
  margin: 8px 0 24px;
  text-align: center;
  font-size: 15px;
  color: #e0e0e0;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 24px;
  }

  h1 {
    font-size: 26px;
  }

  .subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }

  textarea {
    font-size: 14px;
    padding: 12px;
  }

  button, #generateBtn {
    font-size: 14px;
    padding: 14px;
  }

  .mode-switch button {
    padding: 10px 16px;
    font-size: 14px;
  }

  #outputBox {
    padding: 16px;
  }
}

.upload-description {
  font-size: 14px;
  color: #cccccc;
  margin-bottom: 12px;
  text-align: center;
  line-height: 1.5;
}

.file-info {
  font-size: 13px;
  color: #00ff9d;
  margin-top: 8px;
  text-align: center;
}

.excel-preview {
  margin-top: 16px;
  overflow-x: auto;
}

.excel-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 0 auto;
  background-color: rgba(255,255,255,0.05);
  color: #eee;
}

.excel-preview th, .excel-preview td {
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 10px;
  text-align: left;
}

.excel-preview th {
  background-color: rgba(255,255,255,0.1);
  font-weight: bold;
}

.disabled-upload {
  opacity: 0.6;
  cursor: not-allowed;
  border: 2px dashed #ccc;
  background-color: #f9f9f9;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  text-align: center;
  position: relative;
  max-width: 550px;
  margin: 0 auto;
}

.disabled-upload .upload-label.disabled {
  pointer-events: none;
  color: #aaa;
}

.disabled-upload::after {
  content: "🚧 Coming Soon!";
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: #FFD000; /* Giallo pieno */
  color: #000;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 1;
}

.feedback-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px;
  border-radius: 16px;
  margin: 40px auto 80px auto;
  max-width: 600px;
  color: white;
  text-align: left;
}

.feedback-section h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.feedback-section textarea,
.feedback-section select {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  box-sizing: border-box;
}

.feedback-section button {
  background-color: #ffc107;
  border: none;
  color: black;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.feedback-section button:hover {
  background-color: #e0a800;
}

#feedback-status {
  font-size: 14px;
  color: lightgreen;
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-content {
  background-color: white;
  color: #1a1a1a;
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  position: relative; /* necessario per posizionare la X */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
}

.popup-close:hover {
  color: #333;
}

.input-popup {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.4rem;
  font-size: 14px;
}

.submit-popup-btn {
  background-color: #16a34a;
  color: white;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: bold;
}

.hidden {
  display: none;
}
