/* Demo Modal Styles */

.demo-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 10000;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.demo-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.demo-modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  max-width: 1200px;
  width: 100%;
  height: 95vh;
  max-height: 95vh;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.demo-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  z-index: 10;
}

.demo-close:hover {
  background: var(--accent-primary);
  color: white;
  transform: rotate(90deg);
}

.demo-header {
  padding: 20px 30px 15px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.demo-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.demo-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.demo-container {
  padding: 20px 30px;
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.demo-step {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.6s ease;
  padding: 10px;
  overflow: hidden;
}

.demo-step.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateX(0);
  z-index: 1;
}

.demo-step.prev {
  transform: translateX(-50px);
  opacity: 0;
}

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

.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding-right: 10px;
}

.step-content::-webkit-scrollbar {
  width: 6px;
}

.step-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.step-content::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
}

.step-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.step-number {
  width: 35px;
  height: 35px;
  background: var(--accent-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  margin: 0 20px;
}

.step-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Screen Mockup */
.screen-mockup {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  animation: screenSlideIn 0.5s ease;
}

@keyframes screenSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.screen-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.screen-dots {
  display: flex;
  gap: 6px;
}

.screen-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-color);
}

.screen-dots span:nth-child(1) {
  background: #ff5f57;
}

.screen-dots span:nth-child(2) {
  background: #ffbd2e;
}

.screen-dots span:nth-child(3) {
  background: #28ca42;
}

.screen-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: auto;
  margin-right: auto;
  position: relative;
  left: -40px;
}

.screen-content {
  padding: 1.5rem;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Invoice Visual Container */
.invoice-visual-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

/* Upload Area */
.demo-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: default;
  transition: all var(--transition-base);
  background: var(--bg-primary);
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
  width: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.upload-icon {
  position: relative;
  margin-bottom: 1.5rem;
}

.upload-icon i {
  font-size: 2.5rem;
  color: var(--accent-primary);
  position: relative;
  z-index: 2;
}

.upload-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0.2;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.3;
  }
}

.upload-progress {
  margin-top: 1.5rem;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  animation: progressFill 2s ease forwards;
}

@keyframes progressFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.invoice-preview-animated {
  animation: slideInScale 0.5s ease;
}

.invoice-preview {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.invoice-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(20, 184, 166, 0.1), transparent);
  animation: shimmer 2s ease infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes slideInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.invoice-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.invoice-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.invoice-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.invoice-line {
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px dotted var(--border-color);
}

.file-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: var(--success);
  font-weight: 600;
  font-size: 0.875rem;
}

.file-status i {
  font-size: 1rem;
}

.demo-upload-area.uploading {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.upload-icon {
  font-size: 4rem;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.uploaded-file {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.uploaded-file i.fa-file-pdf {
  font-size: 1.5rem;
  color: var(--error);
}

.uploaded-file span {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.uploaded-file i.fa-check-circle {
  color: var(--success);
  font-size: 1.25rem;
}

/* Extraction Visual */
.extraction-visual {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.ai-extraction-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
  overflow: hidden;
}

.invoice-scan-container {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  overflow: hidden;
  flex-shrink: 0;
  max-height: 280px;
}

.invoice-document {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
}

.doc-header {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.doc-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc-field {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  font-size: 0.9rem;
}

.extraction-highlight {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(20, 184, 166, 0.3), transparent);
  transition: left 0.5s ease;
}

.doc-field.extracting {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
}

.doc-field.extracting .extraction-highlight {
  left: 100%;
  animation: highlightSweep 1s ease;
}

@keyframes highlightSweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.doc-field.extracted {
  background: var(--success);
  color: white;
  animation: extractedPop 0.3s ease;
}

@keyframes extractedPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes highlight {
  0%, 100% {
    background: var(--bg-secondary);
    color: var(--text-primary);
  }
  50% {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.02);
  }
}

.field-label {
  font-weight: 600;
  margin-right: 1rem;
}

.field-value {
  font-weight: 500;
}

.scan-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  box-shadow: 0 0 20px var(--accent-primary), 0 0 40px var(--accent-primary);
  animation: scan 2s linear infinite;
}

.scan-particles {
  position: absolute;
  width: 100%;
  height: 100%;
}

.scan-particles .particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 2s ease infinite;
}

.scan-particles .particle:nth-child(1) {
  left: 20%;
  animation-delay: 0s;
}

.scan-particles .particle:nth-child(2) {
  left: 50%;
  animation-delay: 0.5s;
}

.scan-particles .particle:nth-child(3) {
  left: 80%;
  animation-delay: 1s;
}

@keyframes particleFloat {
  0% {
    top: 0;
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    top: 100%;
    opacity: 0;
    transform: scale(0);
  }
}

@keyframes scan {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(400px);
    opacity: 0.3;
  }
}

