html {
  width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  overflow-x: hidden;
  background: #0d0d0f;
  color: white;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0 auto;
  padding: 15px;
  box-sizing: border-box;
}

.container {
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.05);
  padding: 25px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.container h1 {
  text-align: center;
  color: #f7d57a;
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 10px;
}

.container p {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 25px;
}

h2 {
  text-align: center;
  color: #f7d57a;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-left: 4px solid #444;
  padding-left: 10px;
}

textarea {
  background: #000;
  border: 1px solid #333;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  height: 70px;
  resize: none;
  font-size: 16px;
  word-break: break-word;
  overflow-wrap: break-word;
}

#btnGen {
  width: 100%;
  padding: 15px;
  background: #f7d57a;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
}

/* Editor sections */
.editor-section {
  margin-bottom: 20px;
}

.section-label {
  display: block;
  color: #f7d57a;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 1rem;
}

/* Upload foto */
.photo-upload {
  border: 2px dashed rgba(247, 213, 122, 0.3);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s;
}

.photo-upload:hover {
  border-color: rgba(247, 213, 122, 0.6);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #888;
}

.upload-icon {
  font-size: 2rem;
}

.photo-preview {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.photo-preview.visible {
  display: flex;
}

.photo-preview img {
  max-width: 100%;
  max-height: 250px;
  border-radius: 10px;
  object-fit: cover;
}

.btn-change-photo {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-change-photo:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Messaggio speciale textarea */
.editor-section > textarea {
  width: 100%;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  height: 100px;
  resize: none;
  font-size: 16px;
  box-sizing: border-box;
}

/* Collapsible palloncini */
.collapsible-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 16px;
  color: #f7d57a;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.collapsible-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toggle-arrow {
  transition: transform 0.3s;
}

.collapsible-toggle.open .toggle-arrow {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.collapsible-content.open {
  max-height: 1000px;
  margin-top: 15px;
}

#result {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#result.active {
  display: flex;
}

.result-content {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(247, 213, 122, 0.5);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 90%;
  width: 500px;
  box-shadow: 0 0 30px rgba(247, 213, 122, 0.4);
}

.result-content p {
  font-size: 20px;
  margin-bottom: 15px;
  color: #fff;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

#linkOutput {
  color: #f7d57a;
  flex: 1;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(247, 213, 122, 0.3);
  font-size: 0.78rem;
}

#btnCopy {
  flex-shrink: 0;
  padding: 8px 14px;
  background: rgba(247, 213, 122, 0.15);
  border: 1px solid rgba(247, 213, 122, 0.4);
  border-radius: 10px;
  color: #f7d57a;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

#btnCopy:hover {
  background: rgba(247, 213, 122, 0.3);
}

.share-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.share-btn {
  flex: 1;
  padding: 15px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  color: #fff;
  box-sizing: border-box;
  transition: transform 0.2s;
}

.share-btn:hover {
  transform: scale(1.05);
}

#btnWhatsapp {
  background: #25d366;
}

#btnWhatsapp:hover {
  background: #1da851;
}

#btnShare {
  background: #555;
}

#btnShare:hover {
  background: #333;
}

#closeResult {
  margin-top: 20px;
  padding: 12px 25px;
  background: rgba(240, 65, 65, 0.8);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s;
}

#closeResult:hover {
  background: #a81b1b;
  color: #fff;
}

.red {
  border-color: #ff4d4d;
}
.green {
  border-color: #4df14d;
}
.blue {
  border-color: #4d4dff;
}
.yellow {
  border-color: #f7d57a;
}
.purple {
  border-color: #cc4dff;
}
.lightblue {
  border-color: #4ddbff;
}

.box.red label {
  color: #ff4d4d;
}
.box.green label {
  color: #4df14d;
}
.box.blue label {
  color: #4d4dff;
}
.box.yellow label {
  color: #f7d57a;
}
.box.purple label {
  color: #cc4dff;
}
.box.lightblue label {
  color: #4ddbff;
}

.btnClear {
  padding: 8px 12px;
  background: rgba(102, 102, 102, 0.8);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 5px;
  transition: background 0.2s;
}

.btnClear:hover {
  background: rgba(255, 50, 50, 1);
}

.charCounter {
  font-size: 12px;
  color: #888;
  margin-top: 3px;
  text-align: right;
}

#seo-info-editor {
  position: absolute;
  left: -9999px;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: auto(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  margin: 0;
  padding: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 0;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  font-family: 'DM Sans', sans-serif;
}

.nav-home {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.nav-home:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}
.nav-icons {
  display: flex;
  gap: 15px;
}

.nav-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 30px;
}

.nav-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px) scale(1.1);
}

.nav-icon.active {
  background: rgba(44, 133, 254, 0.69);
  border-color: rgba(44, 133, 254, 0.9);
  box-shadow: 0 0 12px rgba(44, 133, 254, 0.35);
}

@media (max-width: 768px) {
  body {
    padding-top: 65px !important;
  }

  .navbar-container {
    padding: 13px 10px;
  }

  .nav-home {
    padding: 8px 18px;
    font-size: 16px;
  }

  .nav-icon {
    width: 30px;
    height: 30px;
    font-size: 25px;
  }

  .nav-icons {
    gap: 8px;
  }
}

.counter-display {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.counter {
  font-weight: 700;
  color: #ffd700;
}

@media (max-width: 768px) {
  .counter-display {
    font-size: 12px;
  }
}

/* Google Funding Choices CMP widget — fixed bottom-right, fuori dal flusso flex */
.ipr-container {
  position: fixed !important;
  bottom: 0 !important;
  right: 0 !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 99999 !important;
}
