/* =============================================================================
   QR CODE GENERATOR ITALIA - STILI UNIFICATI 
   Dominio: qrcodegeneratoritalia.it
   Tutti i CSS unificati in un unico file per migliori prestazioni
   ========================================================================== */

/* BASE STYLES */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  background-color: #eef1f5; /* Lighter background */
  color: #333;
  box-sizing: border-box;
}

/* Body state classes for analytics and consent management */
/* body.analytics-enabled and body.preferences-enabled classes 
   are used in HTML but don't require specific styling at the moment */

h1 {
  color: #2c3e50;
  margin-bottom: 25px;
  font-size: 2em;
  text-align: center; /* Center title */
}

.container {
  margin: 0 auto;
  padding: 40px 20px;
  line-height: 1.7;
  color: #333;
}

.home-header {
  text-align: center;
  margin-bottom: 30px; /* Adjusted margin */
  padding: 25px; /* Adjusted padding */
  background: linear-gradient(
    135deg,
    #667eea 0%,
    #764ba2 100%
  ); /* Match legal-header */
  color: white; /* Match legal-header */
  border-radius: 15px; /* Match legal-header */
  width: 100%; /* Ensure header takes full width of its container if needed */
  box-sizing: border-box; /* Include padding in width calculation */
}

.home-header p {
  color: white;
}

.home-header h1 {
  margin: 0 0 10px 0;
  font-size: 2.5rem;
  font-weight: 700;
  color: white; /* Match legal-header h1 */
}
.home-content {
  background: #f8fafc;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Tab Styles */
.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #dee2e6;
}

.tab-button {
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  background-color: transparent;
  font-size: 1em;
  color: #495057;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px; /* Align with container's border */
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-button.active {
  color: #007bff;
  border-bottom-color: #007bff;
  font-weight: 600;
}

.tab-button:hover:not(.active) {
  color: #0056b3;
}

.tab-content {
  display: none;
  width: 100%; /* Ensure tab content takes full width */
}

.tab-content.active {
  display: block;
}

.hidden {
  display: none !important; /* Hide elements with this class */
}

.generate-button-simple {
  width: 100%;
  padding: 12px 20px;
  background-color: #007bff; /* Same as original main button, or a different color */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
  margin-top: 15px; /* Space above the button */
}

.generate-button-simple:hover {
  background-color: #0056b3;
}

.controls {
  width: 100%;
  margin-bottom: 25px;
}

.input-group {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
}

#qrDataInput {
  flex-grow: 1;
  padding: 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px 0 0 4px; /* Rounded left corners */
  font-size: 1em;
  outline: none;
}
#qrDataInput:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Generate button moved to common-options */
/* #generateQrButton { ... } */

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  width: 100%;
}

.option-item {
  display: flex;
  flex-direction: column; /* Stack label and input vertically */
  align-items: flex-start; /* Align items to the start */
  /* margin-bottom: 10px; /* Add some space between option items */
}

.option-item label {
  margin-bottom: 5px; /* Space between label and input */
  font-weight: 500;
  color: #555;
  font-size: 0.9em;
}

.option-item input[type="number"],
.option-item input[type="color"],
.option-item input[type="text"], /* For contact fields */
.option-item input[type="email"], /* For contact fields */
.option-item input[type="tel"] /* For contact fields */ {
  padding: 10px; /* Slightly more padding */
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  width: 100%; /* Make inputs take full width of their grid cell */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}
.option-item input[type="number"]:focus,
.option-item input[type="text"]:focus,
.option-item input[type="email"]:focus,
.option-item input[type="tel"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
  outline: none;
}

.option-item input[type="color"] {
  height: 40px; /* Consistent height for color picker */
  padding: 2px; /* Small padding for color picker */
}

/* Common Options and Main Generate Button (now inside Contact Tab) */
.common-options {
  width: 100%;
  margin-top: 25px; /* Space above common options within contact tab */
  padding-top: 20px;
  border-top: 1px solid #e0e0e0; /* Separator */
}

.generate-button-main {
  width: 100%;
  padding: 12px 20px;
  background-color: #28a745; /* Green color for main action */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: 600;
  transition: background-color 0.3s ease;
  margin-top: 20px; /* Space above the button */
}

.generate-button-main:hover {
  background-color: #218838;
}

/* Custom Contact Fields */
#customContactFieldsContainer {
  margin-top: 15px;
  margin-bottom: 15px;
}

.custom-field-item {
  display: grid; /* Use grid for better alignment */
  grid-template-columns: 1fr 1fr auto; /* Label, Value, Remove Button */
  gap: 10px;
  align-items: center; /* Vertically align items in the grid row */
  margin-bottom: 10px;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.custom-field-item input[type="text"] {
  width: 100%; /* Inputs take full width of their grid cell */
  padding: 8px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 0.9em;
}

.secondary-button,
.remove-custom-field {
  padding: 8px 12px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.secondary-button:hover,
.remove-custom-field:hover {
  background-color: #5a6268;
}
#addCustomFieldButton {
  display: block;
  margin: 20px auto 0; /* Increased top margin */
  background-color: #007bff; /* Primary color for add */
}
#addCustomFieldButton:hover {
  background-color: #0056b3;
}

