@use 'ui-design-system/src/styles/semantic/index' as *;

.demo-container {
  padding: $semantic-spacing-component-lg;
  max-width: 1200px;
  margin: 0 auto;
}

.demo-section {
  margin-bottom: $semantic-spacing-layout-section-lg;
  
  h3 {
    font-family: map-get($semantic-typography-heading-h3, font-family);
    font-size: map-get($semantic-typography-heading-h3, font-size);
    font-weight: map-get($semantic-typography-heading-h3, font-weight);
    line-height: map-get($semantic-typography-heading-h3, line-height);
    color: $semantic-color-text-primary;
    margin-bottom: $semantic-spacing-component-md;
  }
  
  h4 {
    font-family: map-get($semantic-typography-heading-h4, font-family);
    font-size: map-get($semantic-typography-heading-h4, font-size);
    font-weight: map-get($semantic-typography-heading-h4, font-weight);
    line-height: map-get($semantic-typography-heading-h4, line-height);
    color: $semantic-color-text-primary;
    margin-bottom: $semantic-spacing-component-sm;
  }
}

.demo-row {
  display: flex;
  gap: $semantic-spacing-component-lg;
  flex-wrap: wrap;
}

.demo-item {
  flex: 1;
  min-width: 200px;
}

.demo-content {
  p {
    font-family: map-get($semantic-typography-body-medium, font-family);
    font-size: map-get($semantic-typography-body-medium, font-size);
    font-weight: map-get($semantic-typography-body-medium, font-weight);
    line-height: map-get($semantic-typography-body-medium, line-height);
    color: $semantic-color-text-primary;
    margin-bottom: $semantic-spacing-content-paragraph;
    padding: $semantic-spacing-component-sm;
    border-bottom: $semantic-border-width-1 solid $semantic-color-border-subtle;
    
    &:last-child {
      border-bottom: none;
    }
  }
}

.demo-horizontal-content {
  display: flex;
  gap: $semantic-spacing-component-md;
  padding: $semantic-spacing-component-md;
}

.demo-horizontal-item {
  min-width: 150px;
  padding: $semantic-spacing-component-md;
  background: $semantic-color-surface-secondary;
  border-radius: $semantic-border-radius-md;
  border: $semantic-border-width-1 solid $semantic-color-border-subtle;
  white-space: nowrap;
  
  font-family: map-get($semantic-typography-body-medium, font-family);
  font-size: map-get($semantic-typography-body-medium, font-size);
  font-weight: map-get($semantic-typography-body-medium, font-weight);
  line-height: map-get($semantic-typography-body-medium, line-height);
  color: $semantic-color-text-primary;
}

.demo-large-content {
  width: 800px;
  height: 600px;
  padding: $semantic-spacing-component-md;
}

.demo-table {
  width: 100%;
  border-collapse: collapse;
  
  td {
    padding: $semantic-spacing-component-sm;
    border: $semantic-border-width-1 solid $semantic-color-border-primary;
    white-space: nowrap;
    
    font-family: map-get($semantic-typography-body-medium, font-family);
    font-size: map-get($semantic-typography-body-medium, font-size);
    font-weight: map-get($semantic-typography-body-medium, font-weight);
    line-height: map-get($semantic-typography-body-medium, line-height);
    color: $semantic-color-text-primary;
  }
}

.demo-controls {
  display: flex;
  gap: $semantic-spacing-component-md;
  margin-bottom: $semantic-spacing-component-lg;
  flex-wrap: wrap;
  
  button {
    padding: $semantic-spacing-interactive-button-padding-y $semantic-spacing-interactive-button-padding-x;
    background: $semantic-color-primary;
    color: $semantic-color-on-primary;
    border: none;
    border-radius: $semantic-border-button-radius;
    cursor: pointer;
    
    font-family: map-get($semantic-typography-button-medium, font-family);
    font-size: map-get($semantic-typography-button-medium, font-size);
    font-weight: map-get($semantic-typography-button-medium, font-weight);
    line-height: map-get($semantic-typography-button-medium, line-height);
    
    transition: background-color $semantic-motion-duration-fast $semantic-motion-easing-ease;
    
    &:hover {
      background: $semantic-color-interactive-primary;
    }
    
    &:focus-visible {
      outline: 2px solid $semantic-color-focus;
      outline-offset: 2px;
    }
  }
}

.demo-info,
.demo-stats {
  margin-top: $semantic-spacing-component-md;
  padding: $semantic-spacing-component-sm;
  background: $semantic-color-surface-secondary;
  border-radius: $semantic-border-radius-sm;
  border: $semantic-border-width-1 solid $semantic-color-border-subtle;
  
  p {
    margin: 0;
    margin-bottom: $semantic-spacing-component-xs;
    
    font-family: map-get($semantic-typography-body-small, font-family);
    font-size: map-get($semantic-typography-body-small, font-size);
    font-weight: map-get($semantic-typography-body-small, font-weight);
    line-height: map-get($semantic-typography-body-small, line-height);
    color: $semantic-color-text-secondary;
    
    &:last-child {
      margin-bottom: 0;
    }
  }
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: $semantic-spacing-grid-gap-md;
  padding: $semantic-spacing-component-md;
  width: 1000px;
}

.demo-grid-item {
  padding: $semantic-spacing-component-md;
  background: $semantic-color-surface-secondary;
  border: $semantic-border-width-1 solid $semantic-color-border-subtle;
  border-radius: $semantic-border-radius-md;
  
  h4 {
    margin: 0 0 $semantic-spacing-component-sm 0;
    
    font-family: map-get($semantic-typography-heading-h4, font-family);
    font-size: map-get($semantic-typography-heading-h4, font-size);
    font-weight: map-get($semantic-typography-heading-h4, font-weight);
    line-height: map-get($semantic-typography-heading-h4, line-height);
    color: $semantic-color-text-primary;
  }
  
  p {
    margin: 0;
    
    font-family: map-get($semantic-typography-body-small, font-family);
    font-size: map-get($semantic-typography-body-small, font-size);
    font-weight: map-get($semantic-typography-body-small, font-weight);
    line-height: map-get($semantic-typography-body-small, line-height);
    color: $semantic-color-text-secondary;
  }
}

.virtual-item {
  padding: $semantic-spacing-component-md;
  border-bottom: $semantic-border-width-1 solid $semantic-color-border-subtle;
  display: flex;
  align-items: center;
  
  strong {
    color: $semantic-color-text-primary;
    font-weight: $semantic-typography-font-weight-semibold;
    margin-right: $semantic-spacing-component-sm;
  }
  
  font-family: map-get($semantic-typography-body-medium, font-family);
  font-size: map-get($semantic-typography-body-medium, font-size);
  font-weight: map-get($semantic-typography-body-medium, font-weight);
  line-height: map-get($semantic-typography-body-medium, line-height);
  color: $semantic-color-text-secondary;
}

// Responsive Design
@media (max-width: $semantic-breakpoint-lg - 1) {
  .demo-container {
    padding: $semantic-spacing-component-md;
  }
  
  .demo-row {
    flex-direction: column;
    gap: $semantic-spacing-component-md;
  }
  
  .demo-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: $semantic-breakpoint-md - 1) {
  .demo-container {
    padding: $semantic-spacing-component-sm;
  }
  
  .demo-section {
    margin-bottom: $semantic-spacing-layout-section-md;
  }
  
  .demo-large-content {
    width: 400px;
    height: 300px;
  }
  
  .demo-grid {
    width: 600px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: $semantic-spacing-grid-gap-sm;
  }
}