@use '../../themes/index' as *;
@use '../../abstracts/index' as *;

/* 
  Action button styles
  Used specifically for game installation/uninstallation 
*/
.action-button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: var(--bold);
  -webkit-font-smoothing: subpixel-antialiased;
  text-rendering: geometricPrecision;
  color: var(--text-heavy);
  min-width: 0;
  white-space: nowrap;
  transition: all var(--duration-normal) var(--easing-ease-out);

  &.install {
    background-color: var(--success);

    &:hover {
      background-color: var(--success-light);
    }
  }

  &.uninstall {
    background-color: var(--danger);

    &:hover {
      background-color: var(--danger-light);
    }
  }

  &:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: var(--disabled);
    position: relative;
    overflow: hidden;

    &::after {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 50%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
      animation: button-loading 1.5s infinite;
    }
  }
}

// Edit button appearing on game cards
.edit-button {
  padding: 0 0.7rem;
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: var(--bold);
  -webkit-font-smoothing: subpixel-antialiased;
  text-rendering: geometricPrecision;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 1px;
  transition: all var(--duration-normal) var(--easing-ease-out);

  svg {
    color: var(--text-primary);
  }

  &:hover {
    background-color: rgba(255, 255, 255, 0.3);
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  // Settings icon button variant
  &.settings-icon-button {
    svg {
      transition: transform var(--duration-normal) var(--easing-ease-out);
    }
    &:hover svg {
      transform: rotate(45deg);
    }
  }
}

// Animation for loading state
@keyframes button-loading {
  to {
    left: 100%;
  }
}