.remove-custom-field {
  background-color: #dc3545; /* Red for remove */
}
.remove-custom-field:hover {
  background-color: #c82333;
}

#canvas {
  border: 1px solid #e0e0e0;
  margin-top: 10px; /* Reduced margin-top */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  max-width: 100%; /* Ensure canvas is responsive */
  height: auto; /* Maintain aspect ratio */
  display: none; /* Hide canvas by default */
  margin-left: auto; /* Center canvas if its container is wider */
  margin-right: auto; /* Center canvas if its container is wider */
}

/* QR Placeholder Styles */
.qr-placeholder {
  display: block;
  text-align: center;
  padding: 60px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 15px;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.qr-placeholder:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

.placeholder-content {
  max-width: 300px;
  margin: 0 auto;
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.7;
}

.qr-placeholder h3 {
  color: #495057;
  margin: 0 0 10px 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.qr-placeholder p {
  color: #6c757d;
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.qr-display-section {
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* History Section Styles */
.history-section {
  width: 100%;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.history-section h2 {
  text-align: center;
  color: #333;
  margin-bottom: 15px;
  font-size: 1.5em;
}

#historyItemsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
  max-height: 300px; /* Limit height and make it scrollable if needed */
  overflow-y: auto; /* Add scroll if content overflows */
  padding: 5px;
}

.history-item {
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden; /* Ensure content fits */
}

.history-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.history-item img {
  max-width: 80px; /* Adjust size as needed */
  height: auto;
  margin-bottom: 8px;
  border-radius: 4px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.history-item span {
  font-size: 0.8em;
  color: #555;
  display: block; /* Make span take full width */
  word-wrap: break-word; /* Break long words */
}

.no-history {
  text-align: center;
  color: #777;
  padding: 20px;
  grid-column: 1 / -1; /* Span across all columns if grid is active */
}

#historyContainer h3 {
  margin-top: 0;
  color: #333;
}

#historyList {
  list-style-type: none;
  padding: 0;
  max-height: 400px; /* Or any desired height */
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#historyList li {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease-in-out;
}

#historyList li:last-child {
  border-bottom: none;
}

#historyList li:hover {
  background-color: #f9f9f9;
}

.history-date-header {
  font-weight: bold;
  margin-top: 10px;
  padding: 8px 10px;
  background-color: #e9ecef; /* Light grey background for date headers */
  color: #495057;
  border-bottom: 1px solid #ddd;
  border-top: 1px solid #ddd; /* Optional: add top border too */
  list-style-type: none; /* Ensure no bullet points */
}

.history-date-header:first-child {
  margin-top: 0;
  border-top: none;
}

.history-item-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column; /* Stack text and time vertically if preferred */
  /* or align items if kept in one line: */
  /* align-items: center; */
}

.history-item-content span:first-child {
  /* The QR text */
  font-weight: 500;
  color: #333;
  word-break: break-all; /* Prevent long text from breaking layout */
}

.history-item-time {
  font-size: 0.85em;
  color: #555;
  margin-left: 5px; /* If on the same line as text */
  /* margin-top: 2px; */ /* If below the text */
}

.history-item-image {
  width: 40px;
  height: 40px;
  margin-left: 10px;
  margin-right: 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  vertical-align: middle;
}

.history-item-delete {
  background-color: #ff4d4d;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.history-item-delete:hover {
  background-color: #cc0000;
}

#clearHistoryBtn {
  background-color: #6c757d;
}

.footer {
  width: 100%; /* Make footer take full width of its container */
  box-sizing: border-box; /* Include padding in width calculation */
  margin-top: 30px; /* Increased margin-top */
  padding: 20px;
  background-color: #333; /* Dark background for footer */
  color: white; /* Light text for footer */
  text-align: center;
  font-size: 0.9em;
  border-radius: 15px; /* Rounded bottom corners if container is its direct parent */
}

.footer .footer-links a {
  color: #aadeff; /* Light blue for links in footer */
  text-decoration: none;
  margin: 0 10px; /* Space out links */
}

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

.footer p {
  margin-bottom: 10px; /* Space between copyright and links */
  color: white; /* Ensure paragraph text is also white */
}

.tutorial-box {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  position: absolute; /* For positioning as a bubble */
  max-width: 350px;
  min-width: 280px;
  transition: top 0.3s ease-in-out, left 0.3s ease-in-out,
    transform 0.3s ease-in-out;
}

.tutorial-box h3 {
  margin-top: 0;
  color: #333;
  font-size: 1.4em;
  margin-bottom: 15px;
}

.tutorial-box p {
  color: #555;
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 20px;
}

.navigationigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.tutorial-button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

#tutorialNextBtn {
  background-color: #007bff;
  color: white;
}
#tutorialNextBtn:hover {
  background-color: #0056b3;
}
#tutorialNextBtn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#tutorialBackBtn {
  background-color: #6c757d;
  color: white;
}
#tutorialBackBtn:hover {
  background-color: #5a6268;
}
#tutorialBackBtn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#tutorialCloseBtn {
  background-color: transparent;
  color: #007bff;
  border: 1px solid #007bff;
}
#tutorialCloseBtn:hover {
  background-color: #e7f3ff;
}

