@use 'ui-design-system/src/styles/semantic/index' as *;
.ui-ghost-button {
  // Reset and base styles
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: $semantic-border-width-1 solid transparent;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  position: relative;
  overflow: hidden;
  border-radius: $semantic-border-radius-lg;
  
  // Typography
  font-family: $semantic-typography-font-family-sans;
  font-weight: $semantic-typography-font-weight-medium;
  text-align: center;
  text-transform: none;
  letter-spacing: $semantic-typography-letter-spacing-wide;
  white-space: nowrap;
  color: $semantic-color-text-secondary;
  
  // Interaction states
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  
  // Transitions
  transition: all $semantic-motion-duration-fast $semantic-motion-easing-ease-out;
  
  // Size variants
  &--small {
    height: $semantic-spacing-9; // 2.25rem
    padding: 0 $semantic-spacing-2; // 0.5rem
    font-size: $semantic-typography-font-size-sm;
    line-height: $semantic-typography-line-height-normal;
    min-width: $semantic-spacing-16; // 4rem
  }
  
  &--medium {
    height: $semantic-spacing-11; // 2.75rem
    padding: 0 $semantic-spacing-4; // 1rem
    font-size: $semantic-typography-font-size-md;
    line-height: $semantic-typography-line-height-normal;
    min-width: $semantic-spacing-20; // 5rem
  }
  
  &--large {
    height: $semantic-spacing-12; // 3rem (closest to 3.25rem)
    padding: 0 $semantic-spacing-6; // 1.5rem
    font-size: $semantic-typography-font-size-lg;
    line-height: $semantic-typography-line-height-normal;
    min-width: $semantic-spacing-24; // 6rem
  }
  
  // Hover states
  &:hover:not(:disabled) {
    background-color: $semantic-color-surface-container;
    color: $semantic-color-text-primary;
    border-color: $semantic-color-border-secondary;
    transform: $semantic-motion-hover-transform-lift-sm;
    box-shadow: $semantic-shadow-button-hover;
  }
  
  &:active:not(:disabled) {
    background-color: $semantic-color-surface-high;
    transform: scale(0.98);
    box-shadow: $semantic-shadow-none;
  }
  
  &:focus-visible {
    background-color: $semantic-color-surface-container;
    border-color: $semantic-color-border-focus;
    box-shadow: $semantic-shadow-button-focus;
  }
  
  // States
  &--disabled {
    opacity: $semantic-opacity-disabled;
    cursor: not-allowed;
    pointer-events: none;
  }
  
  &--loading {
    cursor: wait;
    
    .ghost-button-content {
      opacity: $semantic-opacity-invisible;
    }
  }
  
  &--full-width {
    width: 100%;
  }
  
  // Loader styles
  .ghost-button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  .ghost-button-spinner {
    width: $semantic-spacing-4; // 1rem
    height: $semantic-spacing-4; // 1rem
    border: $semantic-border-width-2 solid rgba($semantic-color-brand-primary, 0.3);
    border-top: $semantic-border-width-2 solid $semantic-color-brand-primary;
    border-radius: $semantic-border-radius-full;
    animation: spin 1s $semantic-motion-easing-linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  // Ripple effect (basic implementation)
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba($semantic-color-brand-primary, 0.08) 0%, transparent 70%);
    transform: scale(0);
    opacity: $semantic-opacity-invisible;
    pointer-events: none;
    transition: transform $semantic-motion-duration-normal $semantic-motion-easing-ease, opacity $semantic-motion-duration-normal $semantic-motion-easing-ease;
    border-radius: inherit;
  }
  
  &:active:not(:disabled)::after {
    transform: scale(1);
    opacity: $semantic-opacity-opaque;
    transition: none;
  }
}