@import 'ui-design-system/src/styles/semantic';

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

  h2 {
    margin: 0 0 $semantic-spacing-layout-section-lg 0;
    font-family: map-get($semantic-typography-heading-h2, font-family);
    font-size: map-get($semantic-typography-heading-h2, font-size);
    font-weight: map-get($semantic-typography-heading-h2, font-weight);
    line-height: map-get($semantic-typography-heading-h2, line-height);
    color: $semantic-color-text-primary;
  }
}

.demo-section {
  margin-bottom: $semantic-spacing-layout-section-xl;

  h3 {
    margin: 0 0 $semantic-spacing-component-md 0;
    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;
  }

  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;
  }
}

.demo-description {
  margin: 0 0 $semantic-spacing-component-lg 0;
  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;
}

.demo-row {
  display: flex;
  gap: $semantic-spacing-component-lg;
  align-items: flex-start;

  &--vertical {
    flex-direction: column;
  }
}

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

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

  label {
    display: flex;
    align-items: center;
    gap: $semantic-spacing-component-xs;
    cursor: pointer;
    
    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;

    input[type="checkbox"] {
      margin: 0;
    }

    &:hover {
      color: $semantic-color-primary;
    }
  }
}

.demo-event-log {
  background: $semantic-color-surface-primary;
  border: $semantic-border-width-1 solid $semantic-color-border-primary;
  border-radius: $semantic-border-card-radius;
  padding: $semantic-spacing-component-md;
  max-height: 300px;
  overflow-y: auto;
}

.demo-no-events {
  margin: 0;
  padding: $semantic-spacing-component-lg 0;
  text-align: center;
  color: $semantic-color-text-tertiary;
  font-style: italic;
}

.demo-event {
  padding: $semantic-spacing-component-xs 0;
  border-bottom: $semantic-border-width-1 solid $semantic-color-border-subtle;
  
  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-primary;

  &:last-of-type {
    border-bottom: none;
  }

  strong {
    color: $semantic-color-primary;
    font-weight: $semantic-typography-font-weight-semibold;
  }
}

.demo-event-time {
  display: block;
  margin-top: $semantic-spacing-component-xs;
  color: $semantic-color-text-tertiary;
  font-family: map-get($semantic-typography-caption, font-family);
  font-size: map-get($semantic-typography-caption, font-size);
  font-weight: map-get($semantic-typography-caption, font-weight);
  line-height: map-get($semantic-typography-caption, line-height);
}

.demo-clear-events {
  margin-top: $semantic-spacing-component-md;
  padding: $semantic-spacing-component-xs $semantic-spacing-component-sm;
  
  background: $semantic-color-surface-secondary;
  border: $semantic-border-width-1 solid $semantic-color-border-secondary;
  border-radius: $semantic-border-button-radius;
  
  font-family: map-get($semantic-typography-button-small, font-family);
  font-size: map-get($semantic-typography-button-small, font-size);
  font-weight: map-get($semantic-typography-button-small, font-weight);
  line-height: map-get($semantic-typography-button-small, line-height);
  color: $semantic-color-text-secondary;
  
  cursor: pointer;
  transition: all $semantic-motion-duration-fast $semantic-motion-easing-ease;

  &:hover {
    background: $semantic-color-surface-elevated;
    border-color: $semantic-color-border-primary;
    color: $semantic-color-text-primary;
  }

  &:focus {
    outline: 2px solid $semantic-color-focus;
    outline-offset: 2px;
  }
}

// Responsive design
@media (max-width: 768px) {
  .demo-container {
    padding: $semantic-spacing-layout-section-sm;
  }

  .demo-row {
    flex-direction: column;
    gap: $semantic-spacing-component-md;
  }

  .demo-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: $semantic-spacing-component-sm;
  }
}

@media (max-width: 480px) {
  .demo-container {
    padding: $semantic-spacing-component-md;
  }

  .demo-section {
    margin-bottom: $semantic-spacing-layout-section-md;
  }

  .demo-event-log {
    max-height: 200px;
  }
}