/**
 * Windows 95 Button Styles
 * Retro button component with 3D beveled edges
 */

.win95-button {
  min-width: var(--button-min-width);
  height: var(--button-height);
  padding: 0 12px;
  
  font-family: var(--font-system);
  font-size: var(--font-size-normal);
  color: var(--win95-black);
  
  background-color: var(--win95-button-face);
  
  /* 3D Raised Effect */
  border-style: solid;
  border-width: 2px;
  border-top-color: var(--win95-button-highlight);
  border-left-color: var(--win95-button-highlight);
  border-right-color: var(--win95-button-dark-shadow);
  border-bottom-color: var(--win95-button-dark-shadow);
  box-shadow: 
    inset 1px 1px 0px var(--win95-white),
    inset -1px -1px 0px var(--win95-button-shadow);
  
  cursor: pointer;
  user-select: none;
  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  
  outline: none;
  position: relative;
}

/* Hover State */
.win95-button:hover:not(:disabled):not(.win95-button--active) {
  background-color: var(--win95-button-light);
}

/* Active/Pressed State */
.win95-button:active:not(:disabled),
.win95-button--active {
  /* Invert the 3D effect for pressed appearance */
  border-top-color: var(--win95-button-dark-shadow);
  border-left-color: var(--win95-button-dark-shadow);
  border-right-color: var(--win95-button-highlight);
  border-bottom-color: var(--win95-button-highlight);
  box-shadow: 
    inset -1px -1px 0px var(--win95-white),
    inset 1px 1px 0px var(--win95-button-shadow);
  
  /* Shift content down-right for pressed effect */
  padding-top: 2px;
  padding-left: 14px;
}

/* Focus State (dotted outline) */
.win95-button:focus-visible:not(:disabled) {
  outline: 1px dotted var(--win95-black);
  outline-offset: -4px;
}

/* Disabled State */
.win95-button:disabled,
.win95-button--disabled {
  color: var(--win95-gray-dark);
  cursor: not-allowed;
}

.win95-button:disabled .win95-button__text,
.win95-button--disabled .win95-button__text {
  /* Embossed text effect */
  text-shadow: 1px 1px 0px var(--win95-white);
}

/* Primary Variant (for default actions) */
.win95-button--primary {
  border: 3px solid var(--win95-black);
  font-weight: bold;
}

.win95-button--primary:not(:active):not(.win95-button--active) {
  box-shadow: 
    inset 0 0 0 1px var(--win95-button-highlight),
    inset 0 0 0 2px var(--win95-button-face);
}

/* Toolbar Variant (flatter, for toolbars) */
.win95-button--toolbar {
  min-width: auto;
  padding: 2px 4px;
  border-width: 1px;
}

.win95-button--toolbar:not(:hover):not(:active):not(.win95-button--active) {
  border-color: transparent;
  box-shadow: none;
}

/* Icon Styling */
.win95-button__icon {
  display: inline-flex;
  align-items: center;
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.win95-button__text {
  line-height: 1;
}

/* Spacing for icon + text */
.win95-button__icon + .win95-button__text {
  margin-left: 4px;
}