.tutorial-highlight {
  outline: 3px solid #0d6efd; /* Bootstrap primary blue */
  box-shadow: 0 0 15px rgba(13, 110, 253, 0.6);
  border-radius: 5px; /* Ensure visibility on elements with no natural border-radius */
  position: relative; /* For z-index stacking context if needed */
  z-index: 9999; /* Below overlay backdrop but above other page content */
  transition: outline 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.cta-button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 50px;
  border: 2px solid;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  font-size: 1rem;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* CTA Button Variants */
.cta-button.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

.cta-button.primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.cta-button.secondary {
  background: transparent;
  color: #667eea;
  border-color: #667eea;
}

.cta-button.secondary:hover {
  background: #667eea;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cta-button.large {
  padding: 15px 32px;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Responsive design per la sezione educativa */
@media (max-width: 768px) {
  .container {
    padding: 0;
  }
  .educational-content {
    margin: 40px 0;
    padding: 30px 0;
  }

  .educational-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .education-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }

  .education-card {
    padding: 20px;
  }

  .stats-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .cta-section {
    margin: 30px 15px 0;
    padding: 30px 20px;
  }

  .cta-section h3 {
    font-size: 1.5rem;
  }

  .cta-buttons {
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .educational-content h2 {
    font-size: 1.8rem;
  }

  .education-card h3 {
    font-size: 1.2rem;
  }

  .qr-types {
    gap: 15px;
  }

  .qr-type-item {
    padding: 15px;
  }

  .stat-item {
    padding: 15px;
  }

  .stat-number {
    font-size: 1.8rem;
  }
}

/* Main Header Styles */
.main-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 0;
  margin-bottom: 20px;
  border-radius: 15px;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.header-brand h1 {
  color: white;
  margin: 0 0 5px 0;
  font-size: 2.2rem;
  font-weight: 700;
}

.header-brand p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 1.1rem;
}

.main-nav {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 25px;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.nav-link.primary {
  background: #ff6b6b;
  border-color: #ff6b6b;
}

.nav-link.primary:hover {
  background: #ff5252;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Hero Section */
.hero-section {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 40px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-content {
  flex: 2;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 20px 0;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #6c757d;
  margin: 0 0 30px 0;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  flex-direction: row;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-demo {
  text-align: center;
}

.demo-qr {
  width: 120px;
  height: 120px;
  background: #000;
  border-radius: 10px;
  margin: 0 auto 15px auto;
  position: relative;
  overflow: hidden;
}

.demo-qr::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 10%;
  right: 10%;
  bottom: 10%;
  background-image: repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 4px,
      #000 4px,
      #000 8px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 4px,
      #000 4px,
      #000 8px
    );
  background-color: #fff;
}

/* Stats Section */
.trends-section,
.content-section,
.stats-section,
.final-cta {
  margin: 40px 0;
  padding: 30px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  text-align: center;
}

.stat-item {
  padding: 20px;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Main Content Sections */
.main-content {
  margin: 40px 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #2c3e50;
  text-align: center;
  margin: 0 0 20px 0;
}

.section-intro {
  text-align: center;
  font-size: 1.1rem;
  color: #6c757d;
  margin: 0 0 40px 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.content-grid {
  display: grid;
  gap: 30px;
  margin-bottom: 40px;
}

/* Content Cards */
.content-card {
  background: white;
  border-top: 4px solid #667eea;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.content-card:hover {
  transform: translateY(-5px);
}

.content-card.featured {
  border-top-color: #ff6b6b;
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 5%, white 15%);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.2);
}

.content-card.featured:hover {
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.3);
}

.content-card.security .card-header {
  background: rgba(255, 107, 107, 0.02);
}

.card-header {
  padding: 20px 20px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  cursor: pointer;
  padding: 20px;
  background: rgba(102, 126, 234, 0.02);
  border-bottom: 1px solid #eee;
  transition: background-color 0.3s ease;
}

.content-card.security .card-header {
  background: rgba(255, 107, 107, 0.02);
}

.card-header:hover {
  background: rgba(102, 126, 234, 0.05);
}

.card-header h3 {
  color: #2c3e50;
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  flex: 1;
}

.card-header::after {
  content: "▼";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.content-card.collapsed .card-header::after {
  transform: translateY(-50%) rotate(-90deg);
}

.reading-time {
  color: #6c757d;
  font-size: 0.85rem;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 12px;
  white-space: nowrap;
  margin-right: 40px;
}

.card-content {
  max-height: 2000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 20px;
}

.content-card.collapsed .card-content {
  max-height: 0;
  opacity: 0;
  padding: 0 20px;
}

.card-content p {
  margin: 0 0 15px 0;
  line-height: 1.6;
}

/* Highlight and Feature Boxes */
.highlight-box {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #667eea;
  margin: 15px 0;
}

.tech-highlight {
  background: linear-gradient(135deg, #f0f7ff 0%, #dbeafe 100%);
  border: 2px solid #60a5fa;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15);
}

.tech-highlight::before {
  content: "💡";
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.5rem;
}

.tech-highlight h4 {
  color: #1d4ed8;
  margin: 0 0 12px 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.tech-highlight p {
  color: #1e3a8a;
  margin: 0;
  line-height: 1.6;
}

.tech-highlight strong {
  color: #1d4ed8;
}

.key-features ul,
.tech-process ol {
  margin: 15px 0;
  padding-left: 20px;
}

.key-features li,
.tech-process li {
  margin: 8px 0;
}

/* Timeline Styles */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #667eea;
}

.timeline-item {
  position: relative;
  margin-bottom: 25px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #667eea;
}

.year {
  font-weight: 700;
  color: #667eea;
  font-size: 0.9rem;
}

.timeline-content {
  margin-top: 5px;
}

/* Use Cases Grid */
.use-cases {
  display: grid;
  gap: 20px;
  margin: 20px 0;
}

.use-case {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

.use-case h4 {
  color: #2c3e50;
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.benefits {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.benefit {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* QR Types Grid */
.qr-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.qr-type {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.qr-type:hover {
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.type-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.qr-type h4 {
  color: #2c3e50;
  margin: 10px 0;
  font-size: 1rem;
}

.difficulty {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 10px;
}

.difficulty.easy {
  background: #e8f5e8;
  color: #2e7d32;
}

.difficulty.medium {
  background: #fff3e0;
  color: #f57c00;
}

.difficulty.hard {
  background: #ffebee;
  color: #d32f2f;
}

/* Security Section */
.security-risks {
  display: grid;
  gap: 15px;
  margin: 15px 0;
}

.risk-item {
  background: #ffebee;
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #f44336;
}

.risk-type {
  font-weight: 600;
  color: #d32f2f;
  display: block;
  margin-bottom: 5px;
}

/* Best Practices Section - Blue Theme */
.best-practices {
  background: #e3f2fd;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #2196f3;
  margin: 20px 0;
}

.best-practices h4 {
  color: #1565c0;
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.best-practices ul,
.best-practices .security-tips {
  list-style: none;
  padding: 0;
  margin: 0;
}

.best-practices li {
  padding: 12px 0;
  border-bottom: 1px solid #bbdefb;
  color: #0d47a1;
}

.best-practices li:last-child {
  border-bottom: none;
}

.best-practices strong {
  color: #1565c0;
  font-weight: 600;
}

/* Creation Tips Section - Green Theme */
.creation-tips {
  background: #e8f5e8;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #4caf50;
  margin: 20px 0;
}

.creation-tips h4 {
  color: #2e7d32;
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.creation-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.creation-tips li {
  padding: 12px 0;
  border-bottom: 1px solid #c8e6c9;
  color: #1b5e20;
}

.creation-tips li:last-child {
  border-bottom: none;
}

.creation-tips strong {
  color: #2e7d32;
  font-weight: 600;
}

.security-tips,
.creation-tips ul {
  list-style: none;
  padding: 0;
}

.security-tips li,
.creation-tips li {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

.security-tips li:last-child,
.creation-tips li:last-child {
  border-bottom: none;
}

/* Trends Section */
.trends-section {
  margin: 60px 0;
  border-radius: 20px;
}

.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.trend-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.trend-card:hover {
  transform: translateY(-5px);
}

.trend-card h3 {
  color: #2c3e50;
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

/* CTA Section and Buttons */
.cta-section {
  text-align: center;
  padding: 50px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  color: white;
  margin: 40px 0;
}

.cta-section h2 {
  color: white;
  margin: 0 0 20px 0;
  font-size: 2rem;
}

.cta-section p {
  margin: 0 0 30px 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer Styles - unificate per tutte le pagine */

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  padding: 40px 30px;
}

.footer-section h3 {
  color: white;
  margin: 0 0 15px 0;
  font-size: 1.1rem;
}

.footer-section p {
  margin: 0 0 10px 0;
  opacity: 0.8;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin: 8px 0;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: white;
}

.footer-links {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 15px;
  flex-direction: column;
}

.footer-links a {
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.9rem;
}

.footer-bottom {
  border-radius: 10px;
  padding: 20px 30px;
  text-align: center;
  background: rgba(0, 0, 0, 0.1);
}

.footer-bottom p {
  margin: 5px 0;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .header-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .main-nav,
  .generator-header .header-nav {
    justify-content: center;
  }

  .navigation .nav-content {
    flex-direction: column;
    align-items: center;
  }

  .header h1,
  .legal-header h1 {
    font-size: 2rem;
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .trends-grid {
    grid-template-columns: 1fr;
  }
}

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

  .qr-types-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

/* =============================================================================
   ADSENSE INTEGRATION STYLES - GDPR COMPLIANT
   ========================================================================== */

/* AdSense Container Styles */
.ad-container {
  margin: 20px 0;
  text-align: center;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #f9f9f9;
  padding: 15px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
}

.ad-container.ad-header {
  margin: 20px 0 30px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.ad-container.ad-content {
  margin: 30px 0;
  max-width: 728px;
  margin-left: auto;
  margin-right: auto;
}

.ad-container.ad-footer {
  margin: 30px 0 20px 0;
}

.ad-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  background: #f0f0f0;
  color: #999;
  border: 2px dashed #ddd;
  border-radius: 4px;
  font-style: italic;
}

/* AdSense specific styling */
.adsbygoogle {
  display: block !important;
  width: 100%;
  height: auto;
  background: transparent;
}

/* Responsive ad sizing */
@media (max-width: 768px) {
  .ad-container.ad-content {
    max-width: 320px;
  }

  .ad-container {
    margin: 15px 0;
    padding: 10px;
  }
}

@media (min-width: 1200px) {
  .ad-container.ad-content {
    max-width: 970px;
  }
}

/* Hide ads when consent not given */
.ads-blocked .ad-container {
  display: none !important;
}

/* Show placeholder when ads are blocked */
.ads-blocked .ad-container::before {
  content: "Pubblicità bloccata - Gestisci le preferenze cookie per visualizzare gli annunci";
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* Ad container states */
.ad-container.error {
  background: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.ad-container.error::before {
  content: "⚠️ Errore nel caricamento dell'annuncio";
  font-size: 14px;
}

/* Enhanced ad container styles */
.ad-container.fallback-shown {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
}

.ad-container.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #dee2e6;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Accessibility improvements */
.ad-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  font-weight: 500;
}

.ad-container[aria-hidden="true"] {
  display: none;
}

.ad-container:focus-within {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Print media - hide ads */
@media print {
  .ad-container {
    display: none !important;
  }
}

/* Ad Fallback Styles */
.ad-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  margin: 10px 0;
  padding: 20px;
  text-align: center;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.fallback-message {
  color: #6c757d;
}

.fallback-message p {
  margin: 0 0 5px 0;
  font-size: 1rem;
  font-weight: 500;
}

.fallback-message small {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .ad-fallback {
    min-height: 80px;
    padding: 15px;
  }

  .fallback-message p {
    font-size: 0.9rem;
  }
}

/* =============================================================================
   COOKIE CONSENT STYLES - GDPR COMPLIANT
   ========================================================================== */

/* Enhanced Cookie Consent Banner Styles for AdSense Compliance */
#cookieConsentBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 20px;
  z-index: 10000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  border-top: 3px solid #3498db;
  display: none; /* Hidden by default */
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

#cookieConsentBanner .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#cookieConsentBanner h3 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ecf0f1;
}

#cookieConsentBanner p {
  margin: 0 0 15px 0;
  color: #bdc3c7;
  line-height: 1.5;
}

#cookieConsentBanner p a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

#cookieConsentBanner p a:hover {
  text-decoration: underline;
  color: #2980b9;
}

#cookieConsentBanner .cookie-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

#cookieConsentBanner button {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  min-width: 140px;
}

/* Accept All Button - Green */
#acceptAllCookies {
  background-color: #27ae60;
  color: white;
}

#acceptAllCookies:hover {
  background-color: #2ecc71;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Accept Necessary Only - Blue */
#acceptNecessaryCookies {
  background-color: #3498db;
  color: white;
}

#acceptNecessaryCookies:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Manage Preferences - Gray */
#manageCookiePreferences {
  background-color: #95a5a6;
  color: white;
}

#manageCookiePreferences:hover {
  background-color: #7f8c8d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* Decline Cookies Button - Red */
#cookieConsentBanner #declineCookies,
#cookieConsentBanner #manageCookies {
  background-color: #2ecc71; /* Green */
  color: white;
}

#cookieConsentBanner #acceptCookies:hover {
  background-color: #27ae60; /* Darker Green */
  transform: translateY(-1px);
}

#cookieConsentBanner #declineCookies,
#cookieConsentBanner #manageCookies {
  /* Optional button */
  background-color: #e74c3c; /* Red */
  color: white;
}

#cookieConsentBanner #declineCookies:hover,
#cookieConsentBanner #manageCookies:hover {
  background-color: #c0392b; /* Darker Red */
  transform: translateY(-1px);
}

/* Cookie Preferences Modal Styles */
#cookiePreferencesModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10001; /* Above cookie banner */
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  /* Ensures modal is always on top */
  pointer-events: none;
}

/* When modal is shown, enable pointer events */
#cookiePreferencesModal[aria-hidden="false"],
#cookiePreferencesModal[style*="display: flex"],
#cookiePreferencesModal[style*="display:flex"] {
  pointer-events: auto;
}

/* Show modal when aria-hidden is false */
#cookiePreferencesModal[aria-hidden="false"] {
  display: flex !important;
}

/* Hide modal when aria-hidden is true */
#cookiePreferencesModal[aria-hidden="true"] {
  display: none !important;
}

/* Also handle explicit style display */
#cookiePreferencesModal[style*="display: flex"],
#cookiePreferencesModal[style*="display:flex"] {
  display: flex !important;
}

.preferences-modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
}

