/* Lead Funnel Generator - Frontend Styles */

.lfg-funnel-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Progress Bar */
.lfg-progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 30px;
  overflow: hidden;
}

.lfg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Steps */
.lfg-step {
  background: #ffffff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  transition: opacity 0.3s ease;
}

.lfg-step-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 25px;
  text-align: center;
}

.lfg-step-description {
  text-align: center;
  color: #666;
  margin-bottom: 25px;
  font-size: 16px;
  line-height: 1.5;
}

/* Form Fields */
.lfg-field-group {
  margin-bottom: 20px;
}

.lfg-field-label {
  display: block;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  font-size: 16px;
}

.lfg-field-label .required {
  color: #e74c3c;
  margin-left: 3px;
}

.lfg-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.lfg-input:focus {
  outline: none;
  border-color: var(--lfg-primary-color, #667eea);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.lfg-input.lfg-field-invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Options Grid Layouts */
.lfg-options-grid {
  display: grid;
  gap: 15px;
  margin-top: 10px;
}

/* List Layout (Standard) */
.lfg-options-grid.lfg-layout-list {
  grid-template-columns: 1fr;
}

/* Tiles Layout */
.lfg-options-grid.lfg-layout-tiles {
  grid-template-columns: repeat(var(--lfg-tiles-per-row, 2), 1fr);
}

/* Cards Layout */
.lfg-options-grid.lfg-layout-cards {
  grid-template-columns: repeat(var(--lfg-tiles-per-row, 2), 1fr);
}

.lfg-options-grid.lfg-layout-cards .lfg-radio-label,
.lfg-options-grid.lfg-layout-cards .lfg-checkbox-label {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Radio Buttons - Kachel-Design */
.lfg-radio-label {
  display: block;
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lfg-radio-label:hover {
  border-color: var(--lfg-primary-color, #667eea);
  background-color: rgba(102, 126, 234, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lfg-radio-label.lfg-selected {
  border-color: var(--lfg-primary-color, #667eea);
  background: linear-gradient(135deg, var(--lfg-primary-color, #667eea), var(--lfg-secondary-color, #764ba2));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.lfg-radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.lfg-radio-label span {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: inherit;
}

.lfg-radio-label.lfg-selected span {
  color: white;
}

/* Checkboxes - Kachel-Design */
.lfg-checkbox-label {
  display: block;
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lfg-checkbox-label:hover {
  border-color: var(--lfg-primary-color, #667eea);
  background-color: rgba(102, 126, 234, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lfg-checkbox-label.lfg-selected {
  border-color: var(--lfg-primary-color, #667eea);
  background: linear-gradient(135deg, var(--lfg-primary-color, #667eea), var(--lfg-secondary-color, #764ba2));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.lfg-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.lfg-checkbox-label span {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: inherit;
  position: relative;
  padding-left: 30px;
}

.lfg-checkbox-label span:before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: transparent;
  transition: all 0.3s ease;
}

.lfg-checkbox-label.lfg-selected span:before {
  background: white;
  border-color: white;
}

.lfg-checkbox-label.lfg-selected span:after {
  content: "✓";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lfg-primary-color, #667eea);
  font-weight: bold;
  font-size: 14px;
}

/* Hover Effects - Can be disabled */
.lfg-funnel-container.lfg-hover-effects-disabled .lfg-radio-label:hover,
.lfg-funnel-container.lfg-hover-effects-disabled .lfg-checkbox-label:hover,
.lfg-funnel-container.lfg-hover-effects-disabled .lfg-btn:hover {
  transform: none;
  box-shadow: none;
}

/* Selection Animation - Can be disabled */
.lfg-funnel-container.lfg-selection-animation-disabled .lfg-radio-label,
.lfg-funnel-container.lfg-selection-animation-disabled .lfg-checkbox-label {
  transition: none;
}

/* Buttons */
.lfg-step-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  gap: 15px;
}

.lfg-btn {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lfg-btn-primary {
  background: linear-gradient(135deg, var(--lfg-primary-color, #667eea), var(--lfg-secondary-color, #764ba2));
  color: var(--lfg-button-text-color, white);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.lfg-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.lfg-btn-secondary {
  background: #f8f9fa;
  color: #555;
  border: 2px solid #e0e0e0;
}

.lfg-btn-secondary:hover {
  background: #e9ecef;
  border-color: #ced4da;
  transform: translateY(-2px);
}

/* Error Messages */
.lfg-field-error {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 8px;
  display: block;
  padding: 8px 12px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 6px;
  border-left: 4px solid #e74c3c;
}

/* Success Step */
.lfg-success-step {
  text-align: center;
}

.lfg-success-content h3 {
  color: #27ae60;
  font-size: 28px;
  margin-bottom: 15px;
}

.lfg-success-content p {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
}

/* Step Success Notification */
.lfg-step-success-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 20px 30px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  z-index: 10001;
  box-shadow: 0 8px 30px rgba(40, 167, 69, 0.4);
  animation: lfg-step-success-fade-in 0.3s ease;
  text-align: center;
  min-width: 300px;
}

@keyframes lfg-step-success-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Loading */
.lfg-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lfg-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #e0e0e0;
  border-top: 6px solid var(--lfg-primary-color, #667eea);
  border-radius: 50%;
  animation: lfg-spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.lfg-loading p {
  font-size: 18px;
  color: #555;
  font-weight: 500;
}

/* Enhanced Loading Animation */
.lfg-loading.lfg-enhanced-loading {
  background: linear-gradient(135deg, #667eea10, #764ba210);
  backdrop-filter: blur(5px);
}

.lfg-loading.lfg-enhanced-loading .lfg-spinner {
  width: 80px;
  height: 80px;
  border-width: 8px;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.lfg-loading.lfg-enhanced-loading p {
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--lfg-primary-color, #667eea), var(--lfg-secondary-color, #764ba2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Auto-Save Indicator */
.lfg-autosave-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
  animation: lfg-slide-in 0.3s ease;
}

@keyframes lfg-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Range Slider */
.lfg-range-container {
  margin: 15px 0;
}

.lfg-range {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
  margin-bottom: 15px;
}

.lfg-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lfg-primary-color, #667eea);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lfg-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lfg-primary-color, #667eea);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lfg-range-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #666;
  background: #f8f9fa;
  padding: 10px 15px;
  border-radius: 8px;
}

.lfg-range-value {
  font-weight: 700;
  color: var(--lfg-primary-color, #667eea);
  font-size: 18px;
}

/* Textarea */
.lfg-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.lfg-textarea:focus {
  outline: none;
  border-color: var(--lfg-primary-color, #667eea);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.lfg-textarea.lfg-field-invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* CSS Variables für dynamische Farben */
:root {
  --lfg-primary-color: #667eea;
  --lfg-secondary-color: #764ba2;
  --lfg-button-text-color: #ffffff;
  --lfg-progress-bar-color: #667eea;
  --lfg-tiles-per-row: 2;
}

/* Responsive Design */
@media (max-width: 768px) {
  .lfg-funnel-container {
    padding: 15px;
  }

  .lfg-step {
    padding: 20px;
  }

  .lfg-step-title {
    font-size: 20px;
  }

  .lfg-step-navigation {
    flex-direction: column-reverse;
  }

  .lfg-btn {
    width: 100%;
  }

  .lfg-autosave-indicator {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }

  .lfg-radio-label,
  .lfg-checkbox-label {
    padding: 12px 16px;
  }

  /* Mobile: Always single column for options */
  .lfg-options-grid.lfg-layout-tiles,
  .lfg-options-grid.lfg-layout-cards {
    grid-template-columns: 1fr !important;
  }

  .lfg-step-success-notification {
    min-width: 280px;
    padding: 15px 20px;
    font-size: 16px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .lfg-step {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .lfg-step-title {
    color: #e2e8f0;
  }

  .lfg-field-label {
    color: #cbd5e0;
  }

  .lfg-input,
  .lfg-textarea {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
  }

  .lfg-radio-label,
  .lfg-checkbox-label {
    background: #4a5568;
    border-color: #718096;
    color: #cbd5e0;
  }

  .lfg-radio-label:hover,
  .lfg-checkbox-label:hover {
    background-color: #2d3748;
  }
}

/* Auto-Advance Animation */
.lfg-auto-advance-active .lfg-radio-label,
.lfg-auto-advance-active .lfg-checkbox-label {
  animation: lfg-pulse 0.6s ease;
}

@keyframes lfg-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Progress Bar mit dynamischer Farbe */
.lfg-progress-fill {
  background: var(--lfg-progress-bar-color, var(--lfg-primary-color)) !important;
}