.extraction-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px var(--accent-primary);
}

.extraction-progress {
  flex-shrink: 0;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(200px);
  }
}

.extraction-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  max-height: 180px;
  overflow-y: auto;
}

.extraction-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.extraction-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.extraction-item.processing {
  border-color: var(--accent-primary);
  background: rgba(20, 184, 166, 0.05);
  transform: translateX(5px);
}

.extraction-item.processing::before {
  transform: scaleY(1);
}

.extraction-item.completed {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.extraction-item.completed::before {
  background: var(--success);
  transform: scaleY(1);
}

.item-icon {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-secondary);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.extraction-item.processing .item-icon {
  background: var(--accent-primary);
  color: white;
}

.extraction-item.completed .item-icon {
  background: var(--success);
  color: white;
}

.extraction-item i {
  color: var(--accent-primary);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.extraction-item.completed i {
  color: white;
  animation: checkMark 0.3s ease;
}

@keyframes checkMark {
  0% {
    transform: scale(0) rotate(-180deg);
  }
  50% {
    transform: scale(1.2) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.item-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.item-label {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.item-status {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.extraction-item.completed .item-status {
  color: var(--success);
  font-weight: 600;
}

.extracted-data {
  margin-top: 1.5rem;
  animation: fadeIn 0.5s ease;
  flex-shrink: 0;
}

.data-row.highlight {
  animation: dataHighlight 0.6s ease;
  background: rgba(20, 184, 166, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  margin: 0.25rem 0;
}

@keyframes dataHighlight {
  0% {
    background: transparent;
    transform: translateX(-10px);
  }
  50% {
    background: rgba(20, 184, 166, 0.15);
    transform: translateX(5px);
  }
  100% {
    background: rgba(20, 184, 166, 0.05);
    transform: translateX(0);
  }
}

.data-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.data-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.data-row:last-child {
  border-bottom: none;
}

.data-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.data-value {
  color: var(--text-primary);
  font-weight: 500;
}

.data-value.success {
  color: var(--success);
  font-weight: 600;
}

/* Approval Visual */
.approval-visual {
  width: 100%;
  flex-shrink: 0;
}

.approval-dashboard {
  width: 100%;
}

.approval-checks-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  max-height: 280px;
  overflow-y: auto;
}

.approval-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  transition: all var(--transition-base);
  text-align: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.approval-check.processing {
  border-color: var(--accent-primary);
  background: rgba(20, 184, 166, 0.1);
}

.approval-check.completed {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.check-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-secondary);
  transition: all var(--transition-base);
  position: relative;
  flex-shrink: 0;
}

.check-icon i {
  font-size: 1rem;
}

.check-icon::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-base);
}

.approval-check.processing .check-icon {
  background: var(--accent-primary);
  color: white;
  animation: iconSpin 1s linear infinite;
}

.approval-check.processing .check-icon::before {
  opacity: 0.3;
  transform: scale(1.3);
  animation: iconPulseRing 1.5s ease infinite;
}

@keyframes iconPulseRing {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1.3);
  }
  50% {
    opacity: 0;
    transform: scale(1.6);
  }
}

.approval-check.completed .check-icon {
  background: var(--success);
  color: white;
  animation: iconPop 0.4s ease;
}

@keyframes iconPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.approval-check i {
  font-size: 1.5rem;
  transition: all var(--transition-base);
}

.approval-check.completed i {
  animation: checkPop 0.3s ease;
}

@keyframes checkPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.check-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.check-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.check-status {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.approval-check.completed .check-status {
  color: var(--success);
  font-weight: 600;
}

.check-progress {
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.check-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  transition: width 1s ease;
  border-radius: 2px;
}

.approval-check.processing .check-progress-fill {
  width: 100%;
}

.approval-check.completed .check-progress-fill {
  background: var(--success);
  width: 100%;
}

@keyframes checkSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.approval-check i {
  color: var(--success);
  font-size: 1.5rem;
}

.approval-check span {
  color: var(--text-primary);
  font-weight: 500;
}

.approval-result {
  text-align: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  animation: fadeIn 0.5s ease;
}

.approval-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.approval-badge-large {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--success);
  color: white;
  border-radius: var(--radius-lg);
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: var(--shadow-lg);
  animation: badgePop 0.5s ease;
}

@keyframes badgePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.badge-icon {
  font-size: 1.5rem;
  animation: iconSpin 0.5s ease;
}

@keyframes iconSpin {
  from {
    transform: rotate(-180deg);
  }
  to {
    transform: rotate(0);
  }
}

.approval-stamp {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.8;
  transform: rotate(-5deg);
  animation: stamp 0.5s ease;
}

@keyframes stamp {
  0% {
    transform: scale(0) rotate(-5deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(-5deg);
    opacity: 0.8;
  }
}

.approval-message {
  color: var(--text-secondary);
  margin: 0;
}

/* Payment Visual */
.payment-visual {
  width: 100%;
  flex-shrink: 0;
}

.payment-dashboard {
  width: 100%;
  padding: 2rem 0;
}

.payment-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
  flex-wrap: wrap;
}

.payment-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0.75rem;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  transition: all var(--transition-base);
  min-width: 120px;
  position: relative;
  flex: 1;
  max-width: 160px;
}

