/* CSS Variables */
:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-secondary: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-white: #ffffff;
  --color-background: #ffffff;
  --color-border: #e2e8f0;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --radius: 0.5rem;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
}

a {
  cursor: pointer;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.section-header p {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 42rem;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  background: var(--color-secondary);
  transform: translateY(-1px);
}

.btn-ok {
  background: var(--color-success);
  color: var(--color-white);
  border: 1px solid var(--color-border)
}

.btn-error {
  background: var(--color-danger);
  color: var(--color-white);
  border: 1px solid var(--color-border)
}

.btn-full {
  width: 100%;
}

/* Cards */
.card {
  background: var(--color-background);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Icons */
.icon {
  width: 1.5rem;
  height: 1.5rem;
}

.card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
}

.card-icon-blue {
  background: #dbeafe;
  color: var(--color-primary);
}

.card-icon-green {
  background: #d1fae5;
  color: var(--color-success);
}

.card-icon-purple {
  background: #e9d5ff;
  color: #7c3aed;
}

/* Hero Section */
.hero {
  padding: 5rem 0;
  min-height: 100vh;
  /* display: flex; */
  align-items: center;
}

.hero-content {
  text-align: center;
  margin-bottom: 4rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #dbeafe;
  color: var(--color-primary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-text), var(--color-primary), var(--color-text));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 48rem;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 4rem;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.hero-cards .card {
  text-align: center;
  padding: 1.5rem;
}

.hero-cards h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.hero-cards p {
  color: var(--color-text-muted);
}

.hero-code {
  text-align: center;
}

.code-window {
  display: inline-block;
  background: #1e293b;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: left;
}

.code-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.code-dots {
  display: flex;
  gap: 0.5rem;
}

.code-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.code-dot-red {
  background: #ef4444;
}

.code-dot-yellow {
  background: #f59e0b;
}

.code-dot-green {
  background: var(--color-success);
}

.code-content {
  color: #10b981;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.875rem;
}

/* Features Section */
.features {
  padding: 5rem 0;
  background: var(--color-background);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  transition: transform 0.2s ease;
}

.card:hover,
.feature-card:hover {
  transform: translateY(-4px);
}


.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--color-secondary);
  color: var(--color-text);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Demo Section */
#step-container {
  overflow: hidden;
  position: relative;
}
.step {
  display: none;
  height: 100%;
  padding: 20px;
}
.step.active {
  display: block;
}

#pagination-dots {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.dot {
  width: 10px;
  height: 10px;
  margin: 0 5px;
  background-color: #64748b;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.dot.active {
  background-color: #2563eb;
}


.demo {
  padding: 5rem 0;
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.demo-config h3,
.demo-result h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input,
.select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--color-background);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Slider */
.slider-container {
  position: relative;
}

.slider {
  width: 100%;
  height: 0.5rem;
  border-radius: 0.25rem;
  background: var(--color-secondary);
  outline: none;
  appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 2px solid var(--color-background);
  box-shadow: var(--shadow);
}

.slider::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 2px solid var(--color-background);
  box-shadow: var(--shadow);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Captcha Display */
.captcha-display {
  border-radius: var(--radius);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  min-height: 100px;
  min-width: 500px;
}

.captcha-display img {
  border-radius: var(--radius);
}

.captcha-placeholder {
  display: flex;
  align-content: space-around;
  justify-content: center;
  flex-wrap: wrap;
  flex-direction: column;
  text-align: center;
  background: var(--color-background);
  padding: 1rem;
  border-radius: var(--radius);
  border: 2px dashed var(--color-border);
  height: 100px;
  width: 500px;
}

.captcha-text {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-family: 'Monaco', 'Menlo', monospace;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.2em;
}

.captcha-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.badge-secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

/* API Response */
.api-response {
  background: var(--color-secondary);
  border-radius: var(--radius);
  padding: 1rem;
}

.api-response label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.api-response pre {
  font-size: 0.75rem;
  color: var(--color-text);
  white-space: pre-wrap;
  font-family: 'Monaco', 'Menlo', monospace;
}

/* Documentation Section */
.documentation {
  padding: 5rem 0;
  background: var(--color-background);
}

/* Tabs */
.tabs {
  width: 100%;
}

.tab-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 2rem;
  background: var(--color-secondary);
  border-radius: var(--radius);
  padding: 0.25rem;
}

.tab-button {
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-button.active {
  background: var(--color-background);
  color: var(--color-text);
  box-shadow: var(--shadow);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Endpoints */
.endpoint-card {
  background: var(--color-background);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.method {
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.method-post {
  background: var(--color-success);
  color: var(--color-white);
}

.method-get {
  background: var(--color-primary);
  color: var(--color-white);
}

.endpoint-path {
  font-size: 1.125rem;
  font-family: 'Monaco', 'Menlo', monospace;
  color: var(--color-primary);
}

.endpoint-description {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.params-table h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.params-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.params-table th,
.params-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.params-table th {
  font-weight: 500;
  color: var(--color-text);
}

.params-table td {
  color: var(--color-text-muted);
}

.params-table code {
  background: var(--color-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.75rem;
  color: var(--color-primary);
}

.required-yes {
  background: #fee2e2;
  color: var(--color-danger);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.required-no {
  background: var(--color-secondary);
  color: var(--color-text);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Code Examples */
.code-examples-tabs {
  width: 100%;
}

.code-tab-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 1.5rem;
  background: var(--color-secondary);
  border-radius: var(--radius);
  padding: 0.25rem;
}

.code-tab-button {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: capitalize;
}

.code-tab-button.active {
  background: var(--color-background);
  color: var(--color-text);
  box-shadow: var(--shadow);
}

.code-example-card {
  background: var(--color-background);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.code-example-card.hidden {
  display: none;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.code-header h3 {
  font-size: 1.125rem;
}

.copy-btn {
  padding: 0.5rem 1rem;
  background: var(--color-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.code-block {
  background: #1e293b;
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
}

.code-block code {
  color: #10b981;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Footer */
.footer {
  background: #1e293b;
  color: var(--color-white);
  padding: 4rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-section p {
  color: #94a3b8;
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: var(--color-white);
}

.footer-separator {
  height: 1px;
  background: #475569;
  margin: 2rem 0;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  color: #94a3b8;
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--color-white);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .demo-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-cards {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .tab-buttons {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .code-tab-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .params-table {
    overflow-x: auto;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .section-header p {
    font-size: 1rem;
  }
}

/* No Ui Sliders */

/* Nasconde i tooltip di default */
.noUi-tooltip {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Mostra il tooltip quando l'utente interagisce */
.noUi-active .noUi-tooltip,
.noUi-handle:hover .noUi-tooltip,
.noUi-handle:focus .noUi-tooltip {
  opacity: 1;
}

.noUi-connect {
  background: var(--color-primary) !important;
}

.noUi-handle {
  background-color: #fff;
  border: 2px solid #007bff;
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.5);
}


/* Media */

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
    justify-content: center;
  }
}