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

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

.demo-description {
  font-family: map-get($semantic-typography-body-large, font-family);
  font-size: map-get($semantic-typography-body-large, font-size);
  font-weight: map-get($semantic-typography-body-large, font-weight);
  line-height: map-get($semantic-typography-body-large, line-height);
  color: $semantic-color-text-secondary;
  margin-bottom: $semantic-spacing-layout-section-md;
}

.demo-section {
  margin-bottom: $semantic-spacing-layout-section-xl;
  
  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-content-heading;
  }
}

.demo-example {
  margin-bottom: $semantic-spacing-layout-section-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: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: $semantic-spacing-grid-gap-lg;
}

.demo-grid-item {
  padding: $semantic-spacing-component-md;
  border-radius: $semantic-border-card-radius;
  border: $semantic-border-width-1 solid $semantic-color-border-subtle;
  
  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);
  
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 80px;
  position: relative;
  
  small {
    position: absolute;
    bottom: $semantic-spacing-component-xs;
    right: $semantic-spacing-component-xs;
    font-size: $semantic-typography-font-size-xs;
    opacity: $semantic-opacity-subtle;
  }
  
  &--primary {
    background: $semantic-color-primary;
    color: $semantic-color-on-primary;
    border-color: $semantic-color-primary;
  }
  
  &--secondary {
    background: $semantic-color-secondary;
    color: $semantic-color-on-secondary;
    border-color: $semantic-color-secondary;
  }
  
  &--success {
    background: $semantic-color-success;
    color: $semantic-color-on-success;
    border-color: $semantic-color-success;
  }
  
  &--info {
    background: $semantic-color-info;
    color: $semantic-color-on-info;
    border-color: $semantic-color-info;
  }
  
  &--warning {
    background: $semantic-color-warning;
    color: $semantic-color-on-warning;
    border-color: $semantic-color-warning;
  }
  
  &--danger {
    background: $semantic-color-danger;
    color: $semantic-color-on-danger;
    border-color: $semantic-color-danger;
  }
}

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: $semantic-spacing-component-lg;
  margin-bottom: $semantic-spacing-layout-section-md;
  padding: $semantic-spacing-component-lg;
  background: $semantic-color-surface-elevated;
  border-radius: $semantic-border-card-radius;
  border: $semantic-border-width-1 solid $semantic-color-border-subtle;
}

.demo-control-group {
  display: flex;
  flex-direction: column;
  gap: $semantic-spacing-component-xs;
  
  label {
    font-family: map-get($semantic-typography-label, font-family);
    font-size: map-get($semantic-typography-label, font-size);
    font-weight: map-get($semantic-typography-label, font-weight);
    line-height: map-get($semantic-typography-label, line-height);
    color: $semantic-color-text-primary;
  }
  
  select,
  input[type="checkbox"] {
    padding: $semantic-spacing-interactive-input-padding-y $semantic-spacing-interactive-input-padding-x;
    border: $semantic-border-width-1 solid $semantic-color-border-primary;
    border-radius: $semantic-border-input-radius;
    background: $semantic-color-surface-primary;
    color: $semantic-color-text-primary;
    
    font-family: map-get($semantic-typography-input, font-family);
    font-size: map-get($semantic-typography-input, font-size);
    font-weight: map-get($semantic-typography-input, font-weight);
    line-height: map-get($semantic-typography-input, line-height);
    
    &:focus {
      outline: 2px solid $semantic-color-focus;
      outline-offset: 2px;
      border-color: $semantic-color-border-focus;
    }
  }
  
  input[type="checkbox"] {
    width: auto;
    height: $semantic-sizing-touch-minimum;
    cursor: pointer;
  }
}

// Responsive adjustments
@media (max-width: 768px) {
  .demo-container {
    padding: $semantic-spacing-layout-section-md;
  }
  
  .demo-row {
    grid-template-columns: 1fr;
  }
  
  .demo-controls {
    flex-direction: column;
  }
  
  .demo-grid-item {
    min-height: 60px;
    padding: $semantic-spacing-component-sm;
  }
}