.payment-step.active {
  border-color: var(--accent-primary);
  background: rgba(20, 184, 166, 0.1);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.payment-step.completed {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.step-icon-wrapper {
  position: relative;
  width: 50px;
  height: 50px;
}

.step-icon {
  width: 50px;
  height: 50px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent-primary);
  transition: all var(--transition-base);
  border: 2px solid var(--border-color);
  position: relative;
  z-index: 2;
}

.step-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  opacity: 0;
  transition: all var(--transition-base);
}

.payment-step.active .step-ring {
  opacity: 0.3;
  animation: ringPulse 1.5s ease infinite;
}

@keyframes ringPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.1;
  }
}

.payment-step.active .step-icon {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  animation: iconPulse 1s ease infinite;
}

.payment-step.completed .step-icon {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.step-line-connector {
  width: 30px;
  height: 3px;
  position: relative;
  display: flex;
  align-items: center;
}

.connector-line {
  width: 100%;
  height: 100%;
  background: var(--border-color);
  position: relative;
  overflow: hidden;
}

.connector-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent-gradient);
  transition: left 1s ease;
}

.payment-step.active ~ .payment-step .connector-line::after,
.payment-step.completed ~ .payment-step .connector-line::after {
  left: 0;
  animation: lineFlow 1.5s ease infinite;
}