.preferences-modal-content h2 {
  margin: 0 0 25px 0;
  color: #2c3e50;
  font-size: 1.5rem;
  text-align: center;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 15px;
}

.preference-group {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #ecf0f1;
  border-radius: 8px;
  background: #fafafa;
  transition: border-color 0.3s ease;
}

.preference-group:hover {
  border-color: #3498db;
  background: #f8fbff;
}

.preference-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  gap: 12px;
}

.preference-label input[type="checkbox"] {
  margin: 0;
  transform: scale(1.2);
  accent-color: #3498db;
  margin-top: 2px;
  flex-shrink: 0;
}

.preference-label input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.preference-details {
  flex: 1;
  min-width: 0;
}

.preference-title {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
  font-size: 1rem;
}

.preference-description {
  display: block;
  color: #7f8c8d;
  font-size: 0.9rem;
  line-height: 1.4;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ecf0f1;
}

.cookie-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  min-width: 120px;
}

.cookie-btn.accept {
  background-color: #27ae60;
  color: white;
}

.cookie-btn.accept:hover {
  background-color: #2ecc71;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.cookie-btn.cancel {
  background-color: #e74c3c;
  color: white;
}

.cookie-btn.cancel:hover {
  background-color: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.cookie-btn.necessary {
  background-color: #3498db;
  color: white;
}

.cookie-btn.necessary:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.cookie-btn.manage {
  background-color: #95a5a6;
  color: white;
}

.cookie-btn.manage:hover {
  background-color: #7f8c8d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* Responsive adjustments */
@media (min-width: 768px) {
  #cookieConsentBanner .container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  #cookieConsentBanner p {
    margin: 0;
    flex-grow: 1;
    padding-right: 20px; /* Space between text and buttons */
  }

  #cookieConsentBanner .cookie-buttons {
    margin-top: 0;
    flex-shrink: 0; /* Prevent buttons from shrinking */
  }
}

/* Responsive Modal Adjustments */
@media (max-width: 768px) {
  #cookiePreferencesModal {
    padding: 10px;
  }

  .preferences-modal-content {
    padding: 20px;
    margin: 10px;
  }

  .preferences-modal-content h2 {
    font-size: 1.3rem;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .preference-label {
    flex-direction: column;
    gap: 8px;
  }

  .preference-label input[type="checkbox"] {
    align-self: flex-start;
  }
}

/* =============================================================================
   PRIVACY POLICY STYLES
   ========================================================================== */

.privacy-content {
  background: #f8fafc;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.privacy-section {
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e2e8f0;
}
.privacy-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.privacy-section h2 {
  color: #2d3748;
  font-size: 1.5rem;
  margin: 0 0 20px 0;
  font-weight: 600;
  padding-left: 15px;
  border-left: 4px solid #667eea;
}
.privacy-section h3 {
  color: #4a5568;
  font-size: 1.2rem;
  margin: 20px 0 15px 0;
  font-weight: 600;
}
.privacy-section p,
.privacy-section ul,
.privacy-section ol {
  margin: 15px 0;
  text-align: justify;
}
.privacy-section ul,
.privacy-section ol {
  padding-left: 25px;
}
.privacy-section li {
  margin: 8px 0;
}
.contact-info {
  background: #e6fffa;
  border: 1px solid #81e6d9;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}
.contact-info strong {
  color: #234e52;
}
.back-home {
  text-align: center;
  margin-top: 40px;
}
.back-home a {
  display: inline-block;
  padding: 15px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.back-home a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
@media (max-width: 768px) {
  .legal-container {
    padding: 20px 15px;
  }
  .privacy-content {
    padding: 25px 20px;
  }
  .privacy-section h2 {
    font-size: 1.3rem;
  }
}

/* =============================================================================
   TERMS AND CONDITIONS STYLES
   ========================================================================== */

/* Stili specifici per terms - altri stili in style.css */

.terms-content {
  background: #f8fafc;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.terms-section {
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e2e8f0;
}

.terms-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.terms-section h2 {
  color: #2d3748;
  font-size: 1.5rem;
  margin: 0 0 20px 0;
  font-weight: 600;
  padding-left: 15px;
  border-left: 4px solid #667eea;
}

.terms-section h3 {
  color: #4a5568;
  font-size: 1.2rem;
  margin: 20px 0 15px 0;
  font-weight: 600;
}

.terms-section p {
  margin: 15px 0;
  text-align: justify;
}

.terms-section ul,
.terms-section ol {
  margin: 15px 0;
  padding-left: 25px;
}

.terms-section li {
  margin: 8px 0;
}

.highlight-box {
  background: #edf2f7;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #f59e0b;
}

/* =============================================================================
   TUTORIAL STYLES
   ========================================================================== */

/* Step-by-step tutorial styles */

.step {
  display: flex;
  align-items: flex-start;
  gap: 25px;
  margin-bottom: 35px;
  padding: 30px;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(66, 153, 225, 0.2);
  border-color: #4299e1;
}

.step:last-child {
  margin-bottom: 0;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
  position: relative;
  transition: all 0.3s ease;
}

.step:hover .step-number {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(66, 153, 225, 0.5);
}

.step-number::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  z-index: -1;
  opacity: 0.2;
  transition: opacity 0.3s ease;
}

.step:hover .step-number::after {
  opacity: 0.4;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-weight: 800;
  color: #2d3748;
  margin-bottom: 15px;
  font-size: 1.3rem;
  line-height: 1.3;
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.step p {
  color: #4a5568;
  line-height: 1.7;
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.step p:last-child {
  margin-bottom: 0;
}

/* Example boxes with enhanced design */
.example-box {
  background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
  border: 2px solid #4fd1c7;
  border-radius: 16px;
  padding: 30px;
  margin: 30px 0;
  position: relative;
  box-shadow: 0 4px 20px rgba(79, 209, 199, 0.15);
  transition: all 0.3s ease;
}

.example-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79, 209, 199, 0.25);
}

.example-box h4 {
  margin: 0 0 18px 0;
  color: #0d9488;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}

.example-box p {
  color: #134e4a;
  line-height: 1.7;
  font-size: 1.05rem;
}

.example-box ul {
  margin: 15px 0;
  padding-left: 25px;
}

.example-box li {
  color: #134e4a;
  margin-bottom: 8px;
  line-height: 1.6;
}

.example-box code {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #f0fdfa;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.2);
}

.example-box strong {
  color: #0d9488;
  font-weight: 700;
}

/* Enhanced Quick Tips */
.quick-tip {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-left: 6px solid #f59e0b;
  padding: 25px;
  margin: 30px 0;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
  transition: all 0.3s ease;
}

.quick-tip:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.25);
}