@keyframes lineFlow {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.payment-step.active ~ .payment-step .step-line-connector,
.payment-step.completed ~ .payment-step .step-line-connector {
  background: var(--accent-primary);
  animation: lineFlow 1s ease infinite;
}

@keyframes lineFlow {
  0% {
    background: var(--border-color);
  }
  50% {
    background: var(--accent-primary);
  }
  100% {
    background: var(--border-color);
  }
}

.step-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.step-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.step-subtitle {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

@keyframes paymentPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.payment-step i {
  color: var(--accent-primary);
  font-size: 1.5rem;
}

.payment-step span {
  color: var(--text-primary);
  font-weight: 500;
}

.payment-success {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  animation: fadeIn 0.5s ease;
  width: 100%;
  max-width: 100%;
}

.success-animation {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.success-icon-large {
  width: 70px;
  height: 70px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  animation: successPop 0.6s ease;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  animation: particleExplode 1s ease forwards;
}

.particle:nth-child(1) {
  animation-delay: 0.1s;
  animation-duration: 1.2s;
}

.particle:nth-child(2) {
  animation-delay: 0.2s;
  animation-duration: 1.1s;
}

.particle:nth-child(3) {
  animation-delay: 0.15s;
  animation-duration: 1.3s;
}

.particle:nth-child(4) {
  animation-delay: 0.25s;
  animation-duration: 1s;
}

.particle:nth-child(5) {
  animation-delay: 0.3s;
  animation-duration: 1.15s;
}

@keyframes particleExplode {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--tx, 0), var(--ty, 0)) scale(1);
    opacity: 0;
  }
}

.particle:nth-child(1) {
  --tx: 60px;
  --ty: -40px;
}

.particle:nth-child(2) {
  --tx: -50px;
  --ty: 50px;
}

.particle:nth-child(3) {
  --tx: 40px;
  --ty: 60px;
}

.particle:nth-child(4) {
  --tx: -60px;
  --ty: -50px;
}

.particle:nth-child(5) {
  --tx: 0px;
  --ty: -70px;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.payment-success h4 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.payment-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  width: 100%;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.75rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  font-size: 0.8125rem;
  width: 100%;
}

.detail-item.highlight {
  background: rgba(20, 184, 166, 0.05);
  border-color: var(--accent-primary);
  animation: detailHighlight 0.5s ease;
}

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

.detail-item span:first-child {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-item span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

.status-success {
  color: var(--success);
  font-weight: 700;
}

/* Demo Controls */
.demo-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  padding: 15px 30px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
  position: relative;
  min-height: 100px;
}

.demo-nav-arrows {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  pointer-events: none;
  z-index: 2;
}

.nav-arrow {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  pointer-events: all;
  box-shadow: var(--shadow-md);
}

.nav-arrow:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-arrow.prev {
  left: 20px;
}

.nav-arrow.next {
  right: 20px;
}

.demo-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
  z-index: 100;
}

.demo-timeline {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  flex-shrink: 0;
  margin-top: 20px;
}

.timeline-dot.active {
  background: var(--accent-primary);
  transform: scale(1.3);
}

.timeline-dot.completed {
  background: var(--success);
}

.timeline-dot::before {
  content: attr(data-step);
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.timeline-dot:hover::before,
.timeline-dot.active::before {
  opacity: 1;
}

.timeline-dot.active::before {
  color: var(--accent-primary);
  font-weight: 600;
}

.demo-control-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 10px;
  z-index: 1;
  position: relative;
}

.demo-footer {
  padding: 15px 40px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.demo-footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.demo-footer i {
  color: var(--info);
}

@media (max-width: 768px) {
  .demo-modal-content {
    max-width: 100%;
    margin: 10px;
    height: 98vh;
    max-height: 98vh;
  }

  .demo-header {
    padding: 15px 20px 10px;
  }
  
  .demo-header h2 {
    font-size: 1.25rem;
  }
  
  .demo-header p {
    font-size: 0.8rem;
  }

  .demo-container {
    padding: 15px 20px;
  }
  
  .step-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .screen-content {
    padding: 1rem;
  }
  
  .payment-flow {
    flex-direction: column;
    gap: 1rem;
  }
  
  .payment-step {
    max-width: 100%;
    width: 100%;
  }
  
  .approval-checks-container {
    grid-template-columns: 1fr;
  }

  .step-indicator {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.75rem;
  }

  .step-line {
    width: 2px;
    height: 30px;
    margin: 10px 0 10px 24px;
  }

  .demo-controls {
    flex-direction: column;
    padding: 10px 20px;
    min-height: 80px;
  }

  .demo-controls button {
    width: 100%;
  }
}