.quick-tip strong {
  color: #92400e;
  font-weight: 800;
  font-size: 1.1rem;
}

.quick-tip p {
  color: #451a03;
  line-height: 1.7;
  margin: 8px 0 0 0;
  font-size: 1.05rem;
}

.code-sample {
  background: #2d3748;
  color: #e2e8f0;
  padding: 15px;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  margin: 15px 0;
  overflow-x: auto;
}

/* Enhanced Pros and Cons */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 30px 0;
}

.pros,
.cons {
  padding: 30px;
  border-radius: 16px;
  position: relative;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.pros:hover,
.cons:hover {
  transform: translateY(-4px);
}

.pros {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #22c55e;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15);
}

.pros:hover {
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.25);
}

.cons {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-color: #ef4444;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.cons:hover {
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.25);
}

.pros h4,
.cons h4 {
  margin: 0 0 18px 0;
  font-size: 1.3rem;
  font-weight: 800;
}

.pros h4 {
  color: #15803d;
}

.cons h4 {
  color: #dc2626;
}

.pros ul,
.cons ul {
  margin: 0;
  padding-left: 25px;
}

.pros li,
.cons li {
  margin-bottom: 10px;
  line-height: 1.6;
  font-size: 1.05rem;
}

.pros li {
  color: #166534;
}

.cons li {
  color: #991b1b;
}

/* Enhanced comparison table */
.table-responsive {
  overflow-x: auto;
  margin: 30px 0;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid #e2e8f0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: none;
}

.comparison-table th {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  padding: 20px 18px;
  text-align: left;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: none;
  position: relative;
}

.comparison-table th::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.1)
  );
}

.comparison-table td {
  padding: 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.comparison-table tr:hover td {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  transform: scale(1.01);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:nth-child(even) {
  background: #fafbfc;
}

.comparison-table tr:nth-child(even):hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.comparison-table td:first-child {
  font-weight: 700;
  color: #1a202c;
  border-left: 4px solid #4299e1;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.comparison-table tr:hover td:first-child {
  border-left-color: #3182ce;
  background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
}

/* Code samples and additional elements */
.code-sample {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: #e2e8f0;
  padding: 20px;
  border-radius: 12px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Courier New", monospace;
  font-size: 0.95rem;
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid #4a5568;
  box-shadow: 0 4px 20px rgba(45, 55, 72, 0.3);
}

/* Navigation buttons */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 50px;
  padding: 30px 0;
  border-top: 2px solid #e2e8f0;
  gap: 20px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 30px;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
  border: none;
  cursor: pointer;
}

.nav-button:hover {
  background: linear-gradient(135deg, #3182ce 0%, #2b77cb 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
}

.nav-button.secondary {
  background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
  box-shadow: 0 4px 15px rgba(113, 128, 150, 0.3);
}

.nav-button.secondary:hover {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  box-shadow: 0 8px 25px rgba(113, 128, 150, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
  .step-by-step {
    padding: 25px 20px;
    margin: 20px 0;
  }

  .step {
    flex-direction: column;
    gap: 20px;
    padding: 25px 20px;
  }

  .step-number {
    align-self: flex-start;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .step-title {
    font-size: 1.2rem;
  }

  .pros-cons {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .navigation-buttons {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }

  .nav-button {
    text-align: center;
    justify-content: center;
  }

  .example-box,
  .quick-tip {
    padding: 20px;
    margin: 20px 0;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 12px 8px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .step {
    padding: 20px 15px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .step-title {
    font-size: 1.1rem;
  }
}

/* =============================================================================
   EXAMPLES STYLES
   ========================================================================== */

.examples-content {
  background: #f8fafc;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.case-study {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  margin-bottom: 40px;
  overflow: hidden;
}

.case-study:last-child {
  margin-bottom: 0;
}

.case-header {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  padding: 25px;
  position: relative;
}

.case-header::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}

.case-title {
  margin: 0 0 10px 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.case-subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
}

.case-content {
  padding: 30px;
}

.case-section {
  margin-bottom: 25px;
}

.case-section:last-child {
  margin-bottom: 0;
}

.case-section h3 {
  color: #2d3748;
  font-size: 1.2rem;
  margin: 0 0 15px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.metric-card {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #4299e1;
  margin-bottom: 5px;
}

.metric-label {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
}

.strategy-list {
  background: #edf2f7;
  border-radius: 8px;
  padding: 20px;
  margin: 15px 0;
}

.strategy-list ul {
  margin: 0;
  padding-left: 20px;
}

.strategy-list li {
  margin-bottom: 10px;
  color: #4a5568;
}

.results-box {
  background: #e6fffa;
  border: 1px solid #81e6d9;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.results-box h4 {
  margin: 0 0 15px 0;
  color: #234e52;
  font-size: 1.1rem;
}

.challenge-box {
  background: #fed7d7;
  border: 1px solid #fc8181;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.challenge-box h4 {
  margin: 0 0 15px 0;
  color: #742a2a;
  font-size: 1.1rem;
}

.implementation-steps {
  background: #fffaf0;
  border-left: 4px solid #f6ad55;
  border-radius: 0 8px 8px 0;
  padding: 20px;
  margin: 20px 0;
}

.implementation-steps h4 {
  margin: 0 0 15px 0;
  color: #c05621;
  font-size: 1.1rem;
}

.implementation-steps ol {
  margin: 0;
  padding-left: 20px;
}

.implementation-steps li {
  margin-bottom: 10px;
  color: #744210;
}

.industry-tag {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 10px;
  margin-bottom: 10px;
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
}

.difficulty-easy {
  background: #c6f6d5;
  color: #22543d;
}

.difficulty-medium {
  background: #feebc8;
  color: #c05621;
}

.difficulty-hard {
  background: #fed7d7;
  color: #742a2a;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
  padding: 20px;
  background: #f0f7ff;
  border-radius: 8px;
  border: 1px solid #bee3f8;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-description {
  font-size: 0.85rem;
  margin-top: 5px;
}

.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

.inspiration-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.inspiration-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.inspiration-title {
  color: #2d3748;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.inspiration-description {
  color: #64748b;
  margin-bottom: 15px;
  line-height: 1.6;
}

.inspiration-tips {
  background: #f7fafc;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.inspiration-tips h5 {
  margin: 0 0 10px 0;
  color: #4a5568;
  font-size: 0.9rem;
  font-weight: 600;
}

.inspiration-tips ul {
  margin: 0;
  padding-left: 15px;
  font-size: 0.85rem;
  color: #64748b;
}

.cta-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  margin-top: 40px;
}

.cta-section h2 {
  margin: 0 0 15px 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.cta-section p {
  margin: 0 0 25px 0;
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .examples-container {
    padding: 20px 15px;
  }

  .examples-content {
    padding: 25px 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .case-content {
    padding: 20px;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-stats {
    grid-template-columns: 1fr 1fr;
  }

  .inspiration-grid {
    grid-template-columns: 1fr;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}

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

/* Generator Header Styles - uniforma con main-header */
.generator-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 0;
  margin-bottom: 20px;
  border-radius: 15px;
}

.generator-header .header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.generator-header .header-left h1 {
  color: white;
  margin: 0 0 5px 0;
  font-size: 2.2rem;
  font-weight: 700;
}

.generator-header .header-left p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 1.1rem;
}

.generator-header .header-nav {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.generator-header .nav-link {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 25px;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 1px solid transparent;
}

.generator-header .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.generator-header .nav-link.primary {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Tutorial Header Styles - uniforma navigazione */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 20px;
  margin-bottom: 20px;
  border-radius: 15px;
  text-align: center;
}

.header h1 {
  color: white;
  margin: 0 0 10px 0;
  font-size: 2.5rem;
  font-weight: 700;
}

.header p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 1.2rem;
}

.navigation {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 15px 0;
  margin-bottom: 20px;
  border-radius: 10px;
}

.navigation .nav-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 20px;
}

.navigation .nav-link {
  color: white;
  width: 90%;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 500;
}

.navigation .nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.navigation .nav-link.current {
  background: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.navigation .nav-link.current:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* Breadcrumb Navigation */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto 20px auto;
  padding: 0 20px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 10px 0;
  font-size: 0.9rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  margin: 0 8px;
  color: #64748b;
  font-weight: 500;
}

.breadcrumb-item a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: #4f46e5;
  text-decoration: underline;
}

.breadcrumb-item:last-child a,
.breadcrumb-item:last-child span {
  color: #64748b;
  font-weight: 500;
}

/* Legal Header Styles - uniforma con il resto */
.legal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 20px;
  margin-bottom: 20px;
  border-radius: 15px;
  text-align: center;
}

.legal-header h1 {
  color: white;
  margin: 0 0 10px 0;
  font-size: 2.5rem;
  font-weight: 700;
}

.legal-header p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 1.1rem;
}

.legal-header .last-updated {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Responsive adjustments for all headers */
@media (max-width: 768px) {
  .main-header .header-content,
  .generator-header .header-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .main-nav,
  .generator-header .header-nav {
    justify-content: center;
  }

  .navigation .nav-content {
    flex-direction: column;
    align-items: center;
  }

  .header h1,
  .legal-header h1 {
    font-size: 2rem;
  }
}